Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 23
  1. #1
    Join Date
    Feb 2007
    Posts
    107

    is there any way to create a menu but i open it from tray

    hi everyone

    is there any way to create a menu but i open it from tray

    for example like this



    many thanks

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    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!!

  3. #3
    Join Date
    Oct 2006
    Posts
    209
    first RizlaUK welcome back. and thanks for pointing in right direction. (it helped me as well)

  4. #4
    Join Date
    Feb 2007
    Posts
    107
    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

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    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

    Code:
    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
    Hope that helps
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    Feb 2007
    Posts
    107
    i`m really sorry RizlaUK to take from your time and you are really helpfull i will

    try and i tell you later

  7. #7
    Join Date
    Feb 2007
    Posts
    107
    anyway this is my little project ..
    Attached Files

  8. #8
    Join Date
    Feb 2007
    Posts
    107
    the code is working thank you RizlaUK but i have to write a lot if i want add

    something and i focus ...thank you

  9. #9
    Join Date
    May 2006
    Posts
    5,380
    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!!

  10. #10
    Join Date
    Oct 2006
    Posts
    345
    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 !!

  11. #11
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by qwerty View Post
    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 !!
    The IR Project Code Viewer in the example forum has a tray menu built within it. There is a restore and minimize option as well. Maybe that will help with some of the coding. There is a link in my sig.

    Tigg
    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

  12. #12
    Join Date
    Oct 2006
    Posts
    345
    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

  13. #13
    Join Date
    Oct 2006
    Posts
    345
    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

  14. #14
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    '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

  15. #15
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287

    i do love this script:D

    this has been a great helping hand to me aswell, thanks
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Creating a Tray Menu
    By d3m0n1x in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 04-29-2006, 08:48 PM
  2. More Menu Bar Examples
    By Roboblue in forum AutoPlay Media Studio 7.5 Examples
    Replies: 5
    Last Post: 02-28-2006, 08:58 AM
  3. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  4. TUTORIAL: Showing and Hiding Objects in AutoPlay Menu Studio 3.0
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-10-2002, 02:39 PM
  5. HOWTO: Create Nested Shortcuts in the Start Menu
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-24-2002, 10:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts