FastMenu for Win32Lib

new topic     » topic index » view thread      » older message » newer message

I've created a menu creation library for use with Win32Lib.

   http://www.cklester.com/euphoria/

It's the first item in the <b>Euphoria Programs & Code</b> section.

More details can be found here: http://www.cklester.com/euphoria/?fastmenu

After I created it, I found that Win32Lib's new control creation system
using newUIObj creates menus almost the same way. Until the IDE starts to
use the newUIObj features, I think FastMenu for Win32Lib will still be
useful.

Derek, I translated menubang.exw to use FastMenu, and here's what it
looks like (call it "menubang2.exw" for the win32lib demo library)...

<code>
-----------------menubang2.exw
include win32lib.ew
include fastmenu.ew

without warning
constant SimpleWin =  create( Window, "Simple Window", 0, 0, 0, 320,200, 0 ),
         SB        =  create(StatusBar, "", SimpleWin, 0, {200,-1}, 0, 0, 0)

atom defHandler, bangHandler
         
---------------------------------
procedure w32HClick_menu(integer self,integer event,sequence params)
---------------------------------  
    sequence text          
    text = getText(self)
    setText({SB,1}, text)
    setText({SB,2}, "")
end procedure
defHandler = routine_id("w32HClick_menu")

---------------------------------
procedure w32HClick_bang(integer self,integer event,sequence params)
---------------------------------
    setText({SB,2}, "Immediate Action for " & getMenuItem(self))
end procedure
bangHandler = routine_id("w32HClick_bang")

sequence myMenu
myMenu =
	{
		{"Options",
			{ "Cold", "Warm", "Hot", "-", "Color" }
		},
		{"!BANG!:" & bangHandler,""},
		{"!POW!:" & bangHandler,""}
	}

create_Menu( SimpleWin, myMenu, defHandler )

WinMain(SimpleWin, Normal)
</code>

Let me know what y'all think.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu