mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
Sparta form designer: Fix endless loop with Qt widgetset. Issue #32209, patch from Anthony Walter.
git-svn-id: trunk@55615 -
This commit is contained in:
parent
a5564ccfa1
commit
e1378e644b
@ -30,7 +30,7 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
WM_SETNOFRAME = WM_USER;
|
WM_SETNOFRAME = WM_USER;
|
||||||
WM_BoundToDesignTabSheet = WM_USER + 1;
|
WM_BOUNDTODESIGNTABSHEET = WM_USER + 1;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TDesignFormData }
|
{ TDesignFormData }
|
||||||
@ -38,7 +38,6 @@ type
|
|||||||
TDesignFormData = class(TComponent, IDesignedForm, IDesignedFormIDE)
|
TDesignFormData = class(TComponent, IDesignedForm, IDesignedFormIDE)
|
||||||
private
|
private
|
||||||
FWndMethod: TWndMethod;
|
FWndMethod: TWndMethod;
|
||||||
|
|
||||||
FForm: IDesignedFormIDE;
|
FForm: IDesignedFormIDE;
|
||||||
FLastScreenshot: TBitmap;
|
FLastScreenshot: TBitmap;
|
||||||
FPopupParent: TSourceEditorWindowInterface;
|
FPopupParent: TSourceEditorWindowInterface;
|
||||||
@ -49,8 +48,7 @@ type
|
|||||||
FFormImages: TList;
|
FFormImages: TList;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
//protected
|
//protected
|
||||||
procedure WndMethod(var TheMessage: TLMessage);
|
procedure WndMethod(var Msg: TLMessage);
|
||||||
|
|
||||||
procedure SetPopupParent(AVal: TSourceEditorWindowInterface);
|
procedure SetPopupParent(AVal: TSourceEditorWindowInterface);
|
||||||
procedure DoAddForm;
|
procedure DoAddForm;
|
||||||
procedure FormChangeBounds(Sender: TObject);
|
procedure FormChangeBounds(Sender: TObject);
|
||||||
@ -445,7 +443,7 @@ end;
|
|||||||
|
|
||||||
{ TDesignFormData }
|
{ TDesignFormData }
|
||||||
|
|
||||||
procedure TDesignFormData.WndMethod(var TheMessage: TLMessage);
|
procedure TDesignFormData.WndMethod(var Msg: TLMessage);
|
||||||
|
|
||||||
// Without this button F12 don't work. (after creating new for editor is inactive) :<
|
// Without this button F12 don't work. (after creating new for editor is inactive) :<
|
||||||
procedure FixF12_ActiveEditor;
|
procedure FixF12_ActiveEditor;
|
||||||
@ -460,22 +458,30 @@ procedure TDesignFormData.WndMethod(var TheMessage: TLMessage);
|
|||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Timer: TLMTimer;
|
||||||
begin
|
begin
|
||||||
if TheMessage.msg = WM_SETNOFRAME then
|
if Msg.msg = LM_TIMER then
|
||||||
begin
|
begin
|
||||||
ShowWindow(Form.Form.Handle, SW_HIDE);
|
Timer := TLMTimer(Msg);
|
||||||
FHiding := False;
|
if Timer.TimerID = WM_SETNOFRAME then
|
||||||
|
begin
|
||||||
FixF12_ActiveEditor;
|
KillTimer(FForm.Form.Handle, WM_SETNOFRAME);
|
||||||
|
ShowWindow(Form.Form.Handle, SW_HIDE);
|
||||||
if Form.Form is TFakeForm then
|
FHiding := False;
|
||||||
RepaintFormImages;
|
FixF12_ActiveEditor;
|
||||||
end;
|
if Form.Form is TFakeForm then
|
||||||
|
RepaintFormImages;
|
||||||
// during docking, form position was in wrong place... we need to delay changing position :)
|
Exit;
|
||||||
if TheMessage.msg = WM_BoundToDesignTabSheet then
|
end;
|
||||||
if Form.LastActiveSourceWindow <> nil then
|
if Timer.TimerID = WM_BOUNDTODESIGNTABSHEET then
|
||||||
|
begin
|
||||||
|
KillTimer(FForm.Form.Handle, WM_BOUNDTODESIGNTABSHEET);
|
||||||
SourceEditorWindows[Form.LastActiveSourceWindow].BoundToDesignTabSheet;
|
SourceEditorWindows[Form.LastActiveSourceWindow].BoundToDesignTabSheet;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
// we need to correct ActiveEditor to right form
|
// we need to correct ActiveEditor to right form
|
||||||
// this code works correctly on Windows platform
|
// this code works correctly on Windows platform
|
||||||
@ -492,7 +498,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
FWndMethod(TheMessage);
|
FWndMethod(Msg);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDesignFormData.SetPopupParent(AVal: TSourceEditorWindowInterface);
|
procedure TDesignFormData.SetPopupParent(AVal: TSourceEditorWindowInterface);
|
||||||
@ -560,7 +566,7 @@ end;
|
|||||||
procedure TDesignFormData.FormChangeBounds(Sender: TObject);
|
procedure TDesignFormData.FormChangeBounds(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not FForm.Update then
|
if not FForm.Update then
|
||||||
PostMessage(FForm.Form.Handle, WM_BoundToDesignTabSheet, 0, 0);
|
SetTimer(FForm.Form.Handle, WM_BOUNDTODESIGNTABSHEET, 10, nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TDesignFormData.Create(AForm: TCustomForm);
|
constructor TDesignFormData.Create(AForm: TCustomForm);
|
||||||
@ -894,7 +900,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PostMessage(Form.Handle, WM_SETNOFRAME, 0, 0);
|
SetTimer(Form.Handle, WM_SETNOFRAME, 10, nil);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1234,7 +1240,7 @@ begin
|
|||||||
//EndUpdate;
|
//EndUpdate;
|
||||||
LPageCtrl.BoundToDesignTabSheet;
|
LPageCtrl.BoundToDesignTabSheet;
|
||||||
|
|
||||||
PostMessage(Form.Handle, WM_BoundToDesignTabSheet, 0, 0);
|
SetTimer(Form.Handle, WM_BOUNDTODESIGNTABSHEET, 10, nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1500,12 +1506,10 @@ begin
|
|||||||
LDesignForm := LWindowData.ActiveDesignFormData;
|
LDesignForm := LWindowData.ActiveDesignFormData;
|
||||||
LWindowData.ActiveDesignFormData := nil;
|
LWindowData.ActiveDesignFormData := nil;
|
||||||
LWindowData.ActiveDesignFormData := LDesignForm;
|
LWindowData.ActiveDesignFormData := LDesignForm;
|
||||||
// ...
|
|
||||||
//PostMessage(LWindow.Handle, WM_BoundToDesignTabSheet, 0, 0);
|
|
||||||
if LDesignForm <> nil then
|
if LDesignForm <> nil then
|
||||||
begin
|
begin
|
||||||
LDesignForm.Form.Form.Parent := FindModulePageControl(LWindow).Resizer.ActiveResizeFrame.FormHandler;
|
LDesignForm.Form.Form.Parent := FindModulePageControl(LWindow).Resizer.ActiveResizeFrame.FormHandler;
|
||||||
PostMessage(LDesignForm.Form.Form.Handle, WM_BoundToDesignTabSheet, 0, 0);
|
SetTimer(LDesignForm.Form.Form.Handle, WM_BOUNDTODESIGNTABSHEET, 10, nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user