定制 Windows CE .NET 用户界面
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. 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: 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 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 oREM //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
set GWE4_COMPONENTS=%GWE4_COMPONENTS%
sbcmnview nclientview gcacheview btnctlview
stcctlview cmbctlview lbctlview
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.
嵌入式新闻 嵌入式资料 嵌入式培训 嵌入式linux 嵌入式系统 嵌入式开发 嵌入式 相关文章:
- 煤矿井下综合自动化系统中的应用(04-06)
- 软件Overlay:程序编写与调试(01-20)
- USB数据通信接□模块的程序设计(10-17)
- 东江产业园:力争2017年产值达千亿(09-30)
- 硅谷数模的SlimPort扩大了Nexus7的显示屏选择(08-01)
- Lonworks控制网络技术在城市排水泵站自动化中的应用(06-06)