Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtColorButton Collapse All
Subject Author Date
Ian McIntosh Feb 3, 2009 - 4:49 AM



I want to use the CExtColorButton to implement a color picker, but I want to be able to set the available colors.


Can I do this, and if so how?

some more info:

I need to be able to set the colors dynamically. For example, I may have a set of, say, 20 colors that are valid for the user to select and want to make those available using the color picker, rather than the colors that are available by default.

Looking at the Profuis_Controls sample Buttons page as an example. There is a button labelled color. If I press that it displays a color picker, with a set of colors shown. I want to be able to do something similar, but to set the colors that are shown.

I can see a class CExtColorPalletteWnd that looks like it allows setting of colors through CpwColorArraySet(). I’m not sure if a CExtColorButton causes a CExtColorPalletteWnd to be created, but if it does how can I get access to it to change the colors (and if not, what do I do instead to set the colors)?

Technical Support Feb 3, 2009 - 12:35 PM

The following screenshot demonstrates what you are looking for:

Then you should handle the CExtPopupMenuWnd::g_nMsgPrepareMenu registered message as it is demonstrated in the CPagePopupMenus::OnExtMenuPrepare() method in the ProfUIS_Controls sample application. To handle this message in the CExtButton-derived class you should implement the CWnd::WindowProc() virtual method because the CExtButton::WindowProc() method resends the CExtPopupMenuWnd::g_nMsgPrepareMenu registered messages to button’s parent window.