Print Page | Close Window

CXTPControlColorSelector and Prop Grid

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6446
Printed Date: 12 November 2025 at 9:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlColorSelector and Prop Grid
Posted By: esc67
Subject: CXTPControlColorSelector and Prop Grid
Date Posted: 17 February 2007 at 7:54pm
A year ago I laboriously created a custom version of CXTPControlColorSelector so that I can display my own palette of colors from a commandbar.  Now I would like to present the same selector from a property grid item.
 
The problem is that the Property Grid sample uses an entirely different color picker class: CXTColorPopup.  It actually looks more customizable than CXTPControlColorSelector, but I'd rather not re-implement another color picker and then maintain them both.
 
Is there any way to pop up a CXTPControl from a PropertyGrid item?  Can my CXTPControlColorSelector be made to work like a drop-down menu from a grid's color item?
 



Replies:
Posted By: esc67
Date Posted: 17 February 2007 at 8:18pm
Ah!  I found CXTPCommandBars::TrackPopupMenu
 
That seems to work:
 

CXTPControlPopupColor* pPopupColor = (CXTPControlPopupColor*)CXTPControlPopupColor::CreateObject();
CXTPPopupToolBar* pColorBar = CXTPPopupToolBar::CreatePopupToolBar(GetCommandBars());
pPopupColor->SetCommandBar(pColorBar);
pColorBar->GetControls()->Add(new CRobloxControlColorSelector(), ID_COLOR_PAINT_SELECTOR);
CXTPCommandBars::TrackPopupMenu(pColorBar, TPM_LEFTBUTTON, 400, 400, AfxGetMainWnd());
pColorBar->InternalRelease();
 
Is this the basic idea?
 


Posted By: Oleg
Date Posted: 20 February 2007 at 2:24am
Hi,
 
Yeap, it looks very right.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net