mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 19:47:30 +01:00
IDE: simplified
git-svn-id: trunk@47078 -
This commit is contained in:
parent
59f4935c70
commit
3f081fac2d
@ -717,6 +717,7 @@ var
|
||||
begin
|
||||
Result := True;
|
||||
fUserComponentPageCache.Clear;
|
||||
debugln(['TComponentPalette.CreatePagesFromUserOrder HideControls=',HideControls]);
|
||||
for UserPageI := 0 to fUserOrder.ComponentPages.Count-1 do
|
||||
begin
|
||||
PgName := fUserOrder.ComponentPages[UserPageI];
|
||||
@ -1077,7 +1078,9 @@ begin
|
||||
Comp := FindComponent(aCompNames[i]) as TPkgComponent;
|
||||
CreateOrDelButton(Comp, Format('%d_%d_',[aPageIndex,i]), ScrollBox);
|
||||
end;
|
||||
{$IFNDEF DisableCompPaletteProcMsg}
|
||||
Application.ProcessMessages; // ScrollBox.ControlCount of tabs are not updated without this.
|
||||
{$ENDIF}
|
||||
ReAlignButtons(Pg.PageComponent);
|
||||
end;
|
||||
|
||||
|
||||
20
ide/main.pp
20
ide/main.pp
@ -639,11 +639,10 @@ type
|
||||
FOIHelpProvider: TAbstractIDEHTMLProvider;
|
||||
FWaitForClose: Boolean;
|
||||
FFixingGlobalComponentLock: integer;
|
||||
fLastCompPaletteForm: TCustomForm;
|
||||
OldCompilerFilename, OldLanguage: String;
|
||||
OIChangedTimer: TIdleTimer;
|
||||
|
||||
FPrevForm: TCustomForm;
|
||||
|
||||
procedure RenameInheritedMethods(AnUnitInfo: TUnitInfo; List: TStrings);
|
||||
function OIHelpProvider: TAbstractIDEHTMLProvider;
|
||||
protected
|
||||
@ -926,7 +925,7 @@ type
|
||||
function CreateDesignerForComponent(AnUnitInfo: TUnitInfo;
|
||||
AComponent: TComponent): TCustomForm; override;
|
||||
procedure InvalidateAllDesignerForms;
|
||||
procedure UpdateIDEComponentPalette;
|
||||
procedure UpdateIDEComponentPalette(IfFormChanged: boolean);
|
||||
procedure ShowDesignerForm(AForm: TCustomForm);
|
||||
procedure DoViewAnchorEditor(State: TIWGetFormState = iwgfShowOnTop);
|
||||
procedure DoViewTabOrderEditor(State: TIWGetFormState = iwgfShowOnTop);
|
||||
@ -3673,8 +3672,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.UpdateIDEComponentPalette;
|
||||
procedure TMainIDE.UpdateIDEComponentPalette(IfFormChanged: boolean);
|
||||
begin
|
||||
if IfFormChanged and (fLastCompPaletteForm=LastFormActivated) then exit;
|
||||
fLastCompPaletteForm:=LastFormActivated;
|
||||
IDEComponentPalette.HideControls:=(LastFormActivated<>nil)
|
||||
and (LastFormActivated.Designer<>nil)
|
||||
and (LastFormActivated.Designer.LookupRoot<>nil)
|
||||
@ -8582,9 +8583,7 @@ begin
|
||||
GlobalDesignHook.LookupRoot:=TheControlSelection.LookupRoot;
|
||||
if NewForm<>nil then
|
||||
NewForm.Invalidate;
|
||||
if NewForm<>FPrevForm then
|
||||
UpdateIDEComponentPalette;
|
||||
FPrevForm:=NewForm;
|
||||
UpdateIDEComponentPalette(true);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.OnGetDesignerSelection(const ASelection: TPersistentSelectionList);
|
||||
@ -10519,9 +10518,7 @@ begin
|
||||
{$ENDIF}
|
||||
DisplayState:= dsForm;
|
||||
LastFormActivated := (Sender as TDesigner).Form;
|
||||
if LastFormActivated<>FPrevForm then
|
||||
UpdateIDEComponentPalette;
|
||||
FPrevForm:=LastFormActivated;
|
||||
UpdateIDEComponentPalette(true);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.OnDesignerCloseQuery(Sender: TObject);
|
||||
@ -12023,7 +12020,8 @@ begin
|
||||
Format(lisACanNotHoldTControlsYouCanOnlyPutNonVisualComponen,
|
||||
[AParent.ClassName, LineEnding]),
|
||||
mtError,[mbCancel]);
|
||||
UpdateIDEComponentPalette;
|
||||
// make sure the component palette shows only the available components
|
||||
UpdateIDEComponentPalette(false);
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user