Commit 2445ed29 authored by Martin Schreiber's avatar Martin Schreiber

+ iificlient.getifidatatype().

+ TField.ondataentered.
+ T*Field.onsetvalue.
parent ab43141d
......@@ -24,12 +24,6 @@ uses
mseclasses,mselist,mseglob,msearrayutils;
type
listdatatypety = (dl_none,dl_integer,dl_int64,dl_currency,
dl_real,dl_realint,dl_realsum,
dl_datetime,
dl_ansistring,dl_msestring,dl_doublemsestring,dl_msestringint,
dl_complex,dl_rowstate,dl_custom);
listdatatypesty = set of listdatatypety;
dataprocty = procedure(var data) of object;
{
......@@ -206,6 +200,8 @@ type
procedure datamoved(const fromindex: integer; const toindex: integer;
const acount: integer); virtual;
procedure setitemselected(const row: integer; const value: boolean); virtual;
//iificlient
function getifidatatype(): listdatatypety virtual;
public
constructor create; override;
destructor destroy; override;
......@@ -3046,6 +3042,11 @@ begin
//dummy
end;
function tdatalist.getifidatatype(): listdatatypety;
begin
result:= datatype;
end;
{ tintegerdatalist }
constructor tintegerdatalist.create;
......
......@@ -2,7 +2,7 @@ unit msesumlist;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
interface
uses
msedatalist,msetypes,msearrayprops,mseclasses;
msedatalist,msetypes,msearrayprops,mseclasses,mseglob;
//todo: optimize!!!
......
......@@ -266,6 +266,7 @@ type
// fproviderflags1: providerflags1ty;
// flookupinfo: lookupfieldinfoty;
//ifieldcomponent
fonsetvalue: msestringfieldsetvalueeventty;
procedure setdsintf(const avalue: idsfieldcontroller);
function getinstance: tfield;
function getdefaultexpression: msestring;
......@@ -293,6 +294,8 @@ type
procedure SetVarValue(const AValue: Variant); override;
procedure change; override;
procedure SetDataset(AValue : TDataset); override;
procedure dosetvalue(const sender: tobject; var avalue: msestring;
var accept: boolean) override;
public
destructor destroy; override;
function HasParent: Boolean; override;
......@@ -324,6 +327,8 @@ type
// property ReadOnly default false;
// property Required default false;
property Transliterate default false;
property onsetvalue: msestringfieldsetvalueeventty
read fonsetvalue write fonsetvalue;
end;
tmseguidfield = class(tmsefield,imsefield)
......@@ -1191,6 +1196,10 @@ type
procedure setfield(const value: tfield); virtual;
procedure updatefields; override;
function getsortfield: tfield; virtual;
procedure setvalue(const sender: iificlient;
var avalue; var accept: boolean; const arow: integer); override;
procedure dataentered(const sender: iificlient;
const arow: integer); override;
public
function assql: msestring;
function fieldactive: boolean;
......@@ -1889,6 +1898,7 @@ type
tparam1 = class(tparam);
tdatasource1 = class(tdatasource);
tmsebufdataset1 = class(tmsebufdataset);
tfield1 = class(tfield);
function dbtrystringtoguid(const value: string; out guid: tguid): boolean;
var
......@@ -3841,6 +3851,14 @@ begin
end;
end;
procedure tmsestringfield.dosetvalue(const sender: tobject;
var avalue: msestring; var accept: boolean);
begin
if assigned(fonsetvalue) then begin
fonsetvalue(self,sender,avalue,accept);
end;
end;
{ tmsememofield }
constructor tmsememofield.create(aowner: tcomponent);
......@@ -6914,6 +6932,43 @@ begin
result:= ffield;
end;
procedure tfielddatalink.setvalue(const sender: iificlient; var avalue;
var accept: boolean; const arow: integer);
begin
inherited;
if ffield <> nil then begin
case sender.getifidatatype() of
dl_integer: begin
tfield1(ffield).dosetvalue(sender.getinstance,int32(avalue),accept);
end;
dl_int64: begin
tfield1(ffield).dosetvalue(sender.getinstance,int64(avalue),accept);
end;
dl_currency: begin
tfield1(ffield).dosetvalue(sender.getinstance,currency(avalue),accept);
end;
dl_real: begin
tfield1(ffield).dosetvalue(sender.getinstance,flo64(avalue),accept);
end;
dl_msestring: begin
tfield1(ffield).dosetvalue(sender.getinstance,msestring(avalue),accept);
end;
dl_ansistring: begin
tfield1(ffield).dosetvalue(sender.getinstance,ansistring(avalue),accept);
end;
end;
end;
end;
procedure tfielddatalink.dataentered(const sender: iificlient;
const arow: integer);
begin
inherited;
if ffield <> nil then begin
tfield1(ffield).dodataentered(sender.getinstance);
end;
end;
{ tpersistentfields }
constructor tpersistentfields.create(const adataset: tdataset);
......
......@@ -19,7 +19,8 @@ unit msedbedit;
interface
uses
mdb,classes,mclasses,mseguiglob,mseclasses,msegui,msetoolbar,mseeditglob,
mdb,classes,mclasses,mseguiglob,mseclasses,msegui,msetoolbar,
mseeditglob,
mseglob,msewidgetgrid,msearrayutils,msedatalist,mseinterfaces,
msetypes,msegrids,msegraphics,mseevent,msekeyboard,mseassistiveclient,
msegraphedits,msestrings,msegraphutils,mselist,msedropdownlist,
......@@ -1940,6 +1941,7 @@ type
//iificlient
procedure setifiserverintf(const aintf: iifiserver);
function getdefaultifilink: iificlient; virtual;
function getifidatatype(): listdatatypety virtual;
//idbeditinfo
procedure getfieldtypes(out propertynames: stringarty;
......@@ -10022,6 +10024,11 @@ begin
result:= iificlient(self);
end;
function tdbstringcol.getifidatatype(): listdatatypety;
begin
result:= dl_msestring;
end;
{
procedure tdbstringcol.docellevent(var info: celleventinfoty);
begin
......
......@@ -77,6 +77,8 @@ type
function getifidatalinkintf: iifidatalink; override;
function getoptionsedit: optionseditty; override;
procedure dochange; override;
//iificlient
function getifidatatype(): listdatatypety override;
//iifidatalink
procedure ifisetvalue(var avalue; var accept: boolean);
function getifilinkkind: ptypeinfo; virtual;
......@@ -2987,8 +2989,14 @@ begin
end;
end;
end;
{$endif mse_with_ifi}
function tcustomdataedit.getifidatatype(): listdatatypety;
begin
result:= getdatalistclass().datatype();
end;
procedure tcustomdataedit.sizechanged;
begin
inherited;
......
......@@ -148,6 +148,8 @@ type
function getifilinkkind: ptypeinfo;
procedure setifilink(const avalue: tifilinkcomp);
function getifilink: tifilinkcomp;
//iificlient
function getifidatatype(): listdatatypety override;
// function ifigriddata: tdatalist;
procedure updateifigriddata(const sender: tobject; const alist: tdatalist);
function getgriddata: tdatalist;
......@@ -2409,6 +2411,11 @@ begin
result:= fifilink;
end;
function tgraphdataedit.getifidatatype(): listdatatypety;
begin
result:= getdatalistclass().datatype();
end;
procedure tgraphdataedit.setifilink(const avalue: tifilinkcomp);
begin
mseificomp.setifilinkcomp(iifidatalink(self),avalue,tifilinkcomp(fifilink));
......
......@@ -11,7 +11,7 @@ unit msevaluenodesglob;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
interface
uses
msedatalist;
msedatalist,mseglob;
type
recvaluety = record
datatype: listdatatypety;
......
This diff is collapsed.
......@@ -14,7 +14,7 @@ unit mseifidbcomp;
{$ifdef FPC}{$mode objfpc}{$h+}{$interfaces corba}{$endif}
interface
uses
mseificomp,msesqlresult,msqldb,mseclasses,classes,msedatalist,msestrings,mdb,
mseglob,mseificomp,msesqlresult,msqldb,mseclasses,classes,msedatalist,msestrings,mdb,
msedb,msetypes,mseinterfaces;
type
{
......
......@@ -28,6 +28,10 @@ type
ifiwidgetstatety = ({iws_closed,}iws_loaded,iws_releasing,iws_destroying,
iws_visible,iws_enabled,iws_entered,iws_focused,iws_active);
ifiwidgetstatesty = set of ifiwidgetstatety;
const
ifidatatypes = [dl_integer,dl_int64,dl_currency,dl_real,
dl_msestring,dl_ansistring,dl_msestringint,
dl_realint,dl_realsum];
type
iificlient = interface;
......@@ -50,6 +54,7 @@ type
iificlient = interface(iobjectlink)[miid_iificlient]
procedure setifiserverintf(const aintf: iifiserver);
function getdefaultifilink: iificlient;
function getifidatatype: listdatatypety;
end;
ificommandcodety = (icc_none,icc_close,icc_release);
iificommand = interface(inullinterface)[miid_iificommand]
......
......@@ -21,9 +21,6 @@ type
formlinkoptionsty = set of formlinkoptionty;
const
defaultformlinkoptions = [flo_useclientchannel];
ifidatatypes = [dl_integer,dl_int64,dl_currency,dl_real,
dl_msestring,dl_ansistring,dl_msestringint,
dl_realint,dl_realsum];
type
tmodulelinkarrayprop = class;
......
......@@ -477,6 +477,7 @@ type
//iificlient
procedure setifiserverintf(const aintf: iifiserver);
function getdefaultifilink: iificlient; virtual;
function getifidatatype: listdatatypety virtual;
//iificommand
procedure executeificommand(var acommand: ificommandcodety); virtual;
{$endif}
......@@ -5265,6 +5266,11 @@ begin
result:= iificlient(self);
end;
function tmsecomponent.getifidatatype: listdatatypety;
begin
result:= dl_none;
end;
{$endif}
{ tlinkedqueue }
......
......@@ -17,6 +17,13 @@ const
defaultbase64linelength = 76; //todo: find better place
type
listdatatypety = (dl_none,dl_integer,dl_int64,dl_currency,
dl_real,dl_realint,dl_realsum,
dl_datetime,
dl_ansistring,dl_msestring,dl_doublemsestring,dl_msestringint,
dl_complex,dl_rowstate,dl_custom);
listdatatypesty = set of listdatatypety;
shortcutty = type word;
shortcutarty = array of shortcutty;
modalresultty = (mr_none,mr_canclose,mr_windowclosed,mr_windowdestroyed,
......
......@@ -19,7 +19,8 @@ unit regifi;
interface
implementation
uses
classes,mseificomp,msedesignintf,regifi_bmp,msepropertyeditors,mseclasses,
mseglob,classes,mseificomp,msedesignintf,regifi_bmp,msepropertyeditors,
mseclasses,
msecomponenteditors,mseificomponenteditors,msetypes{msestrings},msedatalist,
{$ifndef mse_no_db}{$ifdef FPC}mseifidbcomp,{$endif}{$endif}
mseifidialogcomp,mseifigui,mseifiendpoint,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment