Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPControlPopupColor question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlPopupColor question

 Post Reply Post Reply
Author
Message
yoavo View Drop Down
Senior Member
Senior Member


Joined: 29 February 2004
Location: Israel
Status: Offline
Points: 140
Post Options Post Options   Thanks (0) Thanks(0)   Quote yoavo Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlPopupColor question
    Posted: 24 May 2004 at 6:07am

Hi,

I'm using a CXTPControlPopupColor in a toolbar, but I want to change the pallete of the control (I need different colors). How do I set a different set of colors in the control ?

thanks,Yoav.

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 01 June 2004 at 3:58am
Only one suggestion - copy code from CXTPControlColorSelector to you r project  and make changes in extendedColors array.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2016 at 9:34am
Maybe here 12 years after the request you could make a method for replacing the color array for the CXTPControlColorSelector control.

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2016 at 11:11am
OK, to be fair. It is possible to use CXTPControlGallery in popup menus, and thereby the CXTPControlColorSelector. This is a more flexible control, with methods to specify the colors.

However I have one problem. How to set the selected color on start popup of the control.

Calling SetSelectedItem on the CXTPControlGallery seems not to work if the popup is not already opened?

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2016 at 1:42pm
I can see the reason is this code:

void CXTPControlGallery::OnCalcDynamicSize(DWORD dwMode)
{
  if (DYNAMIC_DOWNCAST(CXTPControlComboBoxGalleryPopupBar, GetParent()) == 0)
  {
    m_nSelected = -1;
  }
  m_bHideSelection = FALSE;
  m_bPressed = FALSE;

  CXTPControlPopup::OnCalcDynamicSize(dwMode);
}

Why is the selection reset when parent is not CXTPControlComboBoxGalleryPopupBar?

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2016 at 4:30am
I commented this out in the check in the CXTPControlGallery source code and now my code works perfectly.

I can now use a "Ribbon" gallery component in a popup context menu. 



I'm using this CXTPPopupBar:
CXTPPopupBar *pPopupBar = CXTPPopupBar::CreatePopupBar(pPopupBar->GetCommandBars());
instead of the 
CXTPPopupBar* pPopupBar = CXTPControlComboBoxGalleryPopupBar::CreateComboBoxGalleryPopupBar(pPopupBar->GetCommandBars());

So why this check in CXTPControlGallery ?

-cpede


Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
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.203 seconds.