Using dynamically created menus...
From: Raptor (spammaps_at_moc.com)
Date: 12/14/04
- Next message: Nicholas Sherlock: "Re: Reading all the packets from NIC"
- Previous message: RA: "Re: Hints and 'anchors'"
- Next in thread: Bruce Roberts: "Re: Using dynamically created menus..."
- Reply: Bruce Roberts: "Re: Using dynamically created menus..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 14 Dec 2004 14:14:56 -0800
In my application, a user switches back and forth between
editing a treeview and text.
Rather than having one huge menu, with tree editing features
listed under a "Tree" main entry, I'm considering swapping
the
main menu entirely when either the treeview or the text gets
the focus. Assuming it's esthetically and psychologically
plausible, a couple of questions:
1. I've written code which creates menus from an array of
strings, specially formatted to indicate whether an entry
is a submenu of the previous entry. I first create the menu:
MainMenu:= TMainMenu.Create(Self);
then loop through the strings to create the rest and assign
.Tag, .Caption and onClick values.
To switch menus, do I do a
MainMenu.Destroy;
then create the new menu using the same process, though with
a different OnClick handler?
If so, could I simply put this line at the beginning of the
creation code:
if MainMenu <> nil then MainMenu.Destroy;
MainMenu:= TMainMenu.Create(Self);
2. How do I change the font color of these respective menus?
Raptor
- Next message: Nicholas Sherlock: "Re: Reading all the packets from NIC"
- Previous message: RA: "Re: Hints and 'anchors'"
- Next in thread: Bruce Roberts: "Re: Using dynamically created menus..."
- Reply: Bruce Roberts: "Re: Using dynamically created menus..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|