Click here to Skip to main content
Licence 
First Posted 16 Apr 2002
Views 42,687
Bookmarked 11 times

Color Dialog Control Set

By | 16 Apr 2002 | Article
Three controls let you create your own colro dialog

Usage

There are three controls included with the demo project, which are CLumChooser, CHusSatChooser and CColorBox.

To make use of these controls, you can simply add custom controls to your dialog template and specify the correct windows class names (declared inside CtrlSetting.h)

Then, you are required to add some code to your dialog implementation file.

  1. Add necessary DDX_Control to DoDataExchange
    DDX_Control(pDX, IDC_COLORBOX1, m_box[0]);
    DDX_Control(pDX, IDC_COLORBOX2, m_box[1]);
    DDX_Control(pDX, IDC_COLORBOX3, m_box[2]);
    DDX_Control(pDX, IDC_COLORBOX4, m_box[3]);
    DDX_Control(pDX, IDC_LUMCHOOSER, m_LumChooser);
    DDX_Control(pDX, IDC_HUESAT, m_HueSatChooser);
    
  2. Add necessary Macros and routines to handle child notification
    ON_NOTIFY(CHueSatChooser::NM_COLORCHANGE, IDC_HUESAT, OnHueSatChange)
    ON_NOTIFY(CLumChooser::NM_COLORCHANGE, IDC_LUMCHOOSER, OnLumChange)
    ON_NOTIFY(CColorBox::NM_BOXCLICK, IDC_COLORBOX1, OnColorBoxClick)
    ON_NOTIFY(CColorBox::NM_BOXCLICK, IDC_COLORBOX2, OnColorBoxClick)
    ON_NOTIFY(CColorBox::NM_BOXCLICK, IDC_COLORBOX3, OnColorBoxClick)
    ON_NOTIFY(CColorBox::NM_BOXCLICK, IDC_COLORBOX4, OnColorBoxClick)
    
    afx_msg void OnHueSatChange(NMHDR * pNotifyStruct, LRESULT * result );
    afx_msg void OnLumChange(NMHDR * pNotifyStruct, LRESULT * result );
    afx_msg void OnColorBoxClick(NMHDR * pNotifyStruct, LRESULT * result );
    

If there have any kinds of bugs or memory leaks, please let me know.

Have fun.

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

Alex Kwok

Web Developer

Hong Kong Hong Kong

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalwhy Gdiplus.dll doen't work with Visual C++ 6 Pinmemberwangsus5:02 23 Nov '05  
Hi I try to run your project in Visual C++ 6. I download Gdiplus.zip. Copy gdiplus.dll to debug and release folder. But I run it, it still complain about GdiplusStartup could not located in Gdiplus.dll
 
Thanks,
 
Susan
GeneralRGB Values PinmemberMatt Newman14:32 18 Apr '02  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 17 Apr 2002
Article Copyright 2002 by Alex Kwok
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid