Results 1 to 4 of 4

Thread: how to add open item

  1. #1
    37099562 Guest

    Default how to add open item

    how to add line to open like when u pusinh from menu button name 'menu submenu option 1' if u put like this
    win.ShellExecuteEx ('c:\\program files\\promixis\\girder\\event.exe',nil,nil,nil) it opents together with menu same
    ????????????
    i triyed if then win.ShellExecuteEx ('c:\\program files\\promixis\\girder\\event.exe',nil,nil,nil) but doesn't work help

    local SubMenu1 = {
    Title='My First Submenu',
    [1]='SubMenu Option 1',
    [2]='SubMenu Option 2',
    }

    local MyMenu = {
    Title='Toplevel Menu',
    [1]='Menu Option 1',
    [2]='Menu Option 2',
    [3]=SubMenu1,
    [4]={
    Name='Menu Option 3 - Extended',
    EventString='Nice!!',
    EventDevice=100, -- Really you can add whatever you like here except for 'Title'.
    },
    }

    table.insert(SubMenu1, MyMenu)

    --[[ this one gets called when a user clicks on a menu item
    the item clicked can be one of three types as defined above.
    --]]
    local function MyAutoCB(Number, Text, Item, Closing)

    if type(Item) == 'string' then
    -- a regular menu item was clicked.
    gir.TriggerEvent(Text, 18,0)
    end

    if type(Item) == 'table' then

    -- Figure out if it was a submenu or an extended item.
    if not Item.Title then
    -- alright this is an extended entry.
    gir.TriggerEvent(Item.EventString, Item.EventDevice,0)
    else
    -- Sub Menu Item Clicked

    end

    end

    end

    -- Recycle the menu, do not keep creating new ones, you will run out of resources.
    if not AutoMenu then

    -- On the AutoMenu class DO NOT OVERRIDE THE Callback! Instead
    -- Override the AutoCallback, if the AutoCallback is not overriden
    -- the default is to Send the following Event:
    -- EventString: "<MENU TITLE>.<MENU ITEM>"
    -- EventDevice: 18
    -- EventModifier: 1
    -- Payload 1: <MENU ITEM>
    -- Payload 2: <MENU ITEM NUMBER>

    AutoMenu = osd.Classes.AutoMenu:New ({AutoCallback = MyAutoCB, Fade=true, TimeOut=5000})
    --AutoMenu = osd.Classes.AutoMenu:New ({Fade=true})
    AutoMenu:Initialize()

    AutoMenu.MaxItems=20
    end

    -- Toggle visibility.
    if not AutoMenu.Visible then
    AutoMenu:Show (true, MyMenu)
    else
    AutoMenu:Hide()
    end
    Last edited by 37099562; July 12th, 2008 at 06:47 PM.

  2. #2
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,541

    Default

    Use gir.TriggerEvent instead of event.exe. They serve the same purpose but one is FAST and the other (event.exe) is slow as it has to run an external program.
    Ron
    No support through PM

  3. #3
    37099562 Guest

    Default

    gir.TriggerEvent ???

  4. #4
    Join Date
    May 2004
    Posts
    2,588

    Default

    It is a scripting command. Look it up in the help file for the syntax.
    Beware of the robot.

Posting Permissions

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