Print Page | Close Window

CXTPControlPopupColor question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=776
Printed Date: 21 November 2024 at 10:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlPopupColor question
Posted By: yoavo
Subject: CXTPControlPopupColor question
Date 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.

 




Replies:
Posted By: Oleg
Date 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


Posted By: cpede
Date 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++)


Posted By: cpede
Date 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++)


Posted By: cpede
Date 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++)


Posted By: cpede
Date 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++)



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