Posted By
|
Message
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1971
|
15th July, 2010 at 19:52:31 -
I'm having an awful lot of difficulty trying to create a popup menu from a text file, and would really appreciate some help (and preferably an example, if possible).
Also, is it possible to edit the main application menu at runtime? That would be better than using a popup menu.
The way I want it to work is like this:
Text file:
Group A - Item 1
Group B - Item 2
Item 3
Group A - Item 4
Group A - Item 5
Item 6
Popup menu:
Group A > Item 1
> Item 4
> Item 5
Group B > Item 2
Item 3
Item 6
Obviously I'm going to need to fastloop through each line individually.
Then I need to check if a group has been specified, by searching for "-".
If not (if find returns -1), then I add the item to the main menu (menu id=0).
If so, then I tokenize the string (using "-" as a delimiter) and create a new menu from the first element, and a new item inside that from the last element.
The problem is, I can't work out how to keep track of which groups (menus) have already been created, and which items go in which menu, etc.
Again, and help is greatly appreciated.
Edited by Sketchy
n/a
|
Hernan
Registered 04/03/2003
Points 707
|
15th July, 2010 at 23:58:40 -
If you want to change the application menu, you should try the winmesspro object.
This space is for rent
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1971
|
16th July, 2010 at 15:09:05 -
thanks - i'll have to look into that.
EDIT: Nevermind - I'm going to use the Tree control instead.
Edited by Sketchy
n/a
|
|
|