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:
juha 2012-07-01 14:42:54 +00:00
parent 68dcd42126
commit a65ed8792b
2 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -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);