mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 12:39:29 +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);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
procedure TMenuItem.AddSeparator;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TMenuItem.AddSeparator;
|
||||
var
|
||||
Item: TMenuItem;
|
||||
begin
|
||||
Item:=TMenuItem.Create(Self);
|
||||
Item.Caption:='-';
|
||||
Add(Item);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TMenuItem.Create
|
||||
Params: TheOwner: the owner of the class
|
||||
@ -447,7 +459,7 @@ procedure TMenuItem.Insert(Index: Integer; Item: TMenuItem);
|
||||
begin
|
||||
if (Item = nil) then exit;
|
||||
if Item.Parent <> nil then
|
||||
raise EMenuError.Create('Menu inserted twice');
|
||||
RaiseGDBException('Menu inserted twice');
|
||||
|
||||
// create Items if needed
|
||||
if FItems = nil then FItems := TList.Create;
|
||||
@ -906,7 +918,7 @@ begin
|
||||
+'menu item''s GroupIndex')
|
||||
end
|
||||
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
|
||||
Items[i].FGroupIndex:=Value;
|
||||
end;
|
||||
@ -917,6 +929,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$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
|
||||
MG: broke LCL<->interface circles
|
||||
|
||||
@ -1032,6 +1047,9 @@ end;
|
||||
|
||||
|
||||
$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
|
||||
MG: broke LCL<->interface circles
|
||||
|
||||
|
@ -159,6 +159,7 @@ type
|
||||
public
|
||||
FCompStyle : LongInt;
|
||||
procedure Add(Item: TMenuItem);
|
||||
procedure AddSeparator;
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure Delete(Index: Integer);
|
||||
destructor Destroy; override;
|
||||
@ -361,6 +362,9 @@ end.
|
||||
|
||||
{
|
||||
$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
|
||||
added Windows menu to IDE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user