1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-18 05:22:20 -05:00
Simba/Extensions/test2.sex
2010-03-22 22:21:08 +01:00

54 lines
965 B
Plaintext

program new;
var
MenuItem,MenuItem2 : TMenuItem;
Started : Boolean;
procedure OnClick(sender : TObject);
begin;
Writeln('Hey you clicked the test menu item!');
end;
procedure init;
begin;
MenuItem := TMenuItem.Create(Simba_MainMenu);
MenuItem.Caption := 'Test';
Simba_MainMenu.Items.Add(menuItem);
MenuItem2 := TMenuItem.Create(MenuItem);
MenuItem2.Caption := 'Test!';
MenuItem2.OnClick := @OnClick;
MenuItem.Add(MenuItem2);
Started := True;
end;
procedure Free;
begin
if Started then
begin;
//MenuItem.Free; {Doesn't work in PS somehow}
//MenuItem2.Free;
end;
end;
procedure Attach;
begin;
//Menuitem.Visible := True;
end;
Procedure Detach;
begin
//Menuitem.Visible := False;
end;
//Called to retrieve the name of your extension
function GetName : string;
begin;
result := 'Add submenu';
end;
//Called to retrieve the version of your extension
function GetVersion : string;
begin;
result := '1.0';
end;
begin
end.