base widget, get rid of the centralized option system

This commit is contained in:
Basile Burg 2015-05-11 08:34:25 +02:00
parent 218287f7a0
commit 6f15f67e3b
1 changed files with 2 additions and 51 deletions

View File

@ -14,7 +14,7 @@ type
* Base type for an UI module. * Base type for an UI module.
*) *)
PTCEWidget = ^TCEWidget; PTCEWidget = ^TCEWidget;
TCEWidget = class(TForm, ICEContextualActions, ICESessionOptionsObserver) TCEWidget = class(TForm, ICEContextualActions)
Content: TPanel; Content: TPanel;
Back: TPanel; Back: TPanel;
contextMenu: TPopupMenu; contextMenu: TPopupMenu;
@ -30,11 +30,6 @@ type
procedure setLoopInt(aValue: Integer); procedure setLoopInt(aValue: Integer);
procedure updaterAutoProc(Sender: TObject); procedure updaterAutoProc(Sender: TObject);
procedure updaterLatchProc(Sender: TObject); procedure updaterLatchProc(Sender: TObject);
//
procedure optget_LoopInterval(aWriter: TWriter);
procedure optset_LoopInterval(aReader: TReader);
procedure optget_UpdaterDelay(aWriter: TWriter);
procedure optset_UpdaterDelay(aReader: TReader);
protected protected
fDockable: boolean; fDockable: boolean;
fModal: boolean; fModal: boolean;
@ -50,10 +45,6 @@ type
function contextActionCount: integer; virtual; function contextActionCount: integer; virtual;
function contextAction(index: integer): TAction; virtual; function contextAction(index: integer): TAction; virtual;
// //
procedure sesoptBeforeSave; virtual;
procedure sesoptDeclareProperties(aFiler: TFiler); virtual;
procedure sesoptAfterLoad; virtual;
//
function getIfModal: boolean; function getIfModal: boolean;
published published
property updaterByLoopInterval: Integer read fLoopInter write setLoopInt; property updaterByLoopInterval: Integer read fLoopInter write setLoopInt;
@ -67,7 +58,7 @@ type
procedure beginDelayedUpdate; procedure beginDelayedUpdate;
// prevent any pending update. // prevent any pending update.
procedure stopDelayedUpdate; procedure stopDelayedUpdate;
// immediate call any pending delayed update. // calls immediattly any pending delayed update.
procedure forceDelayedUpdate; procedure forceDelayedUpdate;
// increments the imperative updates count. // increments the imperative updates count.
@ -100,8 +91,6 @@ type
property widget[index: integer]: TCEWidget read getWidget; property widget[index: integer]: TCEWidget read getWidget;
end; end;
TWidgetEnumerator = class TWidgetEnumerator = class
fList: TCEWidgetList; fList: TCEWidgetList;
fIndex: Integer; fIndex: Integer;
@ -158,44 +147,6 @@ begin
if isDockable then result := false if isDockable then result := false
else result := fModal; else result := fModal;
end; end;
{$ENDREGION}
{$REGION ICESessionOptionsObserver ---------------------------------------------}
procedure TCEWidget.sesoptBeforeSave;
begin
end;
procedure TCEWidget.sesoptDeclareProperties(aFiler: TFiler);
begin
// override rules: inherited must be called. No dots in the property name, property name prefixed with the widget Name
aFiler.DefineProperty(Name + '_updaterByLoopInterval', @optset_LoopInterval, @optget_LoopInterval, true);
aFiler.DefineProperty(Name + '_updaterByDelayDuration', @optset_UpdaterDelay, @optget_UpdaterDelay, true);
end;
procedure TCEWidget.sesoptAfterLoad;
begin
end;
procedure TCEWidget.optget_LoopInterval(aWriter: TWriter);
begin
aWriter.WriteInteger(fLoopInter);
end;
procedure TCEWidget.optset_LoopInterval(aReader: TReader);
begin
updaterByLoopInterval := aReader.ReadInteger;
end;
procedure TCEWidget.optget_UpdaterDelay(aWriter: TWriter);
begin
aWriter.WriteInteger(fDelayDur);
end;
procedure TCEWidget.optset_UpdaterDelay(aReader: TReader);
begin
updaterByDelayDuration := aReader.ReadInteger;
end;
{$ENDREGION} {$ENDREGION}
{$REGION ICEContextualActions---------------------------------------------------} {$REGION ICEContextualActions---------------------------------------------------}