mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 03:00:24 +02:00
MG: fixed TCheckBox.DoAutoSize on loading
git-svn-id: trunk@3311 -
This commit is contained in:
parent
b12c94294c
commit
385cd1efb4
@ -17,12 +17,9 @@
|
||||
|
||||
constructor TCheckbox.Create(AOwner : TComponent);
|
||||
begin
|
||||
if assigned(AOwner) then
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
fCompStyle := csCheckbox;
|
||||
AutoSize := True;
|
||||
end;
|
||||
inherited Create(AOwner);
|
||||
fCompStyle := csCheckbox;
|
||||
AutoSize := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -52,7 +49,7 @@ var
|
||||
begin
|
||||
If AutoSizing or not AutoSize then
|
||||
Exit;
|
||||
if not HandleAllocated then exit;
|
||||
if (not HandleAllocated) or (csLoading in ComponentState) then exit;
|
||||
AutoSizing := True;
|
||||
DC := GetDC(Handle);
|
||||
Try
|
||||
@ -73,6 +70,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.7 2002/09/10 07:33:37 lazarus
|
||||
MG: fixed TCheckBox.DoAutoSize on loading
|
||||
|
||||
Revision 1.6 2002/09/03 08:07:19 lazarus
|
||||
MG: image support, TScrollBox, and many other things from Andrew
|
||||
|
||||
|
@ -51,11 +51,11 @@
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomCheckBox.SetState(Value : TCheckBoxState);
|
||||
begin
|
||||
if FState <> Value then
|
||||
begin
|
||||
FState := Value;
|
||||
ApplyChanges;
|
||||
end;
|
||||
if FState <> Value then
|
||||
begin
|
||||
FState := Value;
|
||||
ApplyChanges;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -68,9 +68,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TCustomCheckBox.GetState : TCheckBoxState;
|
||||
begin
|
||||
if HandleAllocated
|
||||
then CNSendMessage (LM_GETVALUE, Self, @fState); // get the actual state of the component
|
||||
GetState := fState;
|
||||
if HandleAllocated
|
||||
then CNSendMessage (LM_GETVALUE, Self, @fState); // get the actual state of the component
|
||||
GetState := fState;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -82,10 +82,10 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
constructor TCustomCheckBox.Create(AOwner : TComponent);
|
||||
begin
|
||||
Inherited Create(AOwner);
|
||||
FState := cbUnchecked;
|
||||
FAllowGrayed := True;
|
||||
Height:=20;
|
||||
Inherited Create(AOwner);
|
||||
FState := cbUnchecked;
|
||||
FAllowGrayed := True;
|
||||
Height:=20;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -98,8 +98,8 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomCheckBox.InitializeWnd;
|
||||
begin
|
||||
inherited InitializeWnd;
|
||||
ApplyChanges;
|
||||
inherited InitializeWnd;
|
||||
ApplyChanges;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -161,12 +161,15 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomCheckBox.ApplyChanges;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
if HandleAllocated and (not (csLoading in ComponentState)) then
|
||||
CNSendMessage(LM_SetValue,Self,@fState);
|
||||
end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.7 2002/09/10 07:33:37 lazarus
|
||||
MG: fixed TCheckBox.DoAutoSize on loading
|
||||
|
||||
Revision 1.6 2002/08/27 14:33:37 lazarus
|
||||
MG: fixed designer component deletion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user