| View previous topic :: View next topic |
| Author |
Message |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Sun Jun 03, 2007 10:17 am Post subject: |
|
|
| majkinetor wrote: | | One thing will be there for shure. Item ID is unique across all menus, so I will drop menu parameter for it (that is, it will be dummy). This way to remove an item from the menu you will just have to know its ID, not its menu handle. | Don't understand, but guess I do not have to.
Maybe a new cleaned up MMenu modul could have a new interface. I would put the Options right after the Title, since I use it more frequently then icon or position. Just a thought. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sun Jun 03, 2007 10:32 am Post subject: |
|
|
Perhaps.
I will consult you when the time comes to update MMenu. _________________
 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sun Jun 03, 2007 12:54 pm Post subject: |
|
|
2 toralf
Is this what you want ?
| Code: | MMenu_RemoveAll( pMenu ) {
loop, % MMenu_Count(pMenu)
MMenu_Remove(pMenu, 1)
return (MMenu_Count(pMenu)=0)
} |
Just add it in MMenu.ahk and use it. _________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Sun Jun 03, 2007 2:55 pm Post subject: |
|
|
Thanks a lot I didn't know about MMenu_Count(). It wasn't in the doc. But now I see it is documented in the file header. Thanks again. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sun Jun 03, 2007 3:16 pm Post subject: |
|
|
Word doc is outdated. Use html reference. _________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Sun Jun 03, 2007 3:28 pm Post subject: |
|
|
don't have the html. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Sun Jun 03, 2007 3:30 pm Post subject: |
|
|
Thanks got it now. Added it to LilBuilder repo _________________ Ciao
toralf  |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Fri Jun 15, 2007 11:16 am Post subject: |
|
|
| Quote: | | If you set the ID to the already existing, you will remove ID of the item previously associated with it. Item ID is unique acros all menus that you create. | Could this be changed? I would like it to be unique for its menu. This will help for LilBuilder. Specially for the common menu parts. Currently I use numbers, but that is not very robust, since order might change or items might be left out for some controls.
In my imagination: internally extend the item ID with the menu number. If this is done through the whole mmemu module, the item id becomes unique per menu. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Fri Jun 15, 2007 12:05 pm Post subject: |
|
|
Well, there are bigger benefits of globaly unique ID then otherwise.
With global ID, you don't have to care about which menu contains item, and U can always set it or remove it (well, now it requires menu id, but in next update I planned to make this param optional). So if you once added ID=myId in some menu, you can set/remove it without knowing which menu was it.
| Quote: | | Currently I use numbers, but that is not very robust, since order might change or items might be left out for some controls. |
You can always put ID in such way to be connected to the menu. Lets say you have menu named common. You can specify ID's to be Common_N. Without N, u have no mean to know if particular ID exist (this will change once AHK have asoc arrays).
I don't know what kind of problems you might have with ID that are not solvable in robust way with current API. Can you provide sample that is problematic for you ? _________________
 |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Fri Jun 15, 2007 3:14 pm Post subject: |
|
|
The problem might not be to dramatic and might be possible to solve. But having items unique per menu would solve it right away.
The global approach with what you plan for the next release will only remove the menu ID from Set/Remove, all the rest of the functions will require a Menu ID. I do not know if that is benefit enough to justify a global approach. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
shader
Joined: 29 Oct 2004 Posts: 41
|
Posted: Mon Sep 10, 2007 3:03 pm Post subject: |
|
|
| Thanks for this great function! I'm using the My Favorites folder script and I was looking for a way to make icons and change menu color. By the other side, I'm looking desperately for a manner to be able to show more than one menu at once. To have for menus showing pressing a hotkey,for example. Is there any way to do it?????? Thanks. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Mon Sep 10, 2007 3:23 pm Post subject: |
|
|
Its not supported by Windows OS, but I think it can be done using some subclassing. I just don't have desires to do so, so you will have to leave without it.
You can try Black Box for WIndows for uber menu possibilities. _________________
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Tue Sep 11, 2007 1:52 am Post subject: |
|
|
| shader wrote: | | I'm using the My Favorites folder script and I was looking for a way to make icons and change menu color. | The icons part can be done. To get the associated small icon of a file, look in this thread for Chris' post about SHGetFileInfo().
| Quote: | | To have for menus showing pressing a hotkey,for example. | Perhaps you could simulate four menus by having a single four-column menu.
The MMenu demo script shows how to use columns. Specifically, this line: | Code: | | MMenu_Add( time, "time title 2", "icons\chat.ico", 0, "b| d iv2") | The b| option places the item in a new column. The pipe '|' tells it to show a vertical line between the columns. |
|
| Back to top |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1238
|
Posted: Thu Oct 11, 2007 5:56 am Post subject: |
|
|
| When I try the example menu (or make my own), the highlighted item is blue (not red as in the picture on the 1st page) and the text remains black, it doesn't invert the colour, so it can't be read. Any ideas what's wrong/how to change the colours? (I'm using Windows XP, latest AHK version) |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Thu Oct 11, 2007 8:34 am Post subject: |
|
|
You are probably using some skining application like WindowBlinds.
Exclude AutoHotkey.exe in its config if that is the case. _________________
 |
|
| Back to top |
|
 |
|