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