Examples
Search
Go
<
September 2007
>
Su
Mo
Tu
We
Th
Fr
Sa
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
Navigation
Home
Blogs
Forums
Subscriptions
RSS 2.0
Atom 0.3
Styled Menus - Update
We had some feedback in the Beta news group for where some developers were requesting some new functionality for the MenuStyles class.
Basically they wanted the ability to have their application detect the users current OS theme (or more aptly the color scheme in use), and then have the class be able to switch the colors used on the menu to match the users colors. We thought it was a pretty reasoable request so we have implemented it, and it'll be available in the next build.
Here's the code, its very simple, you just make a call to the new SetThemeColors method:
OF ?MenuStylesAutomatic
COMPILE ('**CW7**',_CWVER_=7000)
MenuStyleMgr.Init(?MenuBar)
MenuStyleMgr.SetThemeColors()
AppFrame{PROP:Text} = 'Menu Styles Demo - Automatic'
!**CW7**
END
A few things to consider, the end user can customize any OS theme, for example they can choose the Energy Blue theme and then change to green colors, and they also can purchase new themes, or download free 3rd party themes. So you can't count on knowing every theme, and you can't rely on a known theme using default colors.
So the SetThemeColors method does its best to determine the actual color in use and tries to match it. That should make it work no matter the theme, or the user customizations.
We also realize that some applications are designed with their own color "theme", background colors on windows, tab, button colors etc., and thats why we made the class flexible enough to let users choose from pre-determined styles that match
'known' OS themes, but we also support you designing your own menu color scheme. And now you have the option to let your application decide at runtime the colors to use on the menu based on the users current theme.
You can download a local link exe that has the new code to auto detect the theme color, and give it a test drive before we release it.
Download a local link executable - 670kb
After you load it up just go to the Menu Styles menu option and choose the 'Automatic' menu item.
posted on Saturday, September 15, 2007 12:52 PM by
Robert Zaunere
SoftVelocity Inc.