微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 定制 Windows CE .NET 用户界面

定制 Windows CE .NET 用户界面

时间:02-24 来源:互联网 点击:

e User Interface Colors

One of the quickest and simplest ways to modify the appearance of a device is to modify some or all of the user interface colors. This is achieved through the registry. Note that the default system colors are not visible in the devices registry. To set colors to something other than the default system colors, we need to override the color map in the registry. The easiest way to do this is to build an operating system image using Platform Builder, download the image to either the emulation environment or to a reference board, use the control panel to modify the color scheme to match the colors you require for your device, and then use the remote registry editor to take a snapshot of the updated colors from the registry—after all, who wants to spend time guessing RGB values? The color map can be found in the following registry location: HKEY_LOCAL_MACHINE\SYSTEM\GWE\SysColor.

If we were to modify the system color map on a device (or emulator) and use Remote Registry Editor to extract a .REG file, here's how the extracted .REG file might look. Once we've extracted the registry information we can then add this to our Project.REG file and rebuild our platform to take advantage of the new color scheme.

[HKEY_LOCAL_MACHINE\SYSTEM\GWE]
 "SysColor"=hex:E0,E0,E0,00, 00,80,80,00, 80,80,FF,00, 80,80,80,00,
 C0,C0,C0,00, FF,FF,FF,00, 00,00,00,00, 00,00,00,00,
 00,00,00,00, FF,FF,00,00, C0,C0,C0,00, C0,C0,C0,00,
 80,80,80,00, 00,00,FF,00, 00,00,FF,00, C0,C0,C0,00,
 80,80,80,00, 80,80,80,00, 00,00,00,00, C0,C0,C0,00,
 FF,FF,FF,00, 00,00,00,00, DF,DF,DF,00, 00,00,00,00,
 FF,FF,E1,00

The .REG file contents directly map to the following colors on the device (note that each color is represented by 4 hex digits).

COLOR_SCROLLBAR
COLOR_BACKGROUND
COLOR_ACTIVECAPTION
COLOR_INACTIVECAPTION
COLOR_MENU
COLOR_WINDOW
COLOR_WINDOWFRAME
COLOR_MENUTEXT
COLOR_WINDOWTEXT
COLOR_CAPTIONTEXT
COLOR_ACTIVEBORDER
COLOR_INACTIVEBORDER
COLOR_APPWORKSPACE
COLOR_HIGHLIGHT
COLOR_HIGHLIGHTTEXT
COLOR_BTNFACE
COLOR_BTNSHADOW
COLOR_GRAYTEXT
COLOR_BTNTEXT
COLOR_INACTIVECAPTIONTEXT
COLOR_BTNHIGHLIGHT
COLOR_3DDKSHADOW
COLOR_3DLIGHT
COLOR_INFOTEXT
COLOR_INFOBK
COLOR_STATIC
COLOR_STATICTEXT

Note that COLOR_BTNFACE is used throughout the Windows XP-like user interface as the color for caption bars and the like.

Modifying User Interface Bitmaps

Another way to get a UI facelift is to alter some of the standard UI bitmaps.The bitmaps contain the toolbar button images used in standard Windows CE .NET applications, such as Microsoft? Windows Explorer. The toolbar bitmaps can be found in the following folder: \WINCE400\public\common\OAK\FILES.

· Stdsm.bmp: Windows 95-like toolbar bitmaps.

· Stdsmxp.bmp: Windows XP-like toolbar bitmaps.

· Viewsm.bmp: Windows 95 'file' toolbar bitmaps.

· Viewsmxp.bmp: Windows XP 'file' toolbar bitmaps.

So how about the 'Close' button on an applications caption bar? Can we also modify how this looks? Yes, absolutely. Let's look at how to change the Windows XP look.

This isn't as simple as it first seems. There are two parts to the Close button. The first is the background bitmap, which can be found in C:\wince400\public\common\OAK\DRIVERS\SKINNABLEUI\GWEXP\GCACHEVIEWXP\RES—the file is Closebutton.bmp. This contains the button background in up, down, selected, and disabled form. So how does the white "X" get added to the button?

Right, lets roll up them sleeves and dig into some of the skinnableui source code???… Perhaps the first stop on the tour of the code is the initialization function for the XP skin code. The code is wrapped into a class called CacheView_t. The initial

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top