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

CXTPControlColorSelector

 Post Reply Post Reply
Author
Message
JoeH View Drop Down
Newbie
Newbie
Avatar

Joined: 12 December 2003
Location: Germany
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote JoeH Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlColorSelector
    Posted: 05 February 2004 at 8:57am

Hi all,

I seem to have a problem with an CXTPControlColorSelector in a VC6 legacy app. Searching the forums did not help, so here goes:


The control displays just fine, selection of colors for the text works just fine but the control's GUI never displays the selected text color.


The sample apps (e.g. TearOffPopups_vc60.dsw) do just that. The colored "bar" under the letter A on the control's GUI changes according to the selected text color.


BTW, I use a 3rd party control for the view (Text Control) but like I said: setting the color in the view is OK as is setting/updating the color in the CXTPControlButtonColor tear off "More colors..." (always shows the color of the text with the caret in it).

What am I missing?

Thanks,
Joe

Sample code:

Mainframe:
...
ON_UPDATE_COMMAND_UI(ID_COLORPICKER, OnUpdateSelectorTextColor)
...
OnCreateControl
...
if (lpCreateControl->nID == ID_COLORPICKER && pToolBar->GetBarID() == IDR_FORMATBAR)
{
 [...]
 CXTPControlPopupColor* pPopupColor = new CXTPControlPopupColor();
 CXTPPopupBar* pColorBar = (CXTPPopupBar*)CXTPPopupToolBar::CreateObject();
 pPopupColor->SetCommandBar(pColorBar);
 pColorBar->GetControls()->Add(new CXTPControlColorSelector(), ID_COLORPICKER);
 pColorBar->GetControls()->Add(new CXTPControlButtonColor(), ID_COLORPICKER_MORE);
 pColorBar->EnableCustomization(FALSE);
 pPopupColor->SetCaption(_T(strControlTitle));
 pColorBar->SetTearOffPopup(_T(strControlTitle), ID_COLORPICKER, 0);
 pColorBar->InternalRelease();
 lpCreateControl->pControl = pPopupColor;
 return TRUE;
}

UPDATE_COMMAND_UI Handler:

OnUpdateSelectorTextColor(CCmdUI* pCmd)
{

 pCmd->Enable(TRUE);
 CXTPCommandBar* pToolBar = (CXTPToolBar*)pCmd->m_pOther;
 if (pToolBar)
 { 
  CXTPControlColorSelector* pSelector = (CXTPControlColorSelector*)pToolBar->GetControls()->Ge tAt(pCmd->m_nIndex);
  pSelector->SetColor(m_clrText);
 }
 
}

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.174 seconds.