mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 18:19:07 +02:00
added menuintf register functions
git-svn-id: trunk@7834 -
This commit is contained in:
parent
5f3e47834b
commit
d2928d98c7
@ -383,11 +383,24 @@ var
|
|||||||
|
|
||||||
function RegisterIDEMenuRoot(const Name: string; MenuItem: TMenuItem = nil
|
function RegisterIDEMenuRoot(const Name: string; MenuItem: TMenuItem = nil
|
||||||
): TIDEMenuSection;
|
): TIDEMenuSection;
|
||||||
|
function RegisterIDEMenuSection(Parent: TIDEMenuSection;
|
||||||
|
const Name: string): TIDEMenuSection;
|
||||||
function RegisterIDEMenuSection(const Path, Name: string): TIDEMenuSection;
|
function RegisterIDEMenuSection(const Path, Name: string): TIDEMenuSection;
|
||||||
|
function RegisterIDESubMenu(Parent: TIDEMenuSection;
|
||||||
|
const Name, Caption: string;
|
||||||
|
const OnClickMethod: TNotifyEvent = nil;
|
||||||
|
const OnClickProc: TNotifyProcedure = nil
|
||||||
|
): TIDEMenuSection;
|
||||||
function RegisterIDESubMenu(const Path, Name, Caption: string;
|
function RegisterIDESubMenu(const Path, Name, Caption: string;
|
||||||
const OnClickMethod: TNotifyEvent = nil;
|
const OnClickMethod: TNotifyEvent = nil;
|
||||||
const OnClickProc: TNotifyProcedure = nil
|
const OnClickProc: TNotifyProcedure = nil
|
||||||
): TIDEMenuSection;
|
): TIDEMenuSection;
|
||||||
|
function RegisterIDEMenuCommand(Parent: TIDEMenuSection;
|
||||||
|
const Name, Caption: string;
|
||||||
|
const OnClickMethod: TNotifyEvent = nil;
|
||||||
|
const OnClickProc: TNotifyProcedure = nil;
|
||||||
|
const Command: TIDECommand = nil
|
||||||
|
): TIDEMenuCommand;
|
||||||
function RegisterIDEMenuCommand(const Path, Name, Caption: string;
|
function RegisterIDEMenuCommand(const Path, Name, Caption: string;
|
||||||
const OnClickMethod: TNotifyEvent = nil;
|
const OnClickMethod: TNotifyEvent = nil;
|
||||||
const OnClickProc: TNotifyProcedure = nil;
|
const OnClickProc: TNotifyProcedure = nil;
|
||||||
@ -399,24 +412,38 @@ implementation
|
|||||||
function RegisterIDEMenuRoot(const Name: string; MenuItem: TMenuItem
|
function RegisterIDEMenuRoot(const Name: string; MenuItem: TMenuItem
|
||||||
): TIDEMenuSection;
|
): TIDEMenuSection;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseMenuIntf}
|
|
||||||
//debugln('RegisterIDEMenuRoot Name="',Name,'"');
|
//debugln('RegisterIDEMenuRoot Name="',Name,'"');
|
||||||
{$ENDIF}
|
|
||||||
Result:=TIDEMenuSection.Create(Name);
|
Result:=TIDEMenuSection.Create(Name);
|
||||||
IDEMenuRoots.RegisterMenuRoot(Result);
|
IDEMenuRoots.RegisterMenuRoot(Result);
|
||||||
Result.MenuItem:=MenuItem;
|
Result.MenuItem:=MenuItem;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function RegisterIDEMenuSection(Parent: TIDEMenuSection; const Name: string
|
||||||
|
): TIDEMenuSection;
|
||||||
|
begin
|
||||||
|
Result:=TIDEMenuSection.Create(Name);
|
||||||
|
Result.ChildsAsSubMenu:=false;
|
||||||
|
Parent.AddLast(Result);
|
||||||
|
end;
|
||||||
|
|
||||||
function RegisterIDEMenuSection(const Path, Name: string): TIDEMenuSection;
|
function RegisterIDEMenuSection(const Path, Name: string): TIDEMenuSection;
|
||||||
var
|
var
|
||||||
Parent: TIDEMenuSection;
|
Parent: TIDEMenuSection;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseMenuIntf}
|
|
||||||
//debugln('RegisterIDEMenuSection Path="',Path,'" Name="',Name,'"');
|
//debugln('RegisterIDEMenuSection Path="',Path,'" Name="',Name,'"');
|
||||||
{$ENDIF}
|
|
||||||
Parent:=IDEMenuRoots.FindByPath(Path,true) as TIDEMenuSection;
|
Parent:=IDEMenuRoots.FindByPath(Path,true) as TIDEMenuSection;
|
||||||
|
Result:=RegisterIDEMenuSection(Parent,Name);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function RegisterIDESubMenu(Parent: TIDEMenuSection; const Name,
|
||||||
|
Caption: string; const OnClickMethod: TNotifyEvent;
|
||||||
|
const OnClickProc: TNotifyProcedure): TIDEMenuSection;
|
||||||
|
begin
|
||||||
Result:=TIDEMenuSection.Create(Name);
|
Result:=TIDEMenuSection.Create(Name);
|
||||||
Result.ChildsAsSubMenu:=false;
|
Result.ChildsAsSubMenu:=true;
|
||||||
|
Result.Caption:=Caption;
|
||||||
|
Result.OnClick:=OnClickMethod;
|
||||||
|
Result.OnClickProc:=OnClickProc;
|
||||||
Parent.AddLast(Result);
|
Parent.AddLast(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -426,15 +453,21 @@ function RegisterIDESubMenu(const Path, Name, Caption: string;
|
|||||||
var
|
var
|
||||||
Parent: TIDEMenuSection;
|
Parent: TIDEMenuSection;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseMenuIntf}
|
|
||||||
//debugln('RegisterIDESubMenu Path="',Path,'" Name="',Name,'"');
|
//debugln('RegisterIDESubMenu Path="',Path,'" Name="',Name,'"');
|
||||||
{$ENDIF}
|
|
||||||
Parent:=IDEMenuRoots.FindByPath(Path,true) as TIDEMenuSection;
|
Parent:=IDEMenuRoots.FindByPath(Path,true) as TIDEMenuSection;
|
||||||
Result:=TIDEMenuSection.Create(Name);
|
Result:=RegisterIDESubMenu(Parent,Name,Caption,OnClickMethod,OnClickProc);
|
||||||
Result.ChildsAsSubMenu:=true;
|
end;
|
||||||
|
|
||||||
|
function RegisterIDEMenuCommand(Parent: TIDEMenuSection; const Name,
|
||||||
|
Caption: string; const OnClickMethod: TNotifyEvent;
|
||||||
|
const OnClickProc: TNotifyProcedure; const Command: TIDECommand
|
||||||
|
): TIDEMenuCommand;
|
||||||
|
begin
|
||||||
|
Result:=TIDEMenuCommand.Create(Name);
|
||||||
Result.Caption:=Caption;
|
Result.Caption:=Caption;
|
||||||
Result.OnClick:=OnClickMethod;
|
Result.OnClick:=OnClickMethod;
|
||||||
Result.OnClickProc:=OnClickProc;
|
Result.OnClickProc:=OnClickProc;
|
||||||
|
Result.Command:=Command;
|
||||||
Parent.AddLast(Result);
|
Parent.AddLast(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -444,16 +477,10 @@ function RegisterIDEMenuCommand(const Path, Name, Caption: string;
|
|||||||
var
|
var
|
||||||
Parent: TIDEMenuSection;
|
Parent: TIDEMenuSection;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseMenuIntf}
|
|
||||||
//debugln('RegisterIDEMenuCommand Path="',Path,'" Name="',Name,'"');
|
//debugln('RegisterIDEMenuCommand Path="',Path,'" Name="',Name,'"');
|
||||||
{$ENDIF}
|
|
||||||
Parent:=IDEMenuRoots.FindByPath(Path,true) as TIDEMenuSection;
|
Parent:=IDEMenuRoots.FindByPath(Path,true) as TIDEMenuSection;
|
||||||
Result:=TIDEMenuCommand.Create(Name);
|
Result:=RegisterIDEMenuCommand(Parent,Name,Caption,OnClickMethod,OnClickProc,
|
||||||
Result.Caption:=Caption;
|
Command);
|
||||||
Result.OnClick:=OnClickMethod;
|
|
||||||
Result.OnClickProc:=OnClickProc;
|
|
||||||
Result.Command:=Command;
|
|
||||||
Parent.AddLast(Result);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TIDEMenuItem }
|
{ TIDEMenuItem }
|
||||||
|
Loading…
Reference in New Issue
Block a user