Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPControlColorSelector and Prop Grid
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlColorSelector and Prop Grid

 Post Reply Post Reply
Author
Message
esc67 View Drop Down
Newbie
Newbie


Joined: 09 June 2005
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote esc67 Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlColorSelector and Prop Grid
    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?
 
Back to Top
esc67 View Drop Down
Newbie
Newbie


Joined: 09 June 2005
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote esc67 Quote  Post ReplyReply Direct Link To This Post 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?
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 February 2007 at 2:24am
Hi,
 
Yeap, it looks very right.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.051 seconds.