mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +02:00
Object inspector: Set "Checkbox for Booleans" as the default. Also use the themed Checkbox, can be changed with define UseOINormalCheckBox.
git-svn-id: trunk@49914 -
This commit is contained in:
parent
c7c98cc90a
commit
ac56c10378
@ -32,7 +32,7 @@ uses
|
|||||||
// FCL
|
// FCL
|
||||||
SysUtils, Types, Classes, TypInfo, FPCanvas,
|
SysUtils, Types, Classes, TypInfo, FPCanvas,
|
||||||
// LCL
|
// LCL
|
||||||
{$IFDEF UseOIThemedCheckBox} CheckBoxThemed, {$ENDIF}
|
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
|
||||||
InterfaceBase, Forms, Buttons, Graphics, GraphType, LCLProc, StdCtrls,
|
InterfaceBase, Forms, Buttons, Graphics, GraphType, LCLProc, StdCtrls,
|
||||||
LCLType, LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages,
|
LCLType, LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages,
|
||||||
LazConfigStorage, Menus, Dialogs, Themes, TreeFilterEdit, ObjInspStrConsts,
|
LazConfigStorage, Menus, Dialogs, Themes, TreeFilterEdit, ObjInspStrConsts,
|
||||||
@ -304,7 +304,7 @@ type
|
|||||||
|
|
||||||
ValueEdit: TEdit;
|
ValueEdit: TEdit;
|
||||||
ValueComboBox: TComboBox;
|
ValueComboBox: TComboBox;
|
||||||
{$IFDEF UseOIThemedCheckBox}
|
{$IFnDEF UseOINormalCheckBox}
|
||||||
ValueCheckBox: TCheckBoxThemed;
|
ValueCheckBox: TCheckBoxThemed;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
ValueCheckBox: TCheckBox;
|
ValueCheckBox: TCheckBox;
|
||||||
@ -966,13 +966,13 @@ begin
|
|||||||
OnMouseWheel:=@OnGridMouseWheel;
|
OnMouseWheel:=@OnGridMouseWheel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ValueCheckBox:={$IFDEF UseOIThemedCheckBox} TCheckBoxThemed.Create(Self); {$ELSE} TCheckBox.Create(Self); {$ENDIF}
|
ValueCheckBox:={$IFnDEF UseOINormalCheckBox} TCheckBoxThemed.Create(Self); {$ELSE} TCheckBox.Create(Self); {$ENDIF}
|
||||||
with ValueCheckBox do
|
with ValueCheckBox do
|
||||||
begin
|
begin
|
||||||
Name:='ValueCheckBox';
|
Name:='ValueCheckBox';
|
||||||
Visible:=false;
|
Visible:=false;
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
{$IFDEF UseOIThemedCheckBox}
|
{$IFnDEF UseOINormalCheckBox}
|
||||||
AutoSize := false;
|
AutoSize := false;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
AutoSize := true; // SetBounds does not work for CheckBox, AutoSize does.
|
AutoSize := true; // SetBounds does not work for CheckBox, AutoSize does.
|
||||||
@ -2090,7 +2090,7 @@ begin
|
|||||||
SetActiveControl(FCurrentEdit);
|
SetActiveControl(FCurrentEdit);
|
||||||
if (FCurrentEdit is TCustomEdit) then
|
if (FCurrentEdit is TCustomEdit) then
|
||||||
TCustomEdit(FCurrentEdit).SelectAll
|
TCustomEdit(FCurrentEdit).SelectAll
|
||||||
{$IFDEF UseOIThemedCheckBox}
|
{$IFnDEF UseOINormalCheckBox}
|
||||||
else if (FCurrentEdit is TCheckBoxThemed) and WasValueClick then
|
else if (FCurrentEdit is TCheckBoxThemed) and WasValueClick then
|
||||||
TCheckBoxThemed(FCurrentEdit).Checked:=not TCheckBoxThemed(FCurrentEdit).Checked;
|
TCheckBoxThemed(FCurrentEdit).Checked:=not TCheckBoxThemed(FCurrentEdit).Checked;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -3673,6 +3673,7 @@ begin
|
|||||||
FGutterColor := DefGutterColor;
|
FGutterColor := DefGutterColor;
|
||||||
FGutterEdgeColor := DefGutterEdgeColor;
|
FGutterEdgeColor := DefGutterEdgeColor;
|
||||||
|
|
||||||
|
FCheckboxForBoolean := True;
|
||||||
FBoldNonDefaultValues := True;
|
FBoldNonDefaultValues := True;
|
||||||
FDrawGridLines := True;
|
FDrawGridLines := True;
|
||||||
FShowGutter := True;
|
FShowGutter := True;
|
||||||
@ -3729,7 +3730,7 @@ begin
|
|||||||
|
|
||||||
FShowHints:=ConfigStore.GetValue(Path+'ShowHints',FileVersion>=3);
|
FShowHints:=ConfigStore.GetValue(Path+'ShowHints',FileVersion>=3);
|
||||||
FAutoShow := ConfigStore.GetValue(Path+'AutoShow',True);
|
FAutoShow := ConfigStore.GetValue(Path+'AutoShow',True);
|
||||||
FCheckboxForBoolean := ConfigStore.GetValue(Path+'CheckboxForBoolean',False);
|
FCheckboxForBoolean := ConfigStore.GetValue(Path+'CheckboxForBoolean',True);
|
||||||
FBoldNonDefaultValues := ConfigStore.GetValue(Path+'BoldNonDefaultValues',True);
|
FBoldNonDefaultValues := ConfigStore.GetValue(Path+'BoldNonDefaultValues',True);
|
||||||
FDrawGridLines := ConfigStore.GetValue(Path+'DrawGridLines',True);
|
FDrawGridLines := ConfigStore.GetValue(Path+'DrawGridLines',True);
|
||||||
FShowGutter := ConfigStore.GetValue(Path+'ShowGutter',True);
|
FShowGutter := ConfigStore.GetValue(Path+'ShowGutter',True);
|
||||||
|
@ -23,7 +23,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, TypInfo, SysUtils, types, RtlConsts, Forms, Controls, LCLProc,
|
Classes, TypInfo, SysUtils, types, RtlConsts, Forms, Controls, LCLProc,
|
||||||
{$IFDEF UseOIThemedCheckBox} CheckBoxThemed, {$ENDIF}
|
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
|
||||||
GraphType, FPCAdds, // for StrToQWord in older fpc versions
|
GraphType, FPCAdds, // for StrToQWord in older fpc versions
|
||||||
StringHashList, ButtonPanel, Graphics, StdCtrls, Buttons, Menus, LCLType,
|
StringHashList, ButtonPanel, Graphics, StdCtrls, Buttons, Menus, LCLType,
|
||||||
ExtCtrls, ComCtrls, LCLIntf, Dialogs, EditBtn, PropertyStorage, Grids, ValEdit,
|
ExtCtrls, ComCtrls, LCLIntf, Dialogs, EditBtn, PropertyStorage, Grids, ValEdit,
|
||||||
@ -3467,12 +3467,12 @@ procedure TBoolPropertyEditor.PropDrawValue(ACanvas: TCanvas; const ARect: TRect
|
|||||||
AState: TPropEditDrawState);
|
AState: TPropEditDrawState);
|
||||||
var
|
var
|
||||||
TxtRect: TRect;
|
TxtRect: TRect;
|
||||||
{$IFDEF UseOIThemedCheckBox}
|
{$IFnDEF UseOINormalCheckBox}
|
||||||
str: string;
|
str: string;
|
||||||
stat: TCheckBoxState;
|
stat: TCheckBoxState;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$IFDEF UseOIThemedCheckBox}
|
{$IFnDEF UseOINormalCheckBox}
|
||||||
if FPropertyHook.GetCheckboxForBoolean then begin
|
if FPropertyHook.GetCheckboxForBoolean then begin
|
||||||
if GetOrdValue<>0 then begin
|
if GetOrdValue<>0 then begin
|
||||||
stat := cbChecked;
|
stat := cbChecked;
|
||||||
|
@ -129,7 +129,7 @@ const
|
|||||||
{ ooShowComponentTree } True,
|
{ ooShowComponentTree } True,
|
||||||
{ ooShowHints } False,
|
{ ooShowHints } False,
|
||||||
{ ooAutoShow } True,
|
{ ooAutoShow } True,
|
||||||
{ ooCheckboxForBoolean } False,
|
{ ooCheckboxForBoolean } True,
|
||||||
{ ooBoldNonDefault } True,
|
{ ooBoldNonDefault } True,
|
||||||
{ ooDrawGridLines } True,
|
{ ooDrawGridLines } True,
|
||||||
{ ooShowGutter } True,
|
{ ooShowGutter } True,
|
||||||
|
Loading…
Reference in New Issue
Block a user