View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033076 | Lazarus | LCL | public | 2018-01-26 01:51 | 2021-02-27 00:41 |
Reporter | Benjamin Clements | Assigned To | Ondrej Pokorny | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | assigned | Resolution | reopened | ||
Platform | Windows | OS | Windows 10 | ||
Product Version | 1.8 | ||||
Target Version | 2.2 | Fixed in Version | 1.9 (SVN) | ||
Summary | 0033076: TCheckBox state change does not trigger OnChange event | ||||
Description | Changing the State of a TCheckBox does not trigger the OnChange event like changing Checked or manually clicking does | ||||
Steps To Reproduce | Set an OnChange event handler on a checkbox and change the state, it will not run. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 57155 | ||||
LazTarget | 2.0 | ||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
parent of | 0033088 | closed | Ondrej Pokorny | Patches | Tool, Options crashes for IDE compiled for Carbon |
related to | 0033573 | closed | Ondrej Pokorny | Lazarus | DBChekbox enter dataset to edit mode |
related to | 0035018 | closed | Michl | Lazarus | The builded EXE crashes before the formular is showing |
related to | 0036170 | resolved | Juha Manninen | Lazarus | When you have multiple toggle boxes and select different ones causes system to lock |
|
|
|
Also applicable to 1.6.4 |
|
It does not work on Linux too. Note: CheckBoxes in Delphi7 don't have OnChange event. |
|
Patch added |
|
checkbox.diff (319 bytes)
Index: lcl/include/customcheckbox.inc =================================================================== --- lcl/include/customcheckbox.inc (revision 57151) +++ lcl/include/customcheckbox.inc (working copy) @@ -29,6 +29,7 @@ begin FState := Value; ApplyChanges; + DoClickOnChange; end; end; |
|
Patch works on Linux+Qt, trunk. I'm curious what broked it. I don't see related changes in customcheckbox.inc. |
|
Maybe it never worked. |
|
I didn't apply the patch but used the same approach that also SetChecked uses (I am sure it's there for some reason.) |
|
@ Maybe it never worked. I'm almost sure it did. I implemented TECSwitch and TCheckBoxThemed events to mimic native TCheckBox and they both gives OnChange event when State property changes. |
|
> I'm almost sure it did. I just tested Lazarus 1.4.2 and it did not. |
|
I tested in 0.9.26, it does not work there. Juha is right, it never worked. |
|
> I tested in 0.9.26 I was so much younger then ... |
|
If you want to be wonderful a added solution would be to also add a "OnCheckChanged" event with a flag to indicate in which manner it got changed. 1: Mouse; 2: Keyboard; 3: Software; In many cases, if software is the reason, you may want to assume it could be setup (initiation) doing it. Also make sure to prevent reentry incase someone wants to change the state of it while in there. |
|
I hate to burst you guys bubble but it works for me here. 1.8.0 64bit Windows 10. Also please check the documentation. http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tcheckbox.html The CHECKED property.. It claims it does not work, does nothing. it does work.. Also, It claims the OnChange is for any change in properties.. not jus the check state toggle. w |
|
This caused a regression (see related issue) and must be reopened. |
|
> This caused a regression (see related issue) and must be reopened. Wasn't this resolved (see the related issue)? |
|
Delphi does not have a OnChange event... but its OnClick event fires always no matter what, software, user click etc...Kind of stupid when you are not even clicking on it.. Laz has both and currently both behave the exact way.. so there is two events doing the same exact action. Personally, I don't agree on a Non user event calling the OnClick handler and the OnChange event may have been implemented to not fire with non user input but now it does so we have a conflict . |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-01-26 01:51 | Benjamin Clements | New Issue | |
2018-01-26 01:51 | Benjamin Clements | File Added: CheckBox-State-OnChange.zip | |
2018-01-26 01:54 | Benjamin Clements | Note Added: 0106046 | |
2018-01-26 02:28 | Vojtech Cihak | Note Added: 0106047 | |
2018-01-26 17:00 | Serge Anvarov | Note Added: 0106053 | |
2018-01-26 17:01 | Serge Anvarov | File Added: checkbox.diff | |
2018-01-26 18:36 | Vojtech Cihak | Note Added: 0106054 | |
2018-01-27 07:04 | Ondrej Pokorny | Assigned To | => Ondrej Pokorny |
2018-01-27 07:04 | Ondrej Pokorny | Status | new => assigned |
2018-01-27 09:53 | Juha Manninen | Note Added: 0106063 | |
2018-01-27 13:58 | Ondrej Pokorny | Fixed in Revision | => 57155 |
2018-01-27 13:58 | Ondrej Pokorny | LazTarget | => - |
2018-01-27 13:58 | Ondrej Pokorny | Note Added: 0106066 | |
2018-01-27 13:58 | Ondrej Pokorny | Status | assigned => resolved |
2018-01-27 13:58 | Ondrej Pokorny | Resolution | open => fixed |
2018-01-27 13:59 | Vojtech Cihak | Note Added: 0106067 | |
2018-01-27 14:00 | Vojtech Cihak | Note Edited: 0106067 | View Revisions |
2018-01-27 14:04 | Ondrej Pokorny | Note Added: 0106068 | |
2018-01-27 14:05 | Ondrej Pokorny | LazTarget | - => 1.8 |
2018-01-27 14:05 | Ondrej Pokorny | Target Version | => 1.8.2 |
2018-01-27 14:35 | Vojtech Cihak | Note Added: 0106071 | |
2018-01-27 14:38 | Bart Broersma | Note Added: 0106072 | |
2018-01-27 19:41 | Ondrej Pokorny | Relationship added | parent of 0033088 |
2018-01-28 02:47 | jamie philbrook | Note Added: 0106078 | |
2018-01-28 03:03 | jamie philbrook | Note Added: 0106079 | |
2018-04-06 19:30 | Ondrej Pokorny | Relationship added | related to 0033573 |
2018-04-06 20:39 | Ondrej Pokorny | LazTarget | 1.8 => 1.10 |
2018-04-06 20:39 | Ondrej Pokorny | Fixed in Version | => 1.9 (SVN) |
2018-04-06 20:39 | Ondrej Pokorny | Target Version | 1.8.2 => 1.10 |
2019-02-05 22:03 | Michl | Relationship added | related to 0035018 |
2019-10-13 07:44 | Juha Manninen | Relationship added | related to 0036170 |
2019-10-13 07:48 | Juha Manninen | Status | resolved => assigned |
2019-10-13 07:48 | Juha Manninen | Resolution | fixed => reopened |
2019-10-13 07:48 | Juha Manninen | Note Added: 0118542 | |
2020-01-16 03:47 | Ondrej Pokorny | Note Added: 0120472 | |
2021-02-26 15:51 | Martin Friebe | LazTarget | 1.10 => 2.0 |
2021-02-26 19:34 | Martin Friebe | Target Version | 1.10 => 2.2 |
2021-02-27 00:41 | jamie philbrook | Note Added: 0129188 |