From d19273b99f8b4dd3bbe03eef0f0bcc7b338b13e8 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 19 May 2011 16:39:19 +0200 Subject: Checkbox: setting checked now fires OnChange event Before the OnChange was not fired, but now it is. The only exception is while the widget is in the UI Designer form. --- src/gui/fpg_checkbox.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/fpg_checkbox.pas b/src/gui/fpg_checkbox.pas index 55c9a3a8..a68ecfa0 100644 --- a/src/gui/fpg_checkbox.pas +++ b/src/gui/fpg_checkbox.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2011 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -116,6 +116,8 @@ begin Exit; //==> FChecked := AValue; RePaint; + if not (csDesigning in ComponentState) then + DoOnChange; end; function TfpgBaseCheckBox.GetBoxLayout: TBoxLayout; @@ -244,7 +246,6 @@ begin inherited HandleLMouseUp(x, y, shiftstate); FIsPressed := False; Checked := not FChecked; - DoOnChange; end; procedure TfpgBaseCheckBox.HandleKeyRelease(var keycode: word; @@ -254,7 +255,6 @@ begin begin consumed := True; Checked := not FChecked; - DoOnChange; end; if consumed then -- cgit v1.2.3-70-g09d2