mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 02:49:19 +02:00
IDE: Popup menu for component palette options. Issue #27648, patch from Balázs Székely.
git-svn-id: trunk@48315 -
This commit is contained in:
parent
152d9d6397
commit
0d87e299e7
@ -40,8 +40,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, AVL_Tree, fgl,
|
Classes, SysUtils, AVL_Tree, fgl,
|
||||||
Controls, Forms, Graphics, ComCtrls, Buttons, Menus, ExtCtrls,
|
Controls, Forms, Graphics, ComCtrls, Buttons, Menus, ExtCtrls,
|
||||||
FileUtil, LazFileCache, PropEdits, LCLProc, FormEditingIntf, LazIDEIntf,
|
FileUtil, LazFileCache, PropEdits, LCLProc, MainBase, LazarusIDEStrConsts,
|
||||||
MainBase, LazarusIDEStrConsts, ComponentReg, DesignerProcs, PackageDefs, EnvironmentOpts;
|
FormEditingIntf, LazIDEIntf, IDEImagesIntf,
|
||||||
|
ComponentReg, DesignerProcs, PackageDefs, EnvironmentOpts;
|
||||||
|
|
||||||
const
|
const
|
||||||
CompPalSelectionToolBtnPrefix = 'PaletteSelectBtn';
|
CompPalSelectionToolBtnPrefix = 'PaletteSelectBtn';
|
||||||
@ -92,6 +93,7 @@ type
|
|||||||
procedure OpenPackageClicked(Sender: TObject);
|
procedure OpenPackageClicked(Sender: TObject);
|
||||||
procedure OpenUnitClicked(Sender: TObject);
|
procedure OpenUnitClicked(Sender: TObject);
|
||||||
procedure ComponentListClicked(Sender: TObject);
|
procedure ComponentListClicked(Sender: TObject);
|
||||||
|
procedure OptionsClicked(Sender: TObject);
|
||||||
procedure PalettePopupMenuPopup(Sender: TObject);
|
procedure PalettePopupMenuPopup(Sender: TObject);
|
||||||
procedure PopupMenuPopup(Sender: TObject);
|
procedure PopupMenuPopup(Sender: TObject);
|
||||||
private
|
private
|
||||||
@ -149,7 +151,7 @@ type
|
|||||||
function CompareControlsWithTag(Control1, Control2: Pointer): integer;
|
function CompareControlsWithTag(Control1, Control2: Pointer): integer;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
uses componentpalette_options;
|
||||||
{$R ../images/components_images.res}
|
{$R ../images/components_images.res}
|
||||||
{$DEFINE USE_PageIndex}
|
{$DEFINE USE_PageIndex}
|
||||||
|
|
||||||
@ -561,6 +563,11 @@ begin
|
|||||||
MainIDE.DoShowComponentList;
|
MainIDE.DoShowComponentList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TComponentPalette.OptionsClicked(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MainIDE.DoOpenIDEOptions(TCompPaletteOptionsFrame, '', [], []);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TComponentPalette.PalettePopupMenuPopup(Sender: TObject);
|
procedure TComponentPalette.PalettePopupMenuPopup(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
;
|
;
|
||||||
@ -599,7 +606,8 @@ end;
|
|||||||
|
|
||||||
procedure TComponentPalette.SetPageControl(const AValue: TPageControl);
|
procedure TComponentPalette.SetPageControl(const AValue: TPageControl);
|
||||||
var
|
var
|
||||||
MenuItem: TMenuItem;
|
miCompList,
|
||||||
|
miOptions: TMenuItem;
|
||||||
begin
|
begin
|
||||||
if FPageControl=AValue then exit;
|
if FPageControl=AValue then exit;
|
||||||
ClearButtons;
|
ClearButtons;
|
||||||
@ -611,13 +619,22 @@ begin
|
|||||||
PalettePopupMenu.OnPopup:=@PalettePopupMenuPopup;
|
PalettePopupMenu.OnPopup:=@PalettePopupMenuPopup;
|
||||||
PalettePopupMenu.Name:='PalettePopupMenu';
|
PalettePopupMenu.Name:='PalettePopupMenu';
|
||||||
// Component List
|
// Component List
|
||||||
MenuItem:=TMenuItem.Create(PalettePopupMenu);
|
PalettePopupMenu.Images := IDEImages.Images_16;
|
||||||
with MenuItem do begin
|
miCompList:=TMenuItem.Create(PalettePopupMenu);
|
||||||
|
with miCompList do begin
|
||||||
Name:='ComponentListMenuItem';
|
Name:='ComponentListMenuItem';
|
||||||
Caption:=lisCompPalComponentList;
|
Caption:=lisCompPalComponentList;
|
||||||
OnClick:=@ComponentListClicked;
|
OnClick:=@ComponentListClicked;
|
||||||
end;
|
end;
|
||||||
PalettePopupMenu.Items.Add(MenuItem);
|
PalettePopupMenu.Items.Add(miCompList);
|
||||||
|
miOptions:=TMenuItem.Create(PalettePopupMenu);
|
||||||
|
with miOptions do begin
|
||||||
|
Name:='OptionsMenuItem';
|
||||||
|
Caption:=dlgOIOptions;
|
||||||
|
OnClick:=@OptionsClicked;
|
||||||
|
ImageIndex := IDEImages.LoadImage(16, 'menu_environment_options');
|
||||||
|
end;
|
||||||
|
PalettePopupMenu.Items.Add(miOptions);
|
||||||
end;
|
end;
|
||||||
FPageControl.PopupMenu:=PalettePopupMenu;
|
FPageControl.PopupMenu:=PalettePopupMenu;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user