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
This commit is contained in:
wp_xxyyzz
2019-05-28 13:42:05 +00:00
parent f05bc54e79
commit 988fb4f578
2 changed files with 204 additions and 85 deletions

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<MainUnit Value="0"/>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
@ -17,15 +19,13 @@
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default">
<local>
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
<LaunchingApplication PathPlusParams="\usr\bin\xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</Mode0>
</Modes>
@ -38,11 +38,11 @@
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="28">
<Units Count="31">
<Unit0>
<Filename Value="jvDesignerDemo.lpr"/>
<IsPartOfProject Value="True"/>
<UsageCount Value="37"/>
<UsageCount Value="43"/>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
@ -50,7 +50,7 @@
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UsageCount Value="37"/>
<UsageCount Value="43"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
@ -58,33 +58,33 @@
<Filename Value="..\jvdesignsurface.pas"/>
<UnitName Value="JvDesignSurface"/>
<EditorIndex Value="-1"/>
<UsageCount Value="25"/>
<UsageCount Value="24"/>
</Unit2>
<Unit3>
<Filename Value="..\tp_register.pas"/>
<CursorPos X="82" Y="19"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit3>
<Unit4>
<Filename Value="..\jvresources.pas"/>
<UnitName Value="JvResources"/>
<TopLine Value="148"/>
<CursorPos X="17" Y="164"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit4>
<Unit5>
<Filename Value="..\..\codetools\laz2_xmlwrite.pas"/>
<UnitName Value="laz2_XMLWrite"/>
<TopLine Value="172"/>
<CursorPos X="25" Y="187"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\fpc\2.4.3\source\rtl\win32\system.pp"/>
<UnitName Value="System"/>
<TopLine Value="51"/>
<CursorPos X="3" Y="66"/>
<UsageCount Value="13"/>
<UsageCount Value="12"/>
</Unit6>
<Unit7>
<Filename Value="E:\sw\laz_jvdesigner\mainunit.pas"/>
@ -94,54 +94,54 @@
<UnitName Value="mainUnit"/>
<TopLine Value="106"/>
<CursorPos Y="120"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit7>
<Unit8>
<Filename Value="..\..\..\designer\controlselection.pp"/>
<UnitName Value="ControlSelection"/>
<TopLine Value="1252"/>
<CursorPos X="3" Y="1257"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit8>
<Unit9>
<Filename Value="..\..\..\lcl\include\wincontrol.inc"/>
<TopLine Value="4691"/>
<CursorPos Y="4707"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit9>
<Unit10>
<Filename Value="..\..\..\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<TopLine Value="1947"/>
<CursorPos X="15" Y="1733"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit10>
<Unit11>
<Filename Value="..\..\..\fpc\2.4.3\source\packages\fcl-db\src\dbase\dbf_idxfile.pas"/>
<TopLine Value="1226"/>
<CursorPos X="31" Y="1236"/>
<UsageCount Value="8"/>
<UsageCount Value="7"/>
</Unit11>
<Unit12>
<Filename Value="E:\sw\laz_jvdesigner\jvdesignutils.pas"/>
<UnitName Value="JvDesignUtils"/>
<TopLine Value="58"/>
<CursorPos X="19"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit12>
<Unit13>
<Filename Value="E:\sw\laz_jvdesigner\jvdesignimp.pas"/>
<UnitName Value="JvDesignImp"/>
<TopLine Value="1213"/>
<CursorPos X="30" Y="1241"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit13>
<Unit14>
<Filename Value="..\jvdesignimp.pas"/>
<UnitName Value="JvDesignImp"/>
<EditorIndex Value="-1"/>
<CursorPos Y="1481"/>
<UsageCount Value="26"/>
<UsageCount Value="25"/>
<Bookmarks Count="1">
<Item0 X="23" Y="363" ID="1"/>
</Bookmarks>
@ -150,14 +150,14 @@
<Filename Value="..\..\..\lcl\include\control.inc"/>
<TopLine Value="1577"/>
<CursorPos Y="1593"/>
<UsageCount Value="12"/>
<UsageCount Value="11"/>
</Unit15>
<Unit16>
<Filename Value="..\jvdesignutils.pas"/>
<UnitName Value="JvDesignUtils"/>
<EditorIndex Value="-1"/>
<CursorPos X="72" Y="13"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit16>
<Unit17>
<Filename Value="..\jvdesignclip.pas"/>
@ -165,7 +165,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="24"/>
<CursorPos X="25" Y="2"/>
<UsageCount Value="15"/>
<UsageCount Value="14"/>
</Unit17>
<Unit18>
<Filename Value="..\jvconsts.pas"/>
@ -173,141 +173,226 @@
<EditorIndex Value="-1"/>
<TopLine Value="155"/>
<CursorPos X="90" Y="186"/>
<UsageCount Value="10"/>
<UsageCount Value="9"/>
</Unit18>
<Unit19>
<Filename Value="..\..\..\lcl\include\canvas.inc"/>
<TopLine Value="387"/>
<CursorPos Y="406"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit19>
<Unit20>
<Filename Value="..\..\..\lcl\include\customcontrol.inc"/>
<TopLine Value="107"/>
<CursorPos Y="136"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit20>
<Unit21>
<Filename Value="E:\sw\laz_designer\jvdesignsurface.pas"/>
<TopLine Value="301"/>
<CursorPos X="69" Y="312"/>
<UsageCount Value="9"/>
<UsageCount Value="8"/>
</Unit21>
<Unit22>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<UnitName Value="JvDesignSurface"/>
<EditorIndex Value="1"/>
<TopLine Value="1125"/>
<CursorPos Y="1147"/>
<UsageCount Value="10"/>
<TopLine Value="342"/>
<CursorPos Y="361"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit22>
<Unit23>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignclip.pas"/>
<UnitName Value="JvDesignClip"/>
<EditorIndex Value="2"/>
<TopLine Value="193"/>
<CursorPos Y="216"/>
<UsageCount Value="10"/>
<EditorIndex Value="5"/>
<TopLine Value="172"/>
<CursorPos Y="208"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit23>
<Unit24>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignutils.pas"/>
<UnitName Value="JvDesignUtils"/>
<EditorIndex Value="3"/>
<TopLine Value="407"/>
<CursorPos X="52" Y="420"/>
<UsageCount Value="10"/>
<EditorIndex Value="6"/>
<TopLine Value="178"/>
<CursorPos Y="207"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit24>
<Unit25>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<UnitName Value="JvDesignImp"/>
<EditorIndex Value="5"/>
<TopLine Value="1397"/>
<CursorPos Y="1430"/>
<UsageCount Value="10"/>
<EditorIndex Value="7"/>
<TopLine Value="1007"/>
<CursorPos Y="1029"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit25>
<Unit26>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\forms.pp"/>
<UnitName Value="Forms"/>
<EditorIndex Value="6"/>
<EditorIndex Value="8"/>
<TopLine Value="1737"/>
<CursorPos X="3" Y="1754"/>
<UsageCount Value="10"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit26>
<Unit27>
<Filename Value="..\..\design\JvRuntimeDesign\JvRuntimeDesignReg.pas"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="4"/>
<Filename Value="..\..\design\JvRuntimeDesign\jvruntimedesignreg.pas"/>
<UnitName Value="JvRuntimeDesignReg"/>
<EditorIndex Value="-1"/>
<CursorPos X="39" Y="7"/>
<UsageCount Value="12"/>
</Unit27>
<Unit28>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\control.inc"/>
<EditorIndex Value="3"/>
<TopLine Value="3305"/>
<CursorPos Y="3324"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit27>
</Unit28>
<Unit29>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<EditorIndex Value="4"/>
<TopLine Value="8121"/>
<CursorPos Y="8145"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit29>
<Unit30>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\lclmessageglue.pas"/>
<UnitName Value="LCLMessageGlue"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
<TopLine Value="102"/>
<CursorPos X="64" Y="114"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit30>
</Units>
<JumpHistory Count="16" HistoryIndex="15">
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="main.pas"/>
<Caret Line="164" Column="36" TopLine="137"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8122" TopLine="8103"/>
</Position1>
<Position2>
<Filename Value="main.pas"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8123" TopLine="8103"/>
</Position2>
<Position3>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="265" Column="17" TopLine="265"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8125" TopLine="8103"/>
</Position3>
<Position4>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8127" TopLine="8103"/>
</Position4>
<Position5>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="43" Column="30" TopLine="15"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8128" TopLine="8103"/>
</Position5>
<Position6>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="404" Column="23" TopLine="404"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8130" TopLine="8103"/>
</Position6>
<Position7>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignutils.pas"/>
<Caret Line="96" Column="30" TopLine="79"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8131" TopLine="8103"/>
</Position7>
<Position8>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignclip.pas"/>
<Caret Line="143" Column="23" TopLine="143"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8139" TopLine="8121"/>
</Position8>
<Position9>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignclip.pas"/>
<Caret Line="199" TopLine="193"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8142" TopLine="8121"/>
</Position9>
<Position10>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignclip.pas"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\wincontrol.inc"/>
<Caret Line="8145" TopLine="8121"/>
</Position10>
<Position11>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="351" Column="29" TopLine="345"/>
<Filename Value="C:\lazarus-trunk_fpc304\lcl\include\control.inc"/>
<Caret Line="3324" TopLine="3305"/>
</Position11>
<Position12>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1226" TopLine="1215"/>
</Position12>
<Position13>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="11" Column="30"/>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="436" TopLine="418"/>
</Position13>
<Position14>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="681" Column="34" TopLine="660"/>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="438" TopLine="418"/>
</Position14>
<Position15>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="265" Column="28" TopLine="265"/>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1227" TopLine="1215"/>
</Position15>
<Position16>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignutils.pas"/>
<Caret Line="65" Column="38" TopLine="65"/>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1234" TopLine="1215"/>
</Position16>
<Position17>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="994" TopLine="977"/>
</Position17>
<Position18>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="995" TopLine="977"/>
</Position18>
<Position19>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1003" TopLine="977"/>
</Position19>
<Position20>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="540" TopLine="522"/>
</Position20>
<Position21>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="542" TopLine="522"/>
</Position21>
<Position22>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1006" TopLine="977"/>
</Position22>
<Position23>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1008" TopLine="979"/>
</Position23>
<Position24>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1025" TopLine="1007"/>
</Position24>
<Position25>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1026" TopLine="1007"/>
</Position25>
<Position26>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1028" TopLine="1007"/>
</Position26>
<Position27>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Caret Line="1029" TopLine="1007"/>
</Position27>
<Position28>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="922" TopLine="905"/>
</Position28>
<Position29>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="333" TopLine="315"/>
</Position29>
<Position30>
<Filename Value="..\..\run\JvRuntimeDesign\jvdesignsurface.pas"/>
<Caret Line="361" TopLine="342"/>
</Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
@ -329,6 +414,15 @@
</Linking>
</CompilerOptions>
<Debugging>
<BreakPoints Count="1">
<Item1>
<Kind Value="bpkSource"/>
<WatchScope Value="wpsLocal"/>
<WatchKind Value="wpkWrite"/>
<Source Value="..\..\run\JvRuntimeDesign\jvdesignimp.pas"/>
<Line Value="1232"/>
</Item1>
</BreakPoints>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>

View File

@ -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