<September 2007>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Navigation

Subscriptions

Styled Menus in C7


This is a simple example that shows how easy it is to change the style of your menu's at runtime.  You can use pure template code to setup a menu style at design time, but if you want to change the style based on user preference, or on target OS, or any other variable, you only need a few lines of code. The example also shows how to create styled popup menus.

This code was generated by the templates and then copied into an embed point:

COMPILE ('**CW7**',_CWVER_=7000)
     MenuStyleMgr.Init(?MenuBar)
     MenuStyleMgr.SetFlatMode(True)
     MenuStyleMgr.SetColor(MenuBrushes:ImageBkgnd,16706781,14854529)
     MenuStyleMgr.SetColor(MenuBrushes:SelectedBkgnd,16706781,14854529,False)
     MenuStyleMgr.SetColor(MenuBrushes:SelectedBarBkgnd,16706781,14854529,True)
     MenuStyleMgr.SetColor(MenuBrushes:HotBkgnd,16706781,14854529,True)
     MenuStyleMgr.SetColor(MenuBrushes:FrameBrush,8388608, 8388608,True)
     AppFrame{PROP:Text} = 'Menu Styles Demo - Luna Blue Menu Style Active'
 DISPLAY()
!**CW7**

You can drop this code into an appropriate embed point and change the menu style at runtime to any of the pre-built styles and any user-defined style (like this example does). Of course with the use of the COMPILE directive this code has no effect in your Clarion6 app.

Download demo App and project source - 69kb
Download a local link executable - 589kb

posted on Thursday, September 13, 2007 1:32 PM by Robert Zaunere

# re: Styled Menus in C7 @ Thursday, September 13, 2007 3:59 PM

Hi Bob,

Just a small problem, the .CLW is missing from the download zip file :)

Thanks
Steve B.

Stephen Bottomley

# re: Styled Menus in C7 @ Thursday, September 13, 2007 4:01 PM

My bad, I kepp forgetting about .app files.

Stephen Bottomley

# re: Styled Menus in C7 @ Friday, September 14, 2007 8:09 AM

No problem, I should have included the generated code, but I figured this would kind of force people to see how easy to work between an .App and a C7 project. :)

Robert Zaunere

Powered by Community Server, by Telligent Systems