[Lazarus] Component palette GUI

Juha Manninen juha.manninen62 at gmail.com
Thu Dec 4 13:02:41 CET 2014


On Thu, Dec 4, 2014 at 1:31 AM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> On Wed, 3 Dec 2014 21:35:48 +0200
> Juha Manninen <juha.manninen62 at gmail.com> wrote:
>
>>[...]
>> In the actual GUI generation part I had to call
>> Application.ProcessMessages; just after creating / deleting buttons
>
> Fixed.

Thanks. I removed it and the DisableCompPaletteProcMsg define.
I still wonder how it worked earlier.

I added more debug messages to MainIDE methods calling palette update.
fLastCompPaletteForm and/or LastFormActivated are updated wrong and/or
OnDesignerActivated is not called when it should on Windows.
On Linux with GTK2 and with QT everything works well. I don't know how
the widgetset can affect that.

I copied some debug output below. First a DataModule is activated,
buttons are hidden. Then I switched focus between Form and DataModule
by clicking them.
Only OnControlSelectionFormChanged is called but no OnDesignerActivated.
UpdateIDEComponentPalette returns early, palette is not updated.
Note, at the same time Object Inspector is updated correctly.
Finally OnDesignerActivated was called and buttons appeared when I
selected the Form's source editor and pressed F12.

Anyway, this problem on Windows is not caused by my changes. Earlier
it was maybe covered by the extra calls to palette's update. Even then
it was triggered for John Whitten for some reason (issue #25224).

Now I noticed that my last commit, a DebugLn at the beginning of
UpdateIDEComponentPalette crashes Lazarus when changing project.
How can that be? It is only a DebugLn!

Juha

---

***
** TMainIDE.OnDesignerActivated: Calling UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_CompPaletteOptionsFrame:TFrameDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
* TMainIDE.UpdateIDEComponentPalette: Updating palette *, HideControls=True
TComponentPalette.CreatePagesFromUserOrder HideControls=True
TComponentPalette.CreatePagesFromUserOrder HideControl=True aVisibleCompCnt=3
TComponentPalette.CreateButtons PAGE=Standard PageIndex=0
TComponentPalette.CreateOrDelButton Keep Button: TMainMenu
PaletteBtn0_0_TMainMenu :TScrollBox
TComponentPalette.CreateOrDelButton Keep Button: TPopupMenu
PaletteBtn0_1_TPopupMenu :TScrollBox
TComponentPalette.CreateOrDelButton Destroy Button: TButton
PaletteBtn0_2_TButton
[... Destroy many buttons ...]
TComponentPalette.CreateOrDelButton Destroy Button: TFrame PaletteBtn0_16_TFrame
TComponentPalette.CreateOrDelButton Keep Button: TActionList
PaletteBtn0_17_TActionList :TScrollBox
TComponentPalette.ReAlignButtons START Standard Visible=True ClientWidth=1448
TComponentPalette.ReAlignButtons ButtonTree.Count=3
ScrollBox.ControlCount=19 ScrollBox.Bounds=l=0,t=0,r=1428,b=28
VertScrollBar.Size=21 ClientSizeWithoutBar=1428
IsScrollBarVisible=False HorzScrollBar.Size=21 Page=528 Range=528
IsScrollBarVisible=False
TComponentPalette.ReAlignButtons PaletteBtn0_0_TMainMenu l=42,t=0,r=69,b=27
TComponentPalette.ReAlignButtons PaletteBtn0_1_TPopupMenu l=69,t=0,r=96,b=27
TComponentPalette.ReAlignButtons PaletteBtn0_17_TActionList l=96,t=0,r=123,b=27
TComponentPalette.UpdateNoteBookButtons: Restoring
FPageControl.ActivePage=Standard
TLazSourceFileManager.LoadLFM Creating designer for hidden component
of C:\SW\LazTest\FindDialog\unit2.pas
TLazSourceFileManager.InitOpenedProjectFile select form in designer:
_Designer_DataModule1:TNonControlDesignerForm TDesigner
***
** TMainIDE.OnControlSelectionFormChanged: Calling
UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnControlSelectionFormChanged: Calling
UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnControlSelectionFormChanged: Calling
UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnControlSelectionFormChanged: Calling
UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnControlSelectionFormChanged: Calling
UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnDesignerActivated: Calling UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnControlSelectionFormChanged: Calling
UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=_Designer_DataModule1:TNonControlDesignerForm
***
** TMainIDE.OnDesignerActivated: Calling UpdateIDEComponentPalette(true) **
* TMainIDE.UpdateIDEComponentPalette,
fLastCompPaletteForm=_Designer_DataModule1:TNonControlDesignerForm,
LastFormActivated=Form1:TForm1
* TMainIDE.UpdateIDEComponentPalette: Updating palette *, HideControls=False
TComponentPalette.CreatePagesFromUserOrder HideControls=False
TComponentPalette.CreatePagesFromUserOrder HideControl=False aVisibleCompCnt=18
TComponentPalette.CreateButtons PAGE=Standard PageIndex=0
TComponentPalette.CreateOrDelButton Keep Button: TMainMenu
PaletteBtn0_0_TMainMenu :TScrollBox
TComponentPalette.CreateOrDelButton Keep Button: TPopupMenu
PaletteBtn0_1_TPopupMenu :TScrollBox
TComponentPalette.CreateOrDelButton Created Button: TButton
PaletteBtn0_2_TButton
[ ... and so on ...]




More information about the Lazarus mailing list