5,445,109 members and growing! (15,190 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Controls     Intermediate

Colour Picker Control for Windows CE

By Joao Paulo Figueira

An implementation of the Office 97 style Colour Picker control for Windows CE
C++, eVC 3.0, eVC, Windows, CE 3.0, PocketPC 2002, Win Mobile, Mobile, Visual Studio, MFC, Dev

Posted: 30 Jan 2003
Updated: 5 Feb 2003
Views: 63,548
Bookmarked: 19 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
10 votes for this Article.
Popularity: 4.10 Rating: 4.10 out of 5
1 vote, 10.0%
1
0 votes, 0.0%
2
1 vote, 10.0%
3
0 votes, 0.0%
4
8 votes, 80.0%
5

Sample Image - CeColourPicker.jpg

Introduction

This is a port of Chris Maunder's Office 97 style Colour Picker control[^] to Windows CE (PocketPC 2002). The code was adapted using the preprocessor macro _WIN32_WCE to enable transparent compilation in both eVC++ 3.0 and VC++ 6.0.

Porting

Here are the main points of the port.

Compatibility between CE and Desktop versions has been maintained through the precompiler, using the _WIN32_WCE #define.

The CE version of the popup is statically allocated in CColourPicker because CE does not support the WM_NCDESTROY message, making it impossible to dynamically delete the popup. This required the addition of a number of property set methods.

The popup is dismissed when the user clicks the button a second time, assuming a selection ended with cancel behavior.

The custom text button is not used to show up the CColorDialog. This class is not supported in MFC for the PocketPC 2002 SDK. One can still use the built in ChooseColor API, but the results are not very nice (see comment in the source code). The text changed to "Cancel".

WM_MOUSEMOVE is not used to make the color selection. CE has no mouse support and it would not be intuitive for a user to drag the pen just to start selecting the color. It has been replaced by WM_LBUTTONDOWN, and the handler code is the same.

This code has been tested in the PocketPC 2002 platform, compiles with no errors or warnings in Level 3 of eVC++ 3.0.

Revisions

  • 2003-02-06: Changed the OnKillFocus handler of CColourPopup in order to allow the popup to close when it loses focus.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Joao Paulo Figueira


João is a Microsoft Device Application Development MVP and partner at Primeworks, a company that develops remote database access software for Windows Mobile.
Occupation: Software Developer
Company: Primeworks
Location: Antarctica Antarctica

Other popular Mobile Development articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 14 of 14 (Total in Forum: 14) (Refresh)FirstPrevNext
Subject  Author Date 
Generalthe "X" buttonmemberparaGOD22:48 26 Dec '05  
GeneralRe: the "X" buttonmemberJoão Paulo Figueira0:39 27 Dec '05  
GeneralRe: the "X" buttonmemberparaGOD20:41 28 Dec '05  
GeneralRe: the "X" buttonmemberJoão Paulo Figueira0:08 29 Dec '05  
GeneralRe: the "X" buttonmemberparaGOD19:59 29 Dec '05  
GeneralCrashes under Windows Mobile 2003?membergniemcew15:51 25 Aug '04  
GeneralRe: Crashes under Windows Mobile 2003?memberJoão Paulo Figueira23:17 25 Aug '04  
GeneralRe: Crashes under Windows Mobile 2003?membergniemcew6:25 26 Aug '04  
GeneralSource code for the examplememberbiswa0:06 7 Mar '03  
GeneralRe: Source code for the examplememberJoão Paulo Figueira0:51 7 Mar '03  
GeneralRe: Source code for the examplememberbiswa1:21 7 Mar '03  
GeneralRe: Source code for the examplememberbm_masri17:55 17 Nov '03  
GeneralRe: Source code for the examplememberDaniel Jin5:06 24 Apr '05  
GeneralGreat job!memberDaniel S.6:59 31 Jan '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 5 Feb 2003
Editor: Smitha Vijayan
Copyright 2003 by Joao Paulo Figueira
Everything else Copyright © CodeProject, 1999-2008
Web07 | Advertise on the Code Project