![]() |
CXTColorPicker 'Automatic' color |
Post Reply
|
| Author | |
DaveS
Groupie
Joined: 18 February 2005 Status: Offline Points: 24 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTColorPicker 'Automatic' colorPosted: 14 September 2006 at 2:00pm |
|
I am using a CXTColorPicker, but the top portion of the color selector that says either ‘Automatic’ or ‘No Fill’ doesn’t make sense in my application. However I can find no way to disable it. I can comment out the code that creates it in CXTColorSelectorCtrl, but then that leaves an awkward-looking gap. Can that top portion of the selector be made optional?
|
|
![]() |
|
Ark42
Senior Member
Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 September 2006 at 8:47pm |
|
It is up to you to code what Automatic does, but there isn't an option I saw to remoev the button if you don't want it. What I did was basically copy a little bit and modify from the CodeJock source:
//.h file class CXTColorPickerEx : public CXTColorPicker { DECLARE_DYNAMIC(CXTColorPickerEx) public: afx_msg void OnShowPopup(); DECLARE_MESSAGE_MAP() }; class CXTColorPopupEx : public CXTColorPopup { protected: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); DECLARE_MESSAGE_MAP() }; //.cpp file const UINT WM_XT_SHOWPOPUP = (WM_XTP_CONTROLS_BASE + 29); IMPLEMENT_DYNAMIC(CXTColorPickerEx, CXTColorPicker) BEGIN_MESSAGE_MAP(CXTColorPickerEx, CXTColorPicker) ON_MESSAGE_VOID(WM_XT_SHOWPOPUP, OnShowPopup) END_MESSAGE_MAP() void CXTColorPickerEx::OnShowPopup() { CRect rcWindow; GetWindowRect(&rcWindow); CXTColorPopupEx *pColorPopup = new CXTColorPopupEx(TRUE, 0); //use Ex version pColorPopup->Create(rcWindow, this, m_dwPopup, GetColor(), GetDefaultColor()); pColorPopup->SetFocus(); } BEGIN_MESSAGE_MAP(CXTColorPopupEx, CXTColorPopup) ON_WM_CREATE() END_MESSAGE_MAP() int CXTColorPopupEx::OnCreate(LPCREATESTRUCT lpCreateStruct) { m_rcBorders.top -= 27; CXTColorPopup::OnCreate(lpCreateStruct); CRect rect; GetWindowRect(&rect); rect.bottom -= 27; MoveWindow(rect, FALSE); return 0; } |
|
![]() |
|
DaveS
Groupie
Joined: 18 February 2005 Status: Offline Points: 24 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 September 2006 at 11:35am |
|
That worked great! Thanks!
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |