Click here to Skip to main content
6,928,573 members and growing! (16,120 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++, eVC3.0, Windows, PocketPC-2002, Visual-Studio, MFC, Dev
Posted:30 Jan 2003
Updated:5 Feb 2003
Views:76,254
Bookmarked:28 times
printPrint Friendly   add Share
      Discuss Discuss   Broken Article?Report  
9 votes for this article.
Popularity: 4.65 Rating: 4.88 out of 5

1

2
1 vote, 11.1%
3

4
8 votes, 88.9%
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


Member
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: Portugal Portugal

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • Windows Mobile, iPhone, Android - Marketplace Comparison
    Detailed comparison between Windows Mobile Marketplace, Apple's iPhone AppStore and Android Market from developer point of view.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
 
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 14 of 14 (Total in Forum: 14) (Refresh)FirstPrevNext
Generalthe "X" button PinmemberparaGOD22:48 26 Dec '05  
GeneralRe: the "X" button PinmemberJoão Paulo Figueira0:39 27 Dec '05  
GeneralRe: the "X" button PinmemberparaGOD20:41 28 Dec '05  
GeneralRe: the "X" button PinmemberJoão Paulo Figueira0:08 29 Dec '05  
GeneralRe: the "X" button PinmemberparaGOD19:59 29 Dec '05  
GeneralCrashes under Windows Mobile 2003? Pinmembergniemcew15:51 25 Aug '04  
GeneralRe: Crashes under Windows Mobile 2003? PinmemberJoão Paulo Figueira23:17 25 Aug '04  
GeneralRe: Crashes under Windows Mobile 2003? Pinmembergniemcew6:25 26 Aug '04  
GeneralSource code for the example Pinmemberbiswa0:06 7 Mar '03  
Can you pl post an example how to use it. It would be great if you post the application shown in screenshot.

Thanks
GeneralRe: Source code for the example PinmemberJoão Paulo Figueira0:51 7 Mar '03  
GeneralRe: Source code for the example Pinmemberbiswa1:21 7 Mar '03  
GeneralRe: Source code for the example Pinmemberbm_masri17:55 17 Nov '03  
GeneralRe: Source code for the example PinmemberDaniel Jin5:06 24 Apr '05  
GeneralGreat job! PinmemberDaniel S.6:59 31 Jan '03  

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+PgUp/PgDown to switch pages.

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