mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 03:39:18 +02:00
LCL: disabled exception for handle creation during loading, needed by glscene
git-svn-id: trunk@24382 -
This commit is contained in:
parent
2c6d401dc3
commit
b1b4157851
@ -1007,10 +1007,19 @@ end;
|
|||||||
procedure TCustomForm.SetParent(NewParent: TWinControl);
|
procedure TCustomForm.SetParent(NewParent: TWinControl);
|
||||||
begin
|
begin
|
||||||
if Parent=NewParent then exit;
|
if Parent=NewParent then exit;
|
||||||
|
{$IFNDEF OldAutoSize}
|
||||||
|
DisableAutoSizing;
|
||||||
|
{$ENDIF}
|
||||||
|
try
|
||||||
if HandleAllocated then DestroyHandle;
|
if HandleAllocated then DestroyHandle;
|
||||||
inherited SetParent(NewParent);
|
inherited SetParent(NewParent);
|
||||||
if (Parent=nil) and Visible then
|
if (Parent=nil) and Visible then
|
||||||
HandleNeeded;
|
HandleNeeded;
|
||||||
|
finally
|
||||||
|
{$IFNDEF OldAutoSize}
|
||||||
|
EnableAutoSizing;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -2290,9 +2290,10 @@ begin
|
|||||||
or ((not FShowing) and (not (csDesigning in ComponentState)))
|
or ((not FShowing) and (not (csDesigning in ComponentState)))
|
||||||
// during handle creation no autosize
|
// during handle creation no autosize
|
||||||
or (wcfCreatingChildHandles in FWinControlFlags)
|
or (wcfCreatingChildHandles in FWinControlFlags)
|
||||||
or
|
{$ELSE}
|
||||||
|
(csDestroyingHandle in ControlState)
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
(inherited AutoSizeDelayed);
|
or (inherited AutoSizeDelayed);
|
||||||
//if Result then debugln('TWinControl.AutoSizeDelayed A ',DbgSName(Self),' wcfCreatingChildHandles=',dbgs(wcfCreatingChildHandles in FWinControlFlags),' csLoading=',dbgs(csLoading in ComponentState));
|
//if Result then debugln('TWinControl.AutoSizeDelayed A ',DbgSName(Self),' wcfCreatingChildHandles=',dbgs(wcfCreatingChildHandles in FWinControlFlags),' csLoading=',dbgs(csLoading in ComponentState));
|
||||||
{$IFDEF VerboseCanAutoSize}
|
{$IFDEF VerboseCanAutoSize}
|
||||||
if Result {and AutoSize} then begin
|
if Result {and AutoSize} then begin
|
||||||
@ -5021,6 +5022,7 @@ begin
|
|||||||
// First destroy all children handles
|
// First destroy all children handles
|
||||||
//DebugLn(['TWinControl.DestroyHandle DESTROY CHILDS ',DbgSName(Self)]);
|
//DebugLn(['TWinControl.DestroyHandle DESTROY CHILDS ',DbgSName(Self)]);
|
||||||
Include(FControlState, csDestroyingHandle);
|
Include(FControlState, csDestroyingHandle);
|
||||||
|
try
|
||||||
if FControls <> nil then begin
|
if FControls <> nil then begin
|
||||||
for i:= 0 to FControls.Count - 1 do begin
|
for i:= 0 to FControls.Count - 1 do begin
|
||||||
//DebugLn([' ',i,' ',DbgSName(TObject(FWinControls[i]))]);
|
//DebugLn([' ',i,' ',DbgSName(TObject(FWinControls[i]))]);
|
||||||
@ -5031,7 +5033,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
//DebugLn(['TWinControl.DestroyHandle DESTROY SELF ',DbgSName(Self)]);
|
//DebugLn(['TWinControl.DestroyHandle DESTROY SELF ',DbgSName(Self)]);
|
||||||
DestroyWnd;
|
DestroyWnd;
|
||||||
|
finally
|
||||||
Exclude(FControlState, csDestroyingHandle);
|
Exclude(FControlState, csDestroyingHandle);
|
||||||
|
end;
|
||||||
//DebugLn(['TWinControl.DestroyHandle END ',DbgSName(Self)]);
|
//DebugLn(['TWinControl.DestroyHandle END ',DbgSName(Self)]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -6030,12 +6034,14 @@ begin
|
|||||||
AControl.Invalidate;
|
AControl.Invalidate;
|
||||||
//DebugLn('TWinControl.InsertControl ',Name,':',ClassName);
|
//DebugLn('TWinControl.InsertControl ',Name,':',ClassName);
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF OldAutoSize}
|
||||||
if not (csDestroying in ComponentState) then
|
if not (csDestroying in ComponentState) then
|
||||||
begin
|
begin
|
||||||
if not (csLoading in ComponentState) then
|
if not (csLoading in ComponentState) then
|
||||||
AControl.UpdateAnchorRules;
|
AControl.UpdateAnchorRules;
|
||||||
AControl.RequestAlign;
|
AControl.RequestAlign;
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(True));
|
Perform(CM_CONTROLCHANGE, WParam(AControl), LParam(True));
|
||||||
{$IFNDEF OldAutoSize}
|
{$IFNDEF OldAutoSize}
|
||||||
finally
|
finally
|
||||||
@ -7053,9 +7059,6 @@ begin
|
|||||||
|
|
||||||
if [csLoading,csDesigning]*ComponentState=[csLoading] then begin
|
if [csLoading,csDesigning]*ComponentState=[csLoading] then begin
|
||||||
DebugLn('[HINT] TWinControl.CreateWnd creating Handle during loading ',DbgSName(Self),' csDesigning=',dbgs(csDesigning in ComponentState));
|
DebugLn('[HINT] TWinControl.CreateWnd creating Handle during loading ',DbgSName(Self),' csDesigning=',dbgs(csDesigning in ComponentState));
|
||||||
{$IFNDEF OldAutoSize}
|
|
||||||
RaiseGDBException('');
|
|
||||||
{$ENDIF}
|
|
||||||
//DumpStack;
|
//DumpStack;
|
||||||
//RaiseGDBException('');
|
//RaiseGDBException('');
|
||||||
end;
|
end;
|
||||||
|
@ -6969,6 +6969,7 @@ begin
|
|||||||
if GtkWidgetIsA(ParentFixed,GTK_FIXED_GET_TYPE) or
|
if GtkWidgetIsA(ParentFixed,GTK_FIXED_GET_TYPE) or
|
||||||
GtkWidgetIsA(ParentFixed,GTK_LAYOUT_GET_TYPE) then
|
GtkWidgetIsA(ParentFixed,GTK_LAYOUT_GET_TYPE) then
|
||||||
begin
|
begin
|
||||||
|
//DebugLn(['SetWidgetSizeAndPosition ',DbgSName(LCLControl),' Widget=[',GetWidgetDebugReport(Widget),'] ParentFixed=[',GetWidgetDebugReport(ParentFixed),']']);
|
||||||
FixedMoveControl(ParentFixed, Widget, LCLLeft, LCLTop);
|
FixedMoveControl(ParentFixed, Widget, LCLLeft, LCLTop);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user