mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-22 10:52:31 +02:00
added AutoSizeDelayed check for controls without form parents
git-svn-id: trunk@7307 -
This commit is contained in:
parent
a554366f8a
commit
87bc6b3931
@ -1,5 +1,3 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TBuildForm','FORMDATA',[
|
||||
'TPF0'#10'TBuildForm'#9'BuildForm'#7'Caption'#6#19'Build documentation'#12'Cl'
|
||||
+'ientHeight'#3'Q'#1#11'ClientWidth'#3#154#1#12'OnCloseQuery'#7#19'BuildFormC'
|
||||
|
@ -1,5 +1,3 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TExampleForm','FORMDATA',[
|
||||
'TPF0'#12'TExampleForm'#11'ExampleForm'#7'Caption'#6#12'Example file'#12'Clie'
|
||||
+'ntHeight'#2'U'#11'ClientWidth'#3#148#1#13'PixelsPerInch'#2'Z'#18'HorzScroll'
|
||||
|
@ -1,5 +1,3 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TMakeSkelForm','FORMDATA',[
|
||||
'TPF0'#13'TMakeSkelForm'#12'MakeSkelForm'#7'Caption'#6'"Create new file from '
|
||||
+'pascal source'#12'ClientHeight'#3#21#1#11'ClientWidth'#3#157#1#13'PixelsPer'
|
||||
|
@ -8,7 +8,7 @@
|
||||
<SaveOnlyProjectUnits Value="True"/>
|
||||
</Flags>
|
||||
<MainUnit Value="0"/>
|
||||
<ActiveEditorIndexAtStart Value="4"/>
|
||||
<ActiveEditorIndexAtStart Value="12"/>
|
||||
<AutoCreateForms Value="False"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
@ -21,10 +21,10 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="lazde"/>
|
||||
<UsageCount Value="96"/>
|
||||
<UsageCount Value="97"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<CursorPos X="11" Y="22"/>
|
||||
<CursorPos X="17" Y="21"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<Filename Value="frmmain.pp"/>
|
||||
<ComponentName Value="MainForm"/>
|
||||
@ -33,7 +33,7 @@
|
||||
<ResourceFilename Value="frmmain.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FrmMain"/>
|
||||
<UsageCount Value="96"/>
|
||||
<UsageCount Value="97"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<CursorPos X="1" Y="23"/>
|
||||
@ -45,7 +45,7 @@
|
||||
<ResourceFilename Value="frmoptions.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="frmOptions"/>
|
||||
<UsageCount Value="93"/>
|
||||
<UsageCount Value="94"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<CursorPos X="1" Y="23"/>
|
||||
@ -57,7 +57,7 @@
|
||||
<ResourceFilename Value="frmnewnode.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="frmNewNode"/>
|
||||
<UsageCount Value="90"/>
|
||||
<UsageCount Value="91"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<CursorPos X="32" Y="27"/>
|
||||
@ -69,7 +69,7 @@
|
||||
<ResourceFilename Value="frmmakeskel.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FrmMakeSkel"/>
|
||||
<UsageCount Value="67"/>
|
||||
<UsageCount Value="68"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<CursorPos X="11" Y="16"/>
|
||||
@ -81,7 +81,7 @@
|
||||
<ResourceFilename Value="frmlink.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FrmLink"/>
|
||||
<UsageCount Value="60"/>
|
||||
<UsageCount Value="61"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<CursorPos X="1" Y="23"/>
|
||||
@ -93,7 +93,7 @@
|
||||
<ResourceFilename Value="frmtable.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="frmTable"/>
|
||||
<UsageCount Value="60"/>
|
||||
<UsageCount Value="61"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<CursorPos X="35" Y="26"/>
|
||||
@ -105,17 +105,17 @@
|
||||
<ResourceFilename Value="frmabout.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FrmAbout"/>
|
||||
<UsageCount Value="51"/>
|
||||
<UsageCount Value="52"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<CursorPos X="28" Y="29"/>
|
||||
<EditorIndex Value="11"/>
|
||||
<EditorIndex Value="17"/>
|
||||
<Filename Value="pkeditor.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="PkEditor"/>
|
||||
<UsageCount Value="45"/>
|
||||
<UsageCount Value="46"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<CursorPos X="21" Y="24"/>
|
||||
@ -125,17 +125,17 @@
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="ElEditor"/>
|
||||
<UsageCount Value="45"/>
|
||||
<UsageCount Value="46"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<CursorPos X="34" Y="28"/>
|
||||
<EditorIndex Value="10"/>
|
||||
<EditorIndex Value="16"/>
|
||||
<Filename Value="fpdeutil.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FPDEUtil"/>
|
||||
<UsageCount Value="45"/>
|
||||
<UsageCount Value="46"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<CursorPos X="30" Y="9"/>
|
||||
@ -147,19 +147,19 @@
|
||||
<ResourceFilename Value="frmexample.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="FrmExample"/>
|
||||
<UsageCount Value="36"/>
|
||||
<UsageCount Value="37"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<CursorPos X="35" Y="25"/>
|
||||
<CursorPos X="14" Y="665"/>
|
||||
<EditorIndex Value="9"/>
|
||||
<Filename Value="frmbuild.pp"/>
|
||||
<ComponentName Value="BuildForm"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<ResourceFilename Value="frmbuild.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<TopLine Value="655"/>
|
||||
<UnitName Value="frmBuild"/>
|
||||
<UsageCount Value="31"/>
|
||||
<UsageCount Value="32"/>
|
||||
</Unit12>
|
||||
</Units>
|
||||
<PublishOptions>
|
||||
|
@ -1348,7 +1348,6 @@ type
|
||||
FClientHeight: Integer;
|
||||
FDockManager: TDockManager;
|
||||
FDockSite: Boolean;
|
||||
FWinControlFlags: TWinControlFlags;
|
||||
FOnDockDrop: TDockDropEvent;
|
||||
FOnDockOver: TDockOverEvent;
|
||||
FOnGetSiteInfo: TGetSiteInfoEvent;
|
||||
@ -1393,6 +1392,7 @@ type
|
||||
procedure UpdateTabOrder(NewTabOrder: TTabOrder);
|
||||
function WantsKeyBeforeInterface(Key: word; Shift: TShiftState): boolean;
|
||||
protected
|
||||
FWinControlFlags: TWinControlFlags;
|
||||
procedure AssignTo(Dest: TPersistent); override;
|
||||
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
|
||||
function GetActionLinkClass: TControlActionLinkClass; override;
|
||||
@ -2914,6 +2914,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.303 2005/06/30 19:39:03 mattias
|
||||
added AutoSizeDelayed check for controls without form parents
|
||||
|
||||
Revision 1.302 2005/06/25 15:34:03 mattias
|
||||
fixed a few fpc over warnings from Andrew Haines
|
||||
|
||||
|
@ -476,6 +476,7 @@ type
|
||||
procedure Hide;
|
||||
procedure Show;
|
||||
procedure ShowOnTop;
|
||||
function AutoSizeDelayed: boolean; override;
|
||||
function WantChildKey(Child : TControl;
|
||||
var Message : TLMessage): Boolean; virtual;
|
||||
procedure DefocusControl(Control: TWinControl; Removing: Boolean);
|
||||
|
@ -15,9 +15,9 @@
|
||||
*****************************************************************************
|
||||
}
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TCustomBitBtn Constructor }
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TCustomBitBtn Constructor
|
||||
------------------------------------------------------------------------------}
|
||||
constructor TCustomBitBtn.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
@ -29,13 +29,13 @@ begin
|
||||
FButtonGlyph := TButtonGlyph.Create;
|
||||
FButtonGlyph.OnChange := @GlyphChanged;
|
||||
Align := alNone;
|
||||
SetInitialBounds(0,0,75,35);
|
||||
SetInitialBounds(0,0,75,30);
|
||||
RealizeKind;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TCustomBitBtn destructor }
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TCustomBitBtn destructor
|
||||
------------------------------------------------------------------------------}
|
||||
destructor TCustomBitBtn.Destroy;
|
||||
Begin
|
||||
FreeThenNil(FButtonGlyph);
|
||||
|
@ -1918,7 +1918,14 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TControl.AutoSizeDelayed: boolean;
|
||||
begin
|
||||
Result:=(csLoading in ComponentState)
|
||||
Result:=// no autosize during loading or destruction
|
||||
([csLoading,csDestroying]*ComponentState<>[])
|
||||
// no autosize for invisible controls
|
||||
or (not Visible)
|
||||
// if there is no parent, then this control is not visible
|
||||
// (TCustomForm will override this)
|
||||
or (Parent=nil)
|
||||
// if there is a parent, ask it
|
||||
or ((Parent<>nil) and Parent.AutoSizeDelayed);
|
||||
end;
|
||||
|
||||
@ -3541,6 +3548,9 @@ end;
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.262 2005/06/30 19:39:04 mattias
|
||||
added AutoSizeDelayed check for controls without form parents
|
||||
|
||||
Revision 1.261 2005/06/25 15:30:33 mattias
|
||||
fixed changing BorderSpacing at designtime and borderspacing Align=alTop,alLeft
|
||||
|
||||
|
@ -1416,6 +1416,20 @@ begin
|
||||
//DebugLn('TCustomForm.ShowOnTop ',Name,':',ClassName,' ',Visible,' ',HandleAllocated,' ',csDesigning in ComponentState);
|
||||
end;
|
||||
|
||||
function TCustomForm.AutoSizeDelayed: boolean;
|
||||
begin
|
||||
Result:=// no autosize during loading or destruction
|
||||
([csLoading,csDestroying]*ComponentState<>[])
|
||||
// no handle means not visible
|
||||
or (not HandleAllocated)
|
||||
// during handle creation no autosize
|
||||
or (wcfCreatingChildHandles in FWinControlFlags)
|
||||
// no autosize for invisible forms
|
||||
or (not Visible)
|
||||
// if there is a parent, ask it
|
||||
or ((Parent<>nil) and Parent.AutoSizeDelayed);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TCustomForm Method IsForm
|
||||
------------------------------------------------------------------------------}
|
||||
@ -1934,6 +1948,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.187 2005/06/30 19:39:04 mattias
|
||||
added AutoSizeDelayed check for controls without form parents
|
||||
|
||||
Revision 1.186 2005/06/02 20:31:19 micha
|
||||
fix lm_showwindow handling to not fire onshow event in case of restore and unzoom (fixes bug 928)
|
||||
|
||||
|
@ -55,7 +55,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TWinControl.AutoSizeDelayed: boolean;
|
||||
begin
|
||||
Result:=(not HandleAllocated)
|
||||
Result:=// no handle means not visible
|
||||
(not HandleAllocated)
|
||||
// during handle creation no autosize
|
||||
or (wcfCreatingChildHandles in FWinControlFlags)
|
||||
or (inherited AutoSizeDelayed);
|
||||
//if Result then debugln('TWinControl.AutoSizeDelayed A ',DbgSName(Self),' wcfCreatingChildHandles=',dbgs(wcfCreatingChildHandles in FWinControlFlags),' csLoading=',dbgs(csLoading in ComponentState));
|
||||
@ -4543,6 +4545,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.332 2005/06/30 19:39:04 mattias
|
||||
added AutoSizeDelayed check for controls without form parents
|
||||
|
||||
Revision 1.331 2005/06/29 22:52:39 mattias
|
||||
started add new unit page for package editor
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user