From 96987c1d32f0efa92adb2417b535561caff9859f Mon Sep 17 00:00:00 2001 From: juha Date: Thu, 4 Dec 2014 23:29:03 +0000 Subject: [PATCH] IDE: Less updates for the component palette during startup. git-svn-id: trunk@47111 - --- ide/componentpalette.pas | 5 +++-- ide/main.pp | 6 ++---- ide/mainbase.pas | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ide/componentpalette.pas b/ide/componentpalette.pas index ca792e31f1..c45b858c2d 100644 --- a/ide/componentpalette.pas +++ b/ide/componentpalette.pas @@ -292,9 +292,10 @@ end; procedure TComponentPalette.OnScrollBoxResize(Sender: TObject); begin - if TControl(Sender).Parent is TCustomPage then begin + if MainIDE.IDEStarted and (TControl(Sender).Parent is TCustomPage) then + begin {$IFDEF VerboseComponentPalette} - DebugLn('TComponentPalette.OnScrollBoxResize Calling ReAlignButtons'); + DebugLn(['TComponentPalette.OnScrollBoxResize Calling ReAlignButtons, IDEStarted=', MainIDE.IDEStarted]); {$ENDIF} ReAlignButtons(TCustomPage(TControl(Sender).Parent)); end; diff --git a/ide/main.pp b/ide/main.pp index d21be9020b..2e1e1ff078 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -629,7 +629,6 @@ type FDesignerToBeFreed: TFilenameToStringTree; // form file names to be freed OnIdle. FApplicationIsActivate: boolean; fNeedSaveEnvironment: boolean; - FIDEStarted: boolean; FRemoteControlTimer: TTimer; FRemoteControlFileAge: integer; @@ -8606,7 +8605,7 @@ end; procedure TMainIDE.OnControlSelectionFormChanged(Sender: TObject; OldForm, NewForm: TCustomForm); begin - if (TheControlSelection=nil) or (FormEditor1=nil) then exit; + if (TheControlSelection=nil) or (FormEditor1=nil) or not FIDEStarted then exit; if OldForm<>nil then OldForm.Invalidate; if TheControlSelection.LookupRoot<>nil then @@ -8615,8 +8614,7 @@ begin NewForm.Invalidate; {$IFDEF VerboseComponentPalette} DebugLn('***'); - DebugLn(['** TMainIDE.OnControlSelectionFormChanged: Calling UpdateIDEComponentPalette(true)', - ', IDEStarted=', FIDEStarted, ' **']); + DebugLn('** TMainIDE.OnControlSelectionFormChanged: Calling UpdateIDEComponentPalette(true)'); {$ENDIF} UpdateIDEComponentPalette(true); end; diff --git a/ide/mainbase.pas b/ide/mainbase.pas index 0b91a4b4e3..0ced08bbd2 100644 --- a/ide/mainbase.pas +++ b/ide/mainbase.pas @@ -90,6 +90,7 @@ type procedure SetDisplayState(AValue: TDisplayState); protected FNeedUpdateHighlighters: boolean; + FIDEStarted: boolean; function CreateMenuSeparator : TMenuItem; procedure CreateMenuItem(Section: TIDEMenuSection; @@ -189,13 +190,12 @@ type procedure FindInFilesPerDialog(AProject: TProject); override; procedure FindInFiles(AProject: TProject; const FindText: string); override; - // Copied from CodeTyphon procedure SelComponentPageButtonClick(Sender: TObject); virtual; abstract; - public property ToolStatus: TIDEToolStatus read FToolStatus write SetToolStatus; property WindowMenuActiveForm: TCustomForm read FWindowMenuActiveForm write FWindowMenuActiveForm; property DisplayState: TDisplayState read FDisplayState write SetDisplayState; + property IDEStarted: boolean read FIDEStarted; property LastFormActivated: TCustomForm read FLastFormActivated write FLastFormActivated; end;