diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-09-07 22:20:47 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-09-07 22:20:47 +0000 |
commit | ba30bb0298fc9c7b448d280884d1beb1368300c3 (patch) | |
tree | 8d23eb38cc82bd0841a77719464e76a177c4b558 /extras/tiopf/gui | |
parent | a89206b6e0221d5cd71c60541b4f273e294396de (diff) | |
download | fpGUI-ba30bb0298fc9c7b448d280884d1beb1368300c3.tar.xz |
* Bugfix in TDynamicComboBoxView mediator class.
* A few other minor changes to mediators
* Extended the tiOPF demo 21 even further, showing more features of MGM implementation.
Diffstat (limited to 'extras/tiopf/gui')
-rw-r--r-- | extras/tiopf/gui/tiListMediators.pas | 14 | ||||
-rw-r--r-- | extras/tiopf/gui/tiMediators.pas | 8 |
2 files changed, 16 insertions, 6 deletions
diff --git a/extras/tiopf/gui/tiListMediators.pas b/extras/tiopf/gui/tiListMediators.pas index 5aca05d7..f00fa56d 100644 --- a/extras/tiopf/gui/tiListMediators.pas +++ b/extras/tiopf/gui/tiListMediators.pas @@ -33,9 +33,10 @@ type procedure SetSelectedObject(const AValue: TtiObject);override; procedure CreateColumns; override; procedure DoCreateItemMediator(AData: TtiObject; ARowIdx : Integer); override; - Function GetGuiControl : TComponent; override; - Procedure SetGuiControl (Const AValue : TComponent); override; + function GetGuiControl : TComponent; override; + procedure SetGuiControl (Const AValue : TComponent); override; procedure SetupGUIandObject; override; + procedure ClearList; override; procedure RebuildList; override; public constructor CreateCustom(AModel: TtiObjectList; AView: TfpgListView; ADisplayNames: string; AIsObserving: Boolean = True); overload; @@ -43,7 +44,7 @@ type class function ComponentClass: TClass; override; Constructor Create; override; Destructor Destroy; override; - procedure HandleSelectionChanged; override; + procedure HandleSelectionChanged; {override;} published property View: TfpgListView read FView Write SetView; end; @@ -131,7 +132,7 @@ type destructor Destroy; override; class function CompositeMediator: Boolean; override; class function ComponentClass: TClass; override; - procedure HandleSelectionChanged; override; + procedure HandleSelectionChanged; {override;} property View: TfpgListBox read FView; end; @@ -234,6 +235,11 @@ begin // FView.ScrollBars := ssAutoBoth; end; +procedure TListViewMediator.ClearList; +begin + View.Items.Clear; +end; + procedure TListViewMediator.RebuildList; begin MediatorList.Clear; diff --git a/extras/tiopf/gui/tiMediators.pas b/extras/tiopf/gui/tiMediators.pas index 828a5eb8..2825c1f4 100644 --- a/extras/tiopf/gui/tiMediators.pas +++ b/extras/tiopf/gui/tiMediators.pas @@ -508,8 +508,10 @@ end; procedure TMediatorDynamicComboBoxView.SetListObject(const AValue: TtiObjectList); begin - Inherited; + inherited; InternalListRefresh; + if Assigned(ValueList) then + EditControl.Enabled := ValueList.Count > 0; end; procedure TMediatorDynamicComboBoxView.InternalListRefresh; @@ -565,7 +567,9 @@ begin if UseInternalOnChange then EditControl.OnChange := @DoOnChange; // default OnChange event handler - EditControl.Enabled := (ValueList.Count > 0); + {$Note As far as I can see, ValueList is always going to be nil here! - Graeme } + if ValueList <> nil then + EditControl.Enabled := (ValueList.Count > 0); end; procedure TMediatorDynamicComboBoxView.DoGuiToObject; |