diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-22 15:01:52 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-22 15:01:52 +0200 |
commit | 5f610dc4bf2f56080cc88b253d5a8709cf906394 (patch) | |
tree | 55bae979407e2967c5a58d4a6d4e3bb1a7d97c9b /extras | |
parent | 35e1d13e94c8937736030705d879ffb7f1c57fb7 (diff) | |
download | fpGUI-5f610dc4bf2f56080cc88b253d5a8709cf906394.tar.xz |
Fix Memo Mediator View
* Memo is not a descendant of TfpgBaseEdit.
* Also ControlMediator (TfpgWidget) reported its type as BaseEdit which
was wrong. It should have been TfpgWidget.
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/tiopf/gui/tiMediators.pas | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/extras/tiopf/gui/tiMediators.pas b/extras/tiopf/gui/tiMediators.pas index 93a8adc6..db125aca 100644 --- a/extras/tiopf/gui/tiMediators.pas +++ b/extras/tiopf/gui/tiMediators.pas @@ -202,12 +202,14 @@ type { Base class to handle TfpgMemo controls } - TtiMemoMediatorView = class(TtiBaseEditMediatorView) + TtiMemoMediatorView = class(TtiControlMediatorView) protected procedure SetupGUIandObject; override; procedure DoObjectToGui; override; procedure DoGuiToObject; override; + procedure SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); override; public + constructor Create; override; function View: TfpgMemo; reintroduce; class function ComponentClass: TClass; override; end; @@ -251,7 +253,7 @@ const procedure RegisterFallBackMediators; begin - gMediatorManager.RegisterMediator(TtiEditMediatorView, TtiObject, [tkSString,tkAString,tkInteger,tkFloat]); + gMediatorManager.RegisterMediator(TtiEditMediatorView, TtiObject, [tkSString,tkAString,tkLString,tkWString,tkUString,tkInteger,tkFloat]); gMediatorManager.RegisterMediator(TtiEditIntegerMediatorView, TtiObject, [tkInteger]); gMediatorManager.RegisterMediator(TtiEditFloatMediatorView, TtiObject, [tkFloat]); gMediatorManager.RegisterMediator(TtiEditCurrencyMediatorView, TtiObject, [tkFloat]); @@ -261,7 +263,7 @@ begin gMediatorManager.RegisterMediator(TtiDynamicComboBoxMediatorView, TtiObject, [tkClass]); gMediatorManager.RegisterMediator(TtiStaticTextMediatorView, TtiObject); gMediatorManager.RegisterMediator(TtiTrackBarMediatorView, TtiObject, [tkInteger]); - gMediatorManager.RegisterMediator(TtiMemoMediatorView, TtiObject, [tkSString,tkAString]); + gMediatorManager.RegisterMediator(TtiMemoMediatorView, TtiObject, [tkSString,tkAString,tkLString,tkWString,tkUString]); gMediatorManager.RegisterMediator(TtiCalendarComboMediatorView, TtiObject, [tkFloat]); gMediatorManager.RegisterMediator(TtiSpinEditMediatorView, TtiObject, [tkInteger]); gMediatorManager.RegisterMediator(TtiSpinEditFloatMediatorView, TtiObject, [tkFloat]); @@ -342,7 +344,7 @@ end; class function TtiControlMediatorView.ComponentClass: TClass; begin - Result := TfpgEdit; + Result := TfpgWidget; end; { TtiBaseEditMediatorView } @@ -557,6 +559,23 @@ begin Subject.PropValue[FieldName] := View.Lines.Text; end; +procedure TtiMemoMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdateMoment); +begin + inherited SetObjectUpdateMoment(AValue); + if View <> nil then + if ObjectUpdateMoment in [ouOnChange,ouCustom] then + View.OnChange := @DoOnChange + else + View.OnExit := @DoOnChange; +end; + +constructor TtiMemoMediatorView.Create; +begin + inherited Create; +// FControlReadOnlyColor := clWindowBackground; + GUIFieldName := 'Lines'; +end; + function TtiMemoMediatorView.View: TfpgMemo; begin Result := TfpgMemo(inherited View); @@ -570,7 +589,7 @@ end; procedure TtiMemoMediatorView.SetupGUIandObject; begin inherited SetupGUIandObject; - View.Lines.Clear; + View.Lines.Text := ''; end; |