mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 11:19:21 +02:00
IDE: Toggle a boolean editor checkbox in OI directly only when the square is clicked
git-svn-id: trunk@37839 -
This commit is contained in:
parent
68dcd42126
commit
a65ed8792b
@ -1940,7 +1940,7 @@ begin
|
||||
SetActiveControl(FCurrentEdit);
|
||||
if (FCurrentEdit is TCustomEdit) then
|
||||
TCustomEdit(FCurrentEdit).SelectAll
|
||||
else if WasValueClick and (FCurrentEdit is TCheckBox) then
|
||||
else if (FCurrentEdit is TCheckBox) and WasValueClick then
|
||||
TCheckBox(FCurrentEdit).Checked:=not TCheckBox(FCurrentEdit).Checked;
|
||||
end;
|
||||
end;
|
||||
@ -2026,7 +2026,8 @@ begin
|
||||
ExpandRow(Index);
|
||||
end;
|
||||
end;
|
||||
SetItemIndexAndFocus(Index, SplitterX<X);
|
||||
// WasValueClick param is only for checkboxes, toggled if user clicks the square
|
||||
SetItemIndexAndFocus(Index, (X>SplitterX) and (X<=SplitterX+PropCheckBoxSquareWidth));
|
||||
SetCaptureControl(Self);
|
||||
Column := oipgcValue;
|
||||
end;
|
||||
|
@ -439,6 +439,8 @@ type
|
||||
{ TBoolPropertyEditor
|
||||
Default property editor for all boolean properties }
|
||||
|
||||
const PropCheckBoxSquareWidth = 15;
|
||||
type
|
||||
{ TBoolPropertyEditor }
|
||||
|
||||
TBoolPropertyEditor = class(TEnumPropertyEditor)
|
||||
@ -3123,7 +3125,7 @@ begin
|
||||
ACanvas.Brush.Style := bsSolid;
|
||||
ACanvas.Brush.Color := clWhite;
|
||||
BRect := ARect;
|
||||
BRect.Right:=BRect.Left+15;
|
||||
BRect.Right:=BRect.Left+PropCheckBoxSquareWidth;
|
||||
Inc(BRect.Top);
|
||||
Dec(BRect.Bottom,3);
|
||||
ACanvas.Rectangle(BRect);
|
||||
|
Loading…
Reference in New Issue
Block a user