mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
IDE: Fix bugs in EditorFileManager, make the popupmenu functional.
git-svn-id: trunk@35419 -
This commit is contained in:
parent
63cc0a9ac2
commit
088114e24b
@ -121,6 +121,7 @@ object EditorFileManagerForm: TEditorFileManagerForm
|
||||
end
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
OnPopup = PopupMenu1Popup
|
||||
left = 304
|
||||
top = 8
|
||||
object ActivateMenuItem: TMenuItem
|
||||
|
@ -29,6 +29,7 @@ type
|
||||
procedure CheckListBox1Click(Sender: TObject);
|
||||
procedure CheckListBox1ItemClick(Sender: TObject; Index: integer);
|
||||
procedure CloseCheckedButtonClick(Sender: TObject);
|
||||
procedure PopupMenu1Popup(Sender: TObject);
|
||||
procedure SaveCheckedButtonClick(Sender: TObject);
|
||||
procedure CloseMenuItemClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
@ -74,29 +75,26 @@ begin
|
||||
end;
|
||||
FilterEdit.InvalidateFilter;
|
||||
// Captions
|
||||
ActivateMenuItem.Caption:=lisActivateSelected;
|
||||
Caption:=lisEditorFileManager;
|
||||
ActivateMenuItem.Caption:=lisActivate;
|
||||
CloseMenuItem.Caption:=lisMenuClose;
|
||||
SelectAllCheckBox.Caption:=lisCheckAll;
|
||||
ActivateButton.Caption:=lisActivateSelected;
|
||||
SaveCheckedButton.Caption:=lisSaveAllChecked;
|
||||
CloseCheckedButton.Caption:=lisCloseAllChecked;
|
||||
// Icons
|
||||
PopupMenu1.Images:=IDEImages.Images_16;
|
||||
ActivateMenuItem.ImageIndex:=IDEImages.LoadImage(16, 'laz_open');
|
||||
CloseMenuItem.ImageIndex:=IDEImages.LoadImage(16, 'laz_close');
|
||||
CloseMenuItem.ImageIndex:=IDEImages.LoadImage(16, 'menu_close');
|
||||
ActivateButton.LoadGlyphFromLazarusResource('laz_open');
|
||||
CloseCheckedButton.LoadGlyphFromLazarusResource('menu_close_all');
|
||||
SaveCheckedButton.LoadGlyphFromLazarusResource('menu_save_all');
|
||||
end;
|
||||
|
||||
procedure TEditorFileManagerForm.CheckListBox1Click(Sender: TObject);
|
||||
var
|
||||
clb: TCheckListBox;
|
||||
HasSelected: Boolean;
|
||||
begin
|
||||
HasSelected:=(Sender as TCheckListBox).SelCount>0;
|
||||
// Enable ActivateButton when there is a selected item.
|
||||
ActivateButton.Enabled:=HasSelected;
|
||||
ActivateMenuItem.Enabled:=HasSelected;
|
||||
ActivateButton.Enabled:=(Sender as TCheckListBox).SelCount>0;
|
||||
end;
|
||||
|
||||
procedure TEditorFileManagerForm.CheckListBox1ItemClick(Sender: TObject; Index: integer);
|
||||
@ -128,7 +126,7 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
cb:=Sender as TCheckBox;
|
||||
// Caption text : select all / unselect all
|
||||
// Caption text : check all / uncheck all
|
||||
if cb.Checked then
|
||||
cb.Caption:=lisUncheckAll
|
||||
else
|
||||
@ -167,6 +165,15 @@ begin
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TEditorFileManagerForm.PopupMenu1Popup(Sender: TObject);
|
||||
var
|
||||
HasSelected: Boolean;
|
||||
begin
|
||||
HasSelected:=CheckListBox1.SelCount>0;
|
||||
ActivateMenuItem.Enabled:=HasSelected;
|
||||
CloseMenuItem.Enabled:=HasSelected;
|
||||
end;
|
||||
|
||||
procedure TEditorFileManagerForm.CloseMenuItemClick(Sender: TObject);
|
||||
begin
|
||||
CloseListItem(CheckListBox1.ItemIndex);
|
||||
|
@ -451,7 +451,8 @@ resourcestring
|
||||
lisMenuBuildLazarus = 'Build Lazarus with Current Profile';
|
||||
lisMenuBuildLazarusProf = 'Build Lazarus with Profile: %s';
|
||||
lisMenuConfigureBuildLazarus = 'Configure "Build Lazarus" ...';
|
||||
lisEditorFileManager = 'Editor File Manager ...';
|
||||
lisDlgEditorFileManager = 'Editor File Manager ...';
|
||||
lisEditorFileManager = 'Editor File Manager';
|
||||
|
||||
lisSearchProjectsFrom = 'Search projects from';
|
||||
lisMEOther = 'Other';
|
||||
@ -925,9 +926,10 @@ resourcestring
|
||||
lisCloseAllTabsQuestion = 'Closing a Source Editor Window. Do you want close all files or hide the window?';
|
||||
lisCloseAllTabsClose = 'Close files';
|
||||
lisCloseAllChecked = 'Close All Checked';
|
||||
lisSaveAllChecked = 'Save All Checked';
|
||||
lisActivateSelected = 'Activate Selected';
|
||||
lisCloseAllTabsHide = 'Hide window';
|
||||
lisSaveAllChecked = 'Save All Checked';
|
||||
lisActivate = 'Activate';
|
||||
lisActivateSelected = 'Activate Selected';
|
||||
|
||||
// hints
|
||||
lisHintOpen = 'Open';
|
||||
|
@ -782,7 +782,7 @@ begin
|
||||
with MainIDEBar do begin
|
||||
CreateMenuSeparatorSection(mnuWindow,itmWindowManagers,'itmWindowManagers');
|
||||
ParentMI:=itmWindowManagers;
|
||||
CreateMenuItem(ParentMI,itmWindowManager,'itmWindowManager', lisEditorFileManager, 'pkg_files');
|
||||
CreateMenuItem(ParentMI,itmWindowManager,'itmWindowManager', lisDlgEditorFileManager, 'pkg_files');
|
||||
// Populated later with a list of editor names
|
||||
CreateMenuSeparatorSection(mnuWindow,itmWindowLists,'itmWindowLists');
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user