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

定制 Windows CE .NET 用户界面

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

Lets examine the use of these environment variables. Here's a section of cesysgen.bat (part of the build system). We can see the first line checks for SYSGEN_REPLACESKIN. If this is set, then we skip including the standard Windows 95 and Windows XP UI components. If this is not set, then we look for SYSGEN_XPSKIN being set, and if it is, then we include the Windows XP skin components. If SYSGEN_XPSKIN is not set, then we include the Windows 95 skin components. Simple.

REM //XP or 9X UI
if "%SYSGEN_REPLACESKIN%"=="1" goto ReplaceSkin
if "%SYSGEN_XPSKIN%"=="1" 
set GWE4_COMPONENTS=%GWE4_COMPONENTS% 
sbcmnviewxp nclientviewxp gcacheviewxp btnctlviewxp 
stcctlviewxp cmbctlviewxp lbctlviewxp
if not "%SYSGEN_XPSKIN%"=="1" 
set GWE4_COMPONENTS=%GWE4_COMPONENTS% 
sbcmnview nclientview gcacheview btnctlview 
stcctlview cmbctlview lbctlview
:ReplaceSkin

To replace the default component with the component you customize, you must modify your cesysgen.bat file, and add a line similar to the following, which lists the skinning replacement libraries:

set GWE4_COMPONENTS=%GWE4_COMPONENTS% 
sbcmnview nclientview gcacheview btnctlview 
stcctlview cmbctlview lbctlview

The cesysgen.bat file can be found in the following folder: \WINCE400\public\%PROJECT_NAME%\WINCE400\%TARGETNAME%\oak\MISC. For an emulator project I'm working on, the cesysgen.bat file would be found here: \WINCE400\public\UIDemo\WINCE400\Emulator\oak\MISC.

We now understand how to remove the existing UI skin libraries (SYSGEN_REPLACESKIN) and how to add our own libraries to the build (cesysgen.bat). Let's now take a look at some of the Windows XP skin source code.

In this example, we could easily replace the 'button' focus rectangle drawing code with a solid rectangle. The Windows XP 'button' drawing code can be found in the following folder: \WINCE400\public\common\OAK\DRIVERS\SKINNABLEUI\GWEXP\BTNCTLVIEWXP. The file we're interested in is buttonviewxp.cpp. Search for DrawFocusRect_I. This is in the ButtonView_t::DrawText( ) function. We could replace the DrawFocusRect_I function call with a call to Gdi::Rectangle_I( ) to get a solid 'focus' rectangle. I'm sure you can think of many other ways to change the appearance of some of the Windows CE .NET user interface controls.

And then we're back to bitmaps—for example, changing the look of a scrollbar is as simple as using the Windows Paint program. The following folder contains the Scrollbar bitmaps: \WINCE400\public\common\oak\drivers\skinnableui\gwexp\gcacheviewxp\res\. Take a look at ScrollThumb.bmp and ScrollShaft.bmp; these are the bitmaps for vertical and horizontal 'thumbs,' and the horizontal and vertical 'shaft.' Simply edit the bitmaps, rebuild the operating system, and you have a whole new look.

Modifying Standard UI Dialogs (Startup, Out of Memory, Touch Screen Calibration)

Windows CE .NET contains a number of standard user interface components that can be OEM customized. These include the Startup UI, the Out-of-Memory UI, and the Touch-Screen-Calibration UI.

We may have specific setup/configuration options for our device that can be handled through the Startup UI (this is typically used to prompt for a password, and display user information). The Out-of-Memory UI component can be modified to prompt a user in a specific manner, or to work with headless devices, perhaps creating a log file or sending a message across the network to alert a system administrator. (Having a UI component isn't much use on headless devices!) Touch Screen Calibration is self-explanatory.

So how do we replace/modify these components?

This requires some modification o

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

网站地图

Top