diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-03-12 15:41:16 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-03-12 15:41:16 +0200 |
commit | fdcf05ea04ea3d6b83ad0bbfd685955e928d72cb (patch) | |
tree | c505934adfc504a9e385c3007f20ef2ec314904e /extras | |
parent | 3806f77a04166107a93ba7a943aae3c58c703496 (diff) | |
download | fpGUI-fdcf05ea04ea3d6b83ad0bbfd685955e928d72cb.tar.xz |
tiopf: Fix edit mediators by disabling event handlers on destruction.
Diffstat (limited to 'extras')
-rw-r--r-- | extras/tiopf/gui/tiMediators.pas | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/extras/tiopf/gui/tiMediators.pas b/extras/tiopf/gui/tiMediators.pas index bc1f2c4e..4a066a2b 100644 --- a/extras/tiopf/gui/tiMediators.pas +++ b/extras/tiopf/gui/tiMediators.pas @@ -379,10 +379,17 @@ procedure TtiBaseEditMediatorView.SetObjectUpdateMoment( begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnchange,ouCustom] then THackBaseEdit(View).OnChange := @DoOnChange else THackBaseEdit(View).OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiBaseEditMediatorView.Create; @@ -448,10 +455,17 @@ procedure TtiSpinEditMediatorView.SetObjectUpdateMoment( begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiSpinEditMediatorView.Create; @@ -489,10 +503,17 @@ procedure TtiTrackBarMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectU begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoTrackBarChanged // TfpgTrackBar has a different event signature else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiTrackBarMediatorView.Create; @@ -539,10 +560,17 @@ procedure TtiComboBoxMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectU begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; @@ -562,10 +590,17 @@ procedure TtiMemoMediatorView.SetObjectUpdateMoment(const AValue: TtiObjectUpdat begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiMemoMediatorView.Create; @@ -731,10 +766,17 @@ procedure TtiCheckBoxMediatorView.SetObjectUpdateMoment( begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiCheckBoxMediatorView.Create; @@ -798,10 +840,17 @@ procedure TtiCalendarComboMediatorView.SetObjectUpdateMoment( begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiCalendarComboMediatorView.Create; @@ -858,10 +907,17 @@ procedure TtiSpinEditFloatMediatorView.SetObjectUpdateMoment( begin inherited SetObjectUpdateMoment(AValue); if View <> nil then + begin if ObjectUpdateMoment in [ouOnChange,ouCustom] then View.OnChange := @DoOnChange else View.OnExit := @DoOnChange; + if ObjectUpdateMoment in [ouNone] then + begin + THackbaseEdit(View).OnChange := nil; + THackbaseEdit(View).OnExit := nil; + end; + end; end; constructor TtiSpinEditFloatMediatorView.Create; |