mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 23:00:15 +02:00
editortoolbar: Moved the Menu Item, Improved the search for the default Items, Updated Authors and Version
git-svn-id: trunk@45929 -
This commit is contained in:
parent
b4bee6e712
commit
5af522a237
@ -3,7 +3,7 @@
|
||||
<Package Version="4">
|
||||
<Name Value="editortoolbar"/>
|
||||
<AddToProjectUsesSection Value="True"/>
|
||||
<Author Value="Graeme Geldenhuys"/>
|
||||
<Author Value="Graeme Geldenhuys, Giuliano Colla"/>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<SearchPaths>
|
||||
@ -19,7 +19,7 @@
|
||||
"/>
|
||||
<License Value="GPL
|
||||
"/>
|
||||
<Version Minor="4"/>
|
||||
<Version Minor="5"/>
|
||||
<Files Count="4">
|
||||
<Item1>
|
||||
<Filename Value="jumpto_impl.pas"/>
|
||||
@ -63,7 +63,7 @@
|
||||
</Item5>
|
||||
</RequiredPkgs>
|
||||
<UsageOptions>
|
||||
<UnitPath Value="$(PkgOutDir)/"/>
|
||||
<UnitPath Value="$(PkgOutDir)"/>
|
||||
</UsageOptions>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
|
@ -425,7 +425,7 @@ begin
|
||||
//MenuIcon:= 'menu_editor_toolbar'; TODO!
|
||||
if uEditorToolbarList = nil then begin
|
||||
TEditorToolbarList.Create;
|
||||
MenuCommand:= RegisterIDEMenuCommand(itmViewMainWindows,'EditorToolBar',rsEditorToolbar,nil,@ConfigureToolbar);
|
||||
MenuCommand:= RegisterIDEMenuCommand(itmViewSecondaryWindows,'EditorToolBar',rsEditorToolbar,nil,@ConfigureToolbar);
|
||||
MenuCommand.ImageIndex := IDEImages.LoadImage(16, MenuIcon);
|
||||
end;
|
||||
|
||||
|
@ -228,7 +228,7 @@ end;
|
||||
procedure TEdtTbConfigForm.btnOKClick(Sender: TObject);
|
||||
begin
|
||||
SaveSettings;
|
||||
if not FToolBarShow then ShowMessage(Format(rsWarning,[sMenuView,rsEditorToolbar]));
|
||||
if not FToolBarShow then ShowMessageFmt(rsWarning,[sMenuView,rsEditorToolbar]);
|
||||
end;
|
||||
|
||||
procedure TEdtTbConfigForm.SetupCaptions;
|
||||
@ -274,21 +274,23 @@ var
|
||||
cfg: TConfigStorage;
|
||||
value: string;
|
||||
mi: TIDEMenuItem;
|
||||
ms: TIDEMenuSection;
|
||||
begin
|
||||
cfg := GetIDEConfigStorage(cSettingsFile, True);
|
||||
try
|
||||
c := cfg.GetValue('Count', 0);
|
||||
|
||||
if c = 0 then begin
|
||||
// Let's provide a Jump Back/Jump Forward as a starting default
|
||||
value := 'IDEMainMenu/Search/itmJumpings/itmJumpBack';
|
||||
mi := IDEMenuRoots.FindByPath(value, false);
|
||||
ms := itmJumpings;
|
||||
mi := ms.FindByName('itmJumpBack');
|
||||
if Assigned(mi) then
|
||||
lbToolbar.Items.AddObject(mi.Caption, TObject(mi));
|
||||
value := 'IDEMainMenu/Search/itmJumpings/itmJumpForward';
|
||||
mi := IDEMenuRoots.FindByPath(value, false);
|
||||
mi := ms.FindByName('itmJumpForward');
|
||||
if Assigned(mi) then
|
||||
lbToolbar.Items.AddObject(mi.Caption, TObject(mi));
|
||||
end
|
||||
|
||||
else begin
|
||||
for i := 0 to c - 1 do
|
||||
begin
|
||||
@ -374,12 +376,15 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{TEdtTbConfigForm.Setup - called if no user items in config. }
|
||||
class procedure TEdtTbConfigForm.Setup;
|
||||
var
|
||||
frm: TEdtTbConfigForm;
|
||||
begin
|
||||
// Create inserts the default Items
|
||||
frm := TEdtTbConfigForm.Create(nil);
|
||||
try
|
||||
// Must save them, less they're inserted twice
|
||||
frm.SaveSettings;
|
||||
finally
|
||||
frm.Free;
|
||||
|
Loading…
Reference in New Issue
Block a user