summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-01-29 08:59:36 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-01-29 08:59:36 +0000
commit21dbed3e7a4278d75e1ff4da9a6b3e7acf4b6f53 (patch)
treeba54a2dae17d7fec58eca1c178bd3f0dcec24f26 /extras
parentef34b0317d543a5c06db61860516bee181db6e0f (diff)
downloadfpGUI-21dbed3e7a4278d75e1ff4da9a6b3e7acf4b6f53.tar.xz
* Composite Mediators - made some methods virtual and moved other classes to the interfaces section so that developers can extend or override them.
Diffstat (limited to 'extras')
-rw-r--r--extras/tiopf/gui/tiCompositeMediators.pas40
1 files changed, 22 insertions, 18 deletions
diff --git a/extras/tiopf/gui/tiCompositeMediators.pas b/extras/tiopf/gui/tiCompositeMediators.pas
index 3ab6b960..4ac4fece 100644
--- a/extras/tiopf/gui/tiCompositeMediators.pas
+++ b/extras/tiopf/gui/tiCompositeMediators.pas
@@ -21,7 +21,7 @@ uses
type
- { Composite mediator for TListView }
+ { Composite mediator for TfpgListView }
TCompositeListViewMediator = class(TtiObject)
private
FIsObserving: Boolean;
@@ -37,7 +37,7 @@ type
FMediatorList: TObjectList;
FObserversInTransit: TList;
FSelectedObject: TtiObject;
- procedure CreateSubMediators;
+ procedure CreateSubMediators; virtual;
procedure SetupGUIandObject; virtual;
procedure RebuildList; virtual;
function DataAndPropertyValid(const AData: TtiObject): Boolean;
@@ -46,7 +46,6 @@ type
constructor CreateCustom(AModel: TtiObjectList; AView: TfpgListView; ADisplayNames: string; IsObserving: Boolean = True);
procedure BeforeDestruction; override;
procedure Update(ASubject: TtiObject); override;
-
{ Called from the GUI to trigger events }
procedure HandleSelectionChanged; virtual;
published
@@ -59,6 +58,7 @@ type
end;
+ { Composite mediator for TfpgStringGrid }
TCompositeStringGridMediator = class(TtiObject)
private
FDisplayNames: string;
@@ -73,7 +73,7 @@ type
FView: TfpgStringGrid;
FModel: TtiObjectList;
FMediatorList: TObjectList;
- procedure CreateSubMediators;
+ procedure CreateSubMediators; virtual;
procedure SetupGUIandObject; virtual;
procedure RebuildStringGrid; virtual;
function DataAndPropertyValid(const AData: TtiObject): Boolean;
@@ -91,20 +91,8 @@ type
end;
-implementation
-
-uses
- tiUtils
- ,typinfo
- ,tiExcept
- ,tiGenericEditMediators
- ;
-
-const
- cFieldDelimiter = ';';
- cBrackets = '()';
-
-type
+ { Used internally for sub-mediators in ListView mediator. Moved to interface
+ section so it can be overridden. }
TListViewListItemMediator = class(TtiObject)
private
FModel: TtiObject;
@@ -122,6 +110,8 @@ type
end;
+ { Used internally for sub-mediators in StringGrid mediator. Moved to interface
+ section so it can be overridden. }
TStringGridRowMediator = class(TtiObject)
private
FDisplayNames: string;
@@ -140,6 +130,20 @@ type
end;
+implementation
+
+uses
+ tiUtils
+ ,typinfo
+ ,tiExcept
+ ,tiGenericEditMediators
+ ;
+
+const
+ cFieldDelimiter = ';';
+ cBrackets = '()';
+
+
{ Helper functions }
{ Extract the field name part from the AField string which is in the format