mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:59:20 +02:00
implemented changing TMenuItem.GroupIndex at runtime
git-svn-id: trunk@3869 -
This commit is contained in:
parent
bcfc6ae455
commit
de4ff1ba94
@ -34,6 +34,18 @@ begin
|
|||||||
Insert(GetCount, Item);
|
Insert(GetCount, Item);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
procedure TMenuItem.AddSeparator;
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
procedure TMenuItem.AddSeparator;
|
||||||
|
var
|
||||||
|
Item: TMenuItem;
|
||||||
|
begin
|
||||||
|
Item:=TMenuItem.Create(Self);
|
||||||
|
Item.Caption:='-';
|
||||||
|
Add(Item);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TMenuItem.Create
|
Method: TMenuItem.Create
|
||||||
Params: TheOwner: the owner of the class
|
Params: TheOwner: the owner of the class
|
||||||
@ -447,7 +459,7 @@ procedure TMenuItem.Insert(Index: Integer; Item: TMenuItem);
|
|||||||
begin
|
begin
|
||||||
if (Item = nil) then exit;
|
if (Item = nil) then exit;
|
||||||
if Item.Parent <> nil then
|
if Item.Parent <> nil then
|
||||||
raise EMenuError.Create('Menu inserted twice');
|
RaiseGDBException('Menu inserted twice');
|
||||||
|
|
||||||
// create Items if needed
|
// create Items if needed
|
||||||
if FItems = nil then FItems := TList.Create;
|
if FItems = nil then FItems := TList.Create;
|
||||||
@ -906,7 +918,7 @@ begin
|
|||||||
+'menu item''s GroupIndex')
|
+'menu item''s GroupIndex')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{ Ripple change to menu items at Position and after }
|
// Ripple change to menu items at Position and after
|
||||||
if (Items[i].GroupIndex<>0) and (Items[i].GroupIndex<Value) then
|
if (Items[i].GroupIndex<>0) and (Items[i].GroupIndex<Value) then
|
||||||
Items[i].FGroupIndex:=Value;
|
Items[i].FGroupIndex:=Value;
|
||||||
end;
|
end;
|
||||||
@ -917,6 +929,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.30 2003/02/23 10:42:06 mattias
|
||||||
|
implemented changing TMenuItem.GroupIndex at runtime
|
||||||
|
|
||||||
Revision 1.29 2002/10/26 15:15:48 lazarus
|
Revision 1.29 2002/10/26 15:15:48 lazarus
|
||||||
MG: broke LCL<->interface circles
|
MG: broke LCL<->interface circles
|
||||||
|
|
||||||
@ -1032,6 +1047,9 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.30 2003/02/23 10:42:06 mattias
|
||||||
|
implemented changing TMenuItem.GroupIndex at runtime
|
||||||
|
|
||||||
Revision 1.29 2002/10/26 15:15:48 lazarus
|
Revision 1.29 2002/10/26 15:15:48 lazarus
|
||||||
MG: broke LCL<->interface circles
|
MG: broke LCL<->interface circles
|
||||||
|
|
||||||
|
@ -159,6 +159,7 @@ type
|
|||||||
public
|
public
|
||||||
FCompStyle : LongInt;
|
FCompStyle : LongInt;
|
||||||
procedure Add(Item: TMenuItem);
|
procedure Add(Item: TMenuItem);
|
||||||
|
procedure AddSeparator;
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
procedure Delete(Index: Integer);
|
procedure Delete(Index: Integer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -361,6 +362,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.37 2003/02/23 10:42:06 mattias
|
||||||
|
implemented changing TMenuItem.GroupIndex at runtime
|
||||||
|
|
||||||
Revision 1.36 2003/01/04 11:58:32 mattias
|
Revision 1.36 2003/01/04 11:58:32 mattias
|
||||||
added Windows menu to IDE
|
added Windows menu to IDE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user