From b3d0fa099f95a2ef19fc35ec24d4749c28e74974 Mon Sep 17 00:00:00 2001 From: graemeg Date: Sun, 23 Mar 2008 14:45:47 +0000 Subject: * minor changes for tiOPF mediators. --- extras/tiopf/gui/tiCompositeMediators.pas | 14 ++++++++++---- extras/tiopf/gui/tiGenericListMediators.pas | 7 ++++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'extras/tiopf/gui') diff --git a/extras/tiopf/gui/tiCompositeMediators.pas b/extras/tiopf/gui/tiCompositeMediators.pas index 4ac4fece..34417aa8 100644 --- a/extras/tiopf/gui/tiCompositeMediators.pas +++ b/extras/tiopf/gui/tiCompositeMediators.pas @@ -24,14 +24,14 @@ type { Composite mediator for TfpgListView } TCompositeListViewMediator = class(TtiObject) private - FIsObserving: Boolean; - FDisplayNames: string; - FShowDeleted: Boolean; function GetSelectedObject: TtiObject; procedure SetSelectedObject(const AValue: TtiObject); procedure SetShowDeleted(const AValue: Boolean); procedure DoCreateItemMediator(AData: TtiObject); protected + FIsObserving: Boolean; + FDisplayNames: string; + FShowDeleted: Boolean; FView: TfpgListView; FModel: TtiObjectList; FMediatorList: TObjectList; @@ -98,7 +98,8 @@ type FModel: TtiObject; FView: TfpgLVItem; FDisplayNames: string; - procedure SetupFields; + protected + procedure SetupFields; virtual; public constructor CreateCustom(AModel: TtiObject; AView: TfpgLVItem; const ADisplayNames: string; IsObserving: Boolean = True); procedure BeforeDestruction; override; @@ -130,6 +131,11 @@ type end; +function tiFieldName(const AField: string): string; +function tiFieldWidth(const AField: string): integer; +function tiFieldCaption(const AField: string): string; + + implementation uses diff --git a/extras/tiopf/gui/tiGenericListMediators.pas b/extras/tiopf/gui/tiGenericListMediators.pas index 52aa60ed..4f15b9d1 100644 --- a/extras/tiopf/gui/tiGenericListMediators.pas +++ b/extras/tiopf/gui/tiGenericListMediators.pas @@ -215,8 +215,8 @@ begin selected := View.FocusItem; end; - ptr := View.OnSelect; - View.OnSelect := nil; + ptr := View.OnChange; + View.OnChange := nil; View.Items.BeginUpdate; try View.Items.Clear; @@ -237,7 +237,7 @@ begin finally View.Items.EndUpdate; view.Update; - View.OnSelect := ptr; + View.OnChange := ptr; HandleSelectionChanged; end; end; @@ -349,6 +349,7 @@ begin end; finally View.Items.EndUpdate; + View.FocusItem := 1; View.OnChange := ptr; HandleSelectionChanged; end; -- cgit v1.2.3-70-g09d2