Merged revision(s) 51303-51304 #363ef73d76-#363ef73d76 from trunk:

ObjectInspector: fix wrong ifdef.
........
OI: Use normal CheckBox as Boolean editor until problems with CheckBoxThemed are solved. Issues #29406 and #29412.
........

git-svn-id: branches/fixes_1_6@51330 -
This commit is contained in:
maxim 2016-01-18 23:07:49 +00:00
parent 2189723d75
commit 5db06fde95
2 changed files with 10 additions and 13 deletions

View File

@ -32,7 +32,7 @@ uses
// FCL
SysUtils, Types, Classes, TypInfo, FPCanvas,
// LCL
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
{$IFDEF UseOICheckBoxThemed} CheckBoxThemed, {$ENDIF}
InterfaceBase, Forms, Buttons, Graphics, GraphType, StdCtrls, LCLType,
LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages, LazConfigStorage,
LazLoggerBase, Menus, Dialogs, Themes, LCLProc, TreeFilterEdit,
@ -305,7 +305,7 @@ type
ValueEdit: TEdit;
ValueComboBox: TComboBox;
{$IFnDEF UseOINormalCheckBox}
{$IFDEF UseOICheckBoxThemed}
ValueCheckBox: TCheckBoxThemed;
{$ELSE}
ValueCheckBox: TCheckBox;
@ -968,13 +968,13 @@ begin
OnMouseWheel:=@OnGridMouseWheel;
end;
ValueCheckBox:={$IFnDEF UseOINormalCheckBox} TCheckBoxThemed.Create(Self); {$ELSE} TCheckBox.Create(Self); {$ENDIF}
ValueCheckBox:={$IFDEF UseOICheckBoxThemed} TCheckBoxThemed.Create(Self); {$ELSE} TCheckBox.Create(Self); {$ENDIF}
with ValueCheckBox do
begin
Name:='ValueCheckBox';
Visible:=false;
Enabled:=false;
{$IFnDEF UseOINormalCheckBox}
{$IFDEF UseOICheckBoxThemed}
AutoSize := false;
{$ELSE}
AutoSize := true; // SetBounds does not work for CheckBox, AutoSize does.
@ -2096,7 +2096,7 @@ begin
SetActiveControl(FCurrentEdit);
if (FCurrentEdit is TCustomEdit) then
TCustomEdit(FCurrentEdit).SelectAll
{$IFnDEF UseOINormalCheckBox}
{$IFDEF UseOICheckBoxThemed}
else if (FCurrentEdit is TCheckBoxThemed) and WasValueClick then
TCheckBoxThemed(FCurrentEdit).Checked:=not TCheckBoxThemed(FCurrentEdit).Checked;
{$ELSE}
@ -2636,7 +2636,6 @@ var
and (r1.Right=r2.Right) and (r1.Bottom=r2.Bottom);
end;
// AlignEditComponents
begin
if ItemIndex>=0 then
begin
@ -2699,8 +2698,6 @@ var
NameBgColor: TColor;
Details: TThemedElementDetails;
Size: TSize;
// PaintRow
begin
CurRow := Rows[ARow];
FullRect := RowRect(ARow);

View File

@ -23,7 +23,7 @@ interface
uses
Classes, TypInfo, SysUtils, types, RtlConsts, Forms, Controls, LCLProc,
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
{$IFDEF UseOICheckBoxThemed} CheckBoxThemed, {$ENDIF}
GraphType, FPCAdds, // for StrToQWord in older fpc versions
StringHashList, ButtonPanel, Graphics, StdCtrls, Buttons, Menus, LCLType,
ExtCtrls, ComCtrls, LCLIntf, Dialogs, EditBtn, PropertyStorage, Grids, ValEdit,
@ -3469,16 +3469,14 @@ procedure TBoolPropertyEditor.PropDrawValue(ACanvas: TCanvas; const ARect: TRect
AState: TPropEditDrawState);
var
TxtRect: TRect;
{$IFnDEF UseOINormalCheckBox}
{$IFDEF UseOICheckBoxThemed}
str: string;
stat: TCheckBoxState;
{$ENDIF}
begin
if FPropertyHook.GetCheckboxForBoolean then
begin // Checkbox for Booleans.
{$IFDEF UseOINormalCheckBox}
TxtRect := DrawCheckbox(ACanvas, ARect, GetOrdValue<>0);
{$ELSE}
{$IFDEF UseOICheckBoxThemed}
TxtRect.Top := -100; // Don't call inherited PropDrawValue
if GetOrdValue<>0 then
begin
@ -3489,6 +3487,8 @@ begin
str := '(False)';
end;
TCheckBoxThemed.PaintSelf(ACanvas, str, ARect, stat, False, False, False, False, taRightJustify);
{$ELSE}
TxtRect := DrawCheckbox(ACanvas, ARect, GetOrdValue<>0);
{$ENDIF}
end
else