From 988fb4f578e2f137606ef61fbad8e1c785e4f971 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 28 May 2019 13:42:05 +0000 Subject: [PATCH] jvcllaz: Fix JvDesignerDemo crashing on Qt when a panel added to the designer surface is resized. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6966 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../examples/JvDesigner/jvDesignerDemo.lpi | 248 ++++++++++++------ .../run/JvRuntimeDesign/jvdesignimp.pas | 41 ++- 2 files changed, 204 insertions(+), 85 deletions(-) diff --git a/components/jvcllaz/examples/JvDesigner/jvDesignerDemo.lpi b/components/jvcllaz/examples/JvDesigner/jvDesignerDemo.lpi index d30941a7a..736b843b2 100644 --- a/components/jvcllaz/examples/JvDesigner/jvDesignerDemo.lpi +++ b/components/jvcllaz/examples/JvDesigner/jvDesignerDemo.lpi @@ -1,10 +1,12 @@ - + - + + + @@ -17,15 +19,13 @@ - - - + @@ -38,11 +38,11 @@ - + - + @@ -50,7 +50,7 @@ - + @@ -58,33 +58,33 @@ - + - + - + - + - + @@ -94,54 +94,54 @@ - + - + - + - + - + - + - + - + @@ -150,14 +150,14 @@ - + - + @@ -165,7 +165,7 @@ - + @@ -173,141 +173,226 @@ - + - + - + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - + - - - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + - + - - + + - + + - - + + - + + - - + + - - + + - - + + - - + + - - + + - + + - - + + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -329,6 +414,15 @@ + + + + + + + + + diff --git a/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas b/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas index c9b3eba10..dfeb2cdf6 100644 --- a/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas +++ b/components/jvcllaz/run/JvRuntimeDesign/jvdesignimp.pas @@ -182,19 +182,25 @@ type DDC: TDesignerDeviceContext; constructor Create(AMessenger: TJvDesignCustomMessenger); reintroduce; // IDesignerNotify interface - procedure Modified; - procedure Notification(AnObject: TPersistent; Operation: TOperation); reintroduce; + procedure Modified; override; +// procedure Notification(AnObject: TPersistent; Operation: TOperation); reintroduce; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; // IDesigner, IDesignerHook interface function GetCustomForm: TCustomForm; - procedure SetCustomForm(Value: TCustomForm); function GetIsControl: Boolean; - procedure SetIsControl(Value: Boolean); + function GetRoot: TComponent; + function GetShiftState: TShiftState; override; function IsDesignMsg(Sender: TControl; var Msg: TLMessage): Boolean; override; procedure PaintGrid; override; - procedure ValidateRename(AComponent: TComponent; const CurName, NewName: string); reintroduce; + procedure PrepareFreeDesigner(AFreeComponent: boolean); override; + procedure SelectOnlyThisComponent(AComponent: TComponent);override; + procedure SetCustomForm(Value: TCustomForm); + procedure SetIsControl(Value: Boolean); function UniqueName(const BaseName: string): string; override; - function GetRoot: TComponent; + procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override; + procedure ValidateRename(AComponent: TComponent; const CurName, NewName: string); override; //reintroduce; + //{$IFDEF COMPILER9_UP} //procedure PaintMenu; //{$ENDIF COMPILER9_UP} @@ -1251,6 +1257,10 @@ begin Result := nil; end; +function TJvDesignDesigner.GetShiftState: TShiftState; +begin + Result := []; +end; function TJvDesignDesigner.IsDesignMsg(Sender: TControl; var Msg: TLMessage): Boolean; begin Result := Messenger.IsDesignMessage(Sender, Msg); @@ -1261,8 +1271,8 @@ begin // end; -procedure TJvDesignDesigner.Notification(AnObject: TPersistent; - Operation: TOperation); +procedure TJvDesignDesigner.Notification(AComponent: TComponent; Operation: TOperation); +//procedure TJvDesignDesigner.Notification(AnObject: TPersistent; Operation: TOperation); begin // end; @@ -1272,6 +1282,16 @@ begin // end; +procedure TJvDesignDesigner.PrepareFreeDesigner(AFreeComponent: boolean); +begin + // +end; + +procedure TJvDesignDesigner.SelectOnlyThisComponent(AComponent: TComponent); +begin + // +end; + procedure TJvDesignDesigner.SetCustomForm(Value: TCustomForm); begin // @@ -1287,6 +1307,11 @@ begin // end; +procedure TJvDesignDesigner.UTF8KeyPress(var UTF8Key: TUTF8Char); +begin + // +end; + procedure TJvDesignDesigner.ValidateRename(AComponent: TComponent; const CurName, NewName: string); begin