hi everyone
is there any way to create a menu but i open it from tray
for example like this
many thanks
Professional Software Development Tools
hi everyone
is there any way to create a menu but i open it from tray
for example like this
many thanks
yes, you can change the system tray menu to anything you want (but without icons unfortunately)
look here
http://www.indigorose.com/forums/sho...33&postcount=2
Open your eyes to Narcissism, Don't let her destroy your life!!
first RizlaUK welcome back. and thanks for pointing in right direction. (it helped me as well)
thank you RizlaUK answering me..... but you know what that`s really hard
for me to inderstand the code you gave me ....if you can make an example
for that plz...and sorry to take from your time
manny thanks
wassim21k if you undestood that can you make for me an example
ok, there is realy not much point of a example as the code simply goes in global functions and thats it,
i have commented the code a bit for you so you can understand how it works and how to customize it
place this code in globals and then preview your project, look at the menu and you see how it is laid out, then go back in to globals and edit the menu to suit your needs
Hope that helpsCode:function g_OnSystemTrayMenu(X, Y) tblMenu = {}; -- this is menu item 1 tblMenu[1] ={}; -- this line defines the menu item number tblMenu[1].Text = "&New Menu 1"; -- this line defines the menu item text tblMenu[1].ID = 100; -- this line defines the menu item ID (must increment as your menu grows) tblMenu[1].Checked = false; -- set if the menu item is checked tblMenu[1].Enabled = true; -- set if the menu item is enabled -- this is submenu item 1 for menu item 1 (delete if submenu is not needed) tblMenu[1].SubMenu = {}; -- this line defines the submenu tblMenu[1].SubMenu[1] = {}; tblMenu[1].SubMenu[1].Text = "&SubItem 1"; tblMenu[1].SubMenu[1].ID = 101; tblMenu[1].SubMenu[1].Checked = false; tblMenu[1].SubMenu[1].Enabled = true; -- this is submenu item 2 for menu item 1 (delete if submenu is not needed) tblMenu[1].SubMenu[2] = {}; tblMenu[1].SubMenu[2].Text = "S&ubItem 2"; tblMenu[1].SubMenu[2].ID = 102; tblMenu[1].SubMenu[2].Checked = false; tblMenu[1].SubMenu[2].Enabled = true; -- this is menu item 2 tblMenu[2] ={}; tblMenu[2].Text = "&New Menu 2"; tblMenu[2].ID = 200; tblMenu[2].Checked = false; tblMenu[2].Enabled = true; tblMenu[2].SubMenu = {}; -- this is submenu item 1 for menu item 2 (delete if submenu is not needed) tblMenu[2].SubMenu[1] = {}; tblMenu[2].SubMenu[1].Text = "&SubItem 1"; tblMenu[2].SubMenu[1].ID = 201; tblMenu[2].SubMenu[1].Checked = false; tblMenu[2].SubMenu[1].Enabled = true; -- this is submenu item 2 for menu item 2 (delete if submenu is not needed) tblMenu[2].SubMenu[2] = {}; tblMenu[2].SubMenu[2].Text = "S&ubItem 2"; tblMenu[2].SubMenu[2].ID = 202; tblMenu[2].SubMenu[2].Checked = false; tblMenu[2].SubMenu[2].Enabled = true; -- this is menu item 3 tblMenu[3] ={}; tblMenu[3].Text = "&New Menu 3"; tblMenu[3].ID = 300; tblMenu[3].Checked = false; tblMenu[3].Enabled = true; result = Application.ShowPopupMenu(X, Y, tblMenu, TPM_RIGHTALIGN, TPM_BOTTOMALIGN, true, false); -- this code checks for which menu item was clicked if(result ~= -1)then if result == 101 then result = Dialog.Message("Notice", "You clicked \"Menu 1 SubItem 1\""); elseif result == 102 then result = Dialog.Message("Notice", "You clicked \"Menu 1 SubItem 2\""); elseif result == 201 then result = Dialog.Message("Notice", "You clicked \"Menu 2 SubItem 1\""); elseif result == 202 then result = Dialog.Message("Notice", "You clicked \"Menu 2 SubItem 2\""); elseif result == 300 then result = Dialog.Message("Notice", "You clicked \"Menu 3\""); end end end
Open your eyes to Narcissism, Don't let her destroy your life!!
i`m really sorry RizlaUK to take from your time and you are really helpfull i will
try and i tell you later![]()
anyway this is my little project ..
the code is working thank you RizlaUK but i have to write a lot if i want add
something and i focus ...thank you
thats the thing, custom menus do take a lot of code but i think its worth it for the *pro* look
Open your eyes to Narcissism, Don't let her destroy your life!!
Thanks RizlaUK,
working good for me too, just need to work out now how to make those menu selections = the actions form when i click a button in my project, and how to work the restore minimise thing so it operates the same as standard one, and then the Always on Top tick box thing ... i'll get there.... eventually !!
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
thanks tigg ... i actually managed to get it all sorted last night .... i will still look at that example as it will probably show me a better way to go about it all, my menu having 17 entries in total (inculding spaces) resulted in a stupidly large amount of code in the Global Functions section, but it works.
Only thing i didnt do was to make the minimise and restore options disabled dependant on the current state, as i found using the restore option to simply bring the project to the top was quite handy as i have only the tasktray icon when the project is running, and if you try and minimise something that is already minimised then it has no affect !!
I posted my solution in a seperate thread so if anyone was searching purely for menu tips on task tray menu's it would return in their search
EDIT: ... grabed it and it helped me real fast to do the divders/spacers properly in the menu and i also managed to grab the section to enable/disable the restore/minimise options which looks a lot better... cheers
'Tiggs a good guy and still my "go to" guy for advanced Table (Array) questions. I'm thinking of putting a tagline on my products as such, "Tigg inside!", with a catchy mouse short.
@ 'Tigg --- >![]()
Intrigued
this has been a great helping hand to me aswell, thanks![]()