Class TWinMenuExpert (unit WinMenuExpert) |
Inherits from
TIExpert
constructor Create;
- Create the parent Windows menu item, from which all the Delphi lists are listed as child menu items.
destructor Destroy;
Add a menu item to Delphi's menu bar, just before the Help menu.
procedure Execute;
function GetAuthor: string;
function GetComment: string;
function GetGlyph: HICON;
function GetIDString: string;
function GetMenuText: string;
function GetName: string;
function GetPage: string;
function GetState: TExpertState;
function GetStyle: TExpertStyle;
When the user clicks the menu bar, that activates the main form.
procedure ActiveFormChange(Sender: TObject);
Whenever the active form changes, rebuild the window menu.
procedure BuildWindowsMenu;
parent menu item Build a menu of all the open windows in Delphi.
procedure ClearWindowsMenu;
Clear the Windows menu.
procedure MenuItemClick(Sender: TIMenuItemIntf);
The user clicked a window menu item, so bring the corresponding window forward.
property ActiveForm : TForm
property FormList : TFormList
property List : TList
property ParentItem : TIMenuItemIntf
fActiveForm : TForm;
private declarations
fFormList : TFormList;
most recently active form
fList : TList;
list of visible forms
fParent : TIMenuItemIntf;
list of child menu items
constructor Create;
Create the parent Windows menu item, from which all the Delphi lists are listed as child menu items.
destructor Destroy;
Add a menu item to Delphi's menu bar, just before the Help menu. This menu item is the parent item for the Windows menu.
procedure Execute;
function GetAuthor: string;
function GetComment: string;
function GetGlyph: HICON;
function GetIDString: string;
function GetMenuText: string;
function GetName: string;
function GetPage: string;
function GetState: TExpertState;
function GetStyle: TExpertStyle;
When the user clicks the menu bar, that activates the main form. The menu shouldn't check the main form, but the form that really was active before that. Keep track of the active form that is not the main form, and check that form in the menu bar.
procedure ActiveFormChange(Sender: TObject);
Whenever the active form changes, rebuild the window menu.
procedure BuildWindowsMenu;
parent menu item
Build a menu of all the open windows in Delphi. For the user's convenience, sort the windows into alphabetical order by caption. Set the shortcut letter to the first unique letter in the caption. Check the window that is "active," that is, was active before the main window became active to display the Windows menu.
procedure ClearWindowsMenu;
Clear the Windows menu.
procedure MenuItemClick(Sender: TIMenuItemIntf);
The user clicked a window menu item, so bring the corresponding window forward.
property ActiveForm : TForm
property FormList : TFormList
property List : TList
property ParentItem : TIMenuItemIntf
fActiveForm : TForm;
private declarations
fFormList : TFormList;
most recently active form
fList : TList;
list of visible forms
fParent : TIMenuItemIntf;
list of child menu items