PDA

View Full Version : OSD Menu Plugin.....has this been updated?



MrX
January 3rd, 2006, 06:39 AM
OSD Menu Plugin.....has this been updated?...It gives me errors when trying to use it. It says that "trigger_command is no longer supported". Please help

Promixis
January 3rd, 2006, 11:09 AM
the osd menu plugin is for g3.3 only.

use the osd menu as documented in the manual

MrX
January 5th, 2006, 06:50 PM
Has anyone got a .gml with an example script?...

Promixis
January 5th, 2006, 07:15 PM
there is one in the download area plus in the manual. also one in the example/demo file

MrX
January 5th, 2006, 07:40 PM
Sorry for my lack of knowlege, but how do I use this script? If I attach an event to the script it produces an error. The dump from the lua console is
[string "OSD Examples.gml:\Menu\Scripting"]:27: attempt to index field `Classes' (a nil value)
stack traceback:
[string "OSD Examples.gml:\Menu\Scripting"]:27: in main chunk


Would I be correct in guessing that I need to create a new action calling
ShowResult (number,text) ?

Promixis
January 5th, 2006, 09:50 PM
Hi, can you post the complete script.

MrX
January 6th, 2006, 02:03 AM
This is the script that is used as an example for "menu" in the OSD example.gml, provided with Girder 4.



--[[

OSD Menu example

:New ({Modifiers})

Modifiers is a table containing modifications to the base class (see osd.lua). The example below specifies a callback function.

:Initialize ()

Setups up the menu

:Show (ForceToTopOfScreen,Title,{Table of items})


--]]


local function ShowResult (number,text)

osd.StatusMessage ("You picked item "..number.." -> "..text)

end

local menu = osd.Classes.Menu:New ({Callback = ShowResult})

menu:Initialize ()

menu:Show (true,"OSD Menu",{"Item 1","Use Mouse Wheel","to scroll","or use","arrow keys","This menu times out","after 5 seconds","Item 8","Item 9","Bottom","Next","Page","End of list",})



I would like to know how to pop up an OSD Menu with one button press, navigate it with my remote and use it to launch an application. Any help to achieve this would be appreciated.
Thanks

Promixis
January 7th, 2006, 10:01 AM
try this example


http://www.promixis.com/download.php?ID=892

the code is shown below.





local function ShowResult (number,text)

if number == 1 then -- launch app 1

win.ShellExecuteEx ('Notepad.exe',nil,nil,nil)

elseif number == 2 then

win.ShellExecuteEx ('calc.exe',nil,nil,nil)

elseif number == 3 then

win.ShellExecuteEx ('c:\\program files\\promixis\\girder\\event.exe',nil,nil,nil)

end

end

local menu = osd.Classes.Menu:New ({Callback = ShowResult})

menu:Initialize ()

menu:Show (true,"Application Launcher",{'NotePad','Calculator','Girder Event'})

MrX
January 13th, 2006, 01:53 AM
Am I supposed to use this with a trigger event or is it a global script which I somehow call through LUA?.... I attached an event to a button on my remote but it comes up with an error. The dump from the LUA console is....
[string "OSD Examples.gml:\Menu\Scripting"]:39: attempt to index field `Classes' (a nil value)
stack traceback:
[string "OSD Examples.gml:\Menu\Scripting"]:39: in main chunk


Sorry guys, not sure what I did but its going now :oops:

Promixis
January 13th, 2006, 09:56 AM
you can attach an event to this lua script action.

does this work when you use the test action (F5)?

MrX
January 13th, 2006, 04:10 PM
How do I go about setting this example so that another press of the button on my remote closes the osd menu? The buttons on my remote (CoolCommand, winfast TV2000XP Deluxe) only return an event on button down.

Promixis
January 13th, 2006, 08:18 PM
Not sure what you mean?

You could set a state on an action to do alternate actions on each button press.

MrX
January 14th, 2006, 05:24 PM
If I set a state on an action to do it, then if I let the OSD menu time out the state remains at the secondary state. Also I would like to be able to switch dScaler off with the remote even if it has been launched by another means. Is there some way of incrementing the state count via lua?.....then I could use a window conditional to test for instances of dScaler. :oops:

Promixis
January 14th, 2006, 07:05 PM
no you can't change the state count via lua.

you should be able to code all this logic in lua though, ie emulate states within lua using whatever logic you need.