View Issue Details

IDProjectCategoryView StatusLast Update
0029406LazarusIDEpublic2016-02-05 08:41
ReporterBart BroersmaAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindowOS VersionWin7
Product Version1.7 (SVN)Product Buildr51253 
Target Version1.8Fixed in Version1.8 
Summary0029406: OI: with keyboard it is not possible to select a boolean property when using TCheckBoxThemed editor
DescriptionStart Lazarus
Go to OI
Select the form
Click on "action"
Now use cursor key (down arrow) to traverse the OI
Notice that it will skip "AllowDropfiles" and instead will select "Alphablend".
It will always skip the boolean property and go to the next one (which then in fact can be a boolean property).

Happens only if OI uses the checkbox for boolean types, which is default now.
TagsNo tags attached.
Fixed in Revisionr51454
LazTarget1.8
Widgetset
Attached Files
  • cbthemed.diff (778 bytes)
    Index: components/lazcontrols/checkboxthemed.pas
    ===================================================================
    --- components/lazcontrols/checkboxthemed.pas	(revision 51253)
    +++ components/lazcontrols/checkboxthemed.pas	(working copy)
    @@ -193,8 +193,8 @@
     begin
       inherited Create(AOwner);
       AccessibleRole := larCheckBox;
    -  ControlStyle := ControlStyle  + [csParentBackground, csReplicatable] - [csOpaque]
    -               - csMultiClicks - [csClickEvents, csNoStdEvents];  { inherited Click not used }
    +  ControlStyle := ControlStyle  + [csParentBackground, csReplicatable, csNoStdEvents] - [csOpaque]
    +               - csMultiClicks - [csClickEvents];  { inherited Click not used }
       FAlignment := taRightJustify;
       FAllowGrayed := False;
       AutoSize := True;
    
    cbthemed.diff (778 bytes)

Relationships

has duplicate 0029592 resolvedJuha Manninen Using up/down cursor keys in Object Inspector skips past properties with checkboxes 
related to 0029412 closedJuha Manninen Wrong position of TCheckBoxThemed in OI. 

Activities

Vojtech Cihak

2016-01-15 19:34

reporter   ~0088916

Last edited: 2016-01-15 19:34

View 2 revisions

I can confirm. When you do it slowly, you can notice that rows with non-bool properties respond to OnKeyDown only while rows with bool properties respond to both OnKeyDown and OnKeyUp.

Bart Broersma

2016-01-15 19:56

developer   ~0088917

I am in a ValueEdit, right above is a ValueCheckBox.
I press Enter, then I press the Up arrowkey:

TOICustomPropertyGrid.HandleStandardKeys 13
    FCurrentEdit = ValueEdit:TEdit
    HandleUnshifted
TOICustomPropertyGrid.HandleStandardKeys End 13 Handled=TRUE

TOICustomPropertyGrid.HandleStandardKeys 38 //VK_UP
    FCurrentEdit = ValueEdit:TEdit
    HandleUnshifted
TOICustomPropertyGrid.HandleStandardKeys End 38 Handled=TRUE

TOICustomPropertyGrid.ValueCheckBoxKeyDown:Key=38
TOICustomPropertyGrid.HandleStandardKeys 38
    FCurrentEdit = ValueCheckBox:TCheckBoxThemed
    HandleUnshifted
TOICustomPropertyGrid.HandleStandardKeys End 38 Handled=TRUE


So, even thougt VK_UP is hnadled in HandleStandardKeys (and it hen should get the value VK_UNKNWN), still after the new ValueCheckBox is selected, it receives a KeyDown(VK_UP), _before_ HandleStandardKeys, and this will again trigger a move to the editor above.

Bart Broersma

2016-01-15 20:07

developer   ~0088918

It does not happen with UseOINormalCheckBox defined.

Bart Broersma

2016-01-15 20:32

developer  

cbthemed.diff (778 bytes)
Index: components/lazcontrols/checkboxthemed.pas
===================================================================
--- components/lazcontrols/checkboxthemed.pas	(revision 51253)
+++ components/lazcontrols/checkboxthemed.pas	(working copy)
@@ -193,8 +193,8 @@
 begin
   inherited Create(AOwner);
   AccessibleRole := larCheckBox;
-  ControlStyle := ControlStyle  + [csParentBackground, csReplicatable] - [csOpaque]
-               - csMultiClicks - [csClickEvents, csNoStdEvents];  { inherited Click not used }
+  ControlStyle := ControlStyle  + [csParentBackground, csReplicatable, csNoStdEvents] - [csOpaque]
+               - csMultiClicks - [csClickEvents];  { inherited Click not used }
   FAlignment := taRightJustify;
   FAllowGrayed := False;
   AutoSize := True;
cbthemed.diff (778 bytes)

Bart Broersma

2016-01-15 20:34

developer   ~0088919

Attached patch cbthemed.diff solves the issue, but I am not sure this is OK.
Juha or Vojtech Cihak?

Vojtech Cihak

2016-01-15 20:59

reporter   ~0088921

I'm not sure too. TCheckBoxThemed was not designed only for OI but it can be used stand-alone as well. With csNoStdEvents it will be probably unusable out of OI.
I just don't know why OI doesn't respond to OnKeyUp of TEdit, TCombo etc.

Juha Manninen

2016-01-16 11:31

developer   ~0088945

Last edited: 2016-01-16 13:19

View 4 revisions

The patch causes a regression. The Space key does not toggle the value any more.

@Vojtech, what does this mean?
"When you do it slowly, you can notice that rows with non-bool properties respond to OnKeyDown only while rows with bool properties respond to both OnKeyDown and OnKeyUp."

Anyway, this control is used now only in OI. The priority is to fix the bug by any means without thinking of other uses of the control.
One choice is to use the "normal" OI checkbox for 1.6 release and solve the problem later without hurry.

[Edit] In r51304 I removed define UseOINormalCheckBox and added UseOICheckBoxThemed, inverting the logic.
Now the normal checkbox is used by default. I will mark it for merging to 1.6.
This issue is still valid but there is no urgent hurry to fix it.

Bart Broersma

2016-01-16 13:20

developer   ~0088951

What I do not understand: the previously active editor receives VK_Up/VK_Down, it calls HandleStandardKeys, which in trun sets Key := 0.
From that point on no control should receive any KeyDown message for this Key anymore, but yet the TCheckBoxThemed does.

Bart Broersma

2016-01-16 13:27

developer   ~0088952

Last edited: 2016-01-16 13:27

View 2 revisions

> The patch causes a regression. The Space key does not toggle the value any more.
Nor will it respond to the mouse.
So the patch is utterly wrong :-(

Reverting to normal checkbox for 1.6 may be the better solution.

Bart Broersma

2016-01-30 13:21

developer   ~0089526

Talking about "the problem is staring you into the face":

 procedure TCustomCheckBoxThemed.KeyUp(var Key: Word; Shift: TShiftState);
 begin
- inherited KeyDown(Key, Shift);
+ inherited KeyUp(Key, Shift);

Issue History

Date Modified Username Field Change
2016-01-15 18:12 Bart Broersma New Issue
2016-01-15 18:13 Bart Broersma LazTarget - => 1.6
2016-01-15 19:34 Vojtech Cihak Note Added: 0088916
2016-01-15 19:34 Vojtech Cihak Note Edited: 0088916 View Revisions
2016-01-15 19:56 Bart Broersma Note Added: 0088917
2016-01-15 20:07 Bart Broersma Note Added: 0088918
2016-01-15 20:32 Bart Broersma File Added: cbthemed.diff
2016-01-15 20:34 Bart Broersma Note Added: 0088919
2016-01-15 20:59 Vojtech Cihak Note Added: 0088921
2016-01-16 10:35 Bart Broersma Assigned To => Juha Manninen
2016-01-16 10:35 Bart Broersma Status new => assigned
2016-01-16 11:06 Juha Manninen Relationship added related to 0029412
2016-01-16 11:31 Juha Manninen Note Added: 0088945
2016-01-16 11:56 Juha Manninen Note Edited: 0088945 View Revisions
2016-01-16 13:08 Juha Manninen LazTarget 1.6 => -
2016-01-16 13:08 Juha Manninen Target Version 1.6 =>
2016-01-16 13:08 Juha Manninen Summary OI: using keyboard it is not possible to select a boolean property => OI: with keyboard it is not possible to select a boolean property when using TCheckBoxThemed editor
2016-01-16 13:18 Juha Manninen Note Edited: 0088945 View Revisions
2016-01-16 13:19 Juha Manninen Note Edited: 0088945 View Revisions
2016-01-16 13:20 Bart Broersma Note Added: 0088951
2016-01-16 13:27 Bart Broersma Note Added: 0088952
2016-01-16 13:27 Bart Broersma Note Edited: 0088952 View Revisions
2016-01-30 13:21 Bart Broersma Fixed in Revision => r51454
2016-01-30 13:21 Bart Broersma LazTarget - => 1.8
2016-01-30 13:21 Bart Broersma Note Added: 0089526
2016-01-30 13:21 Bart Broersma Status assigned => resolved
2016-01-30 13:21 Bart Broersma Fixed in Version => 1.8
2016-01-30 13:21 Bart Broersma Resolution open => fixed
2016-01-30 13:21 Bart Broersma Target Version => 1.8
2016-01-30 16:14 Bart Broersma Status resolved => closed
2016-01-30 16:14 Bart Broersma Assigned To Juha Manninen =>
2016-01-30 16:14 Bart Broersma Assigned To => Juha Manninen
2016-01-30 16:14 Bart Broersma Status closed => assigned
2016-01-30 16:14 Bart Broersma Resolution fixed => reopened
2016-01-30 16:15 Bart Broersma Status assigned => resolved
2016-01-30 16:15 Bart Broersma Resolution reopened => fixed
2016-01-30 16:15 Bart Broersma Status resolved => closed
2016-02-05 08:41 Juha Manninen Relationship added has duplicate 0029592