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

CXTPControlComboBox

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


Joined: 29 September 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote andreaswill Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox
    Posted: 29 September 2004 at 1:01pm

Hallo,

 

i have a problem with the CXTPControlComboBox. I inserted it into a CXTPToolbar. When disabling the control, no content is shown in the combobox.

m_ComboRight = (CXTPControlComboBox*CXTPControlComboBox::CreateObject();
m_ComboRight->AddString( "Block" );
m_ComboRight->AddString( "Text" );
m_ComboRight->AddString( "Attribute" );
m_ComboRight->SetCurSel(0);
m_ComboRight->SetEnabled(FALSE);

 

I want that 'block' is shown when the Combobox is in disabled state.What do i have to do ?

 

Thanks

Andreas

 

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: 30 September 2004 at 12:15am

you need to add custom paint maanger:

 

class CCustomPaintManager : public CXTPOfficeTheme // CXTPOffice2003Theme
{
 CSize DrawControlComboBox(CDC* pDC, CXTPControlComboBox* pControlCombo, BOOL bDraw)
 {
  CSize sz = CXTPOfficeTheme::DrawControlComboBox(pDC, pControlCombo, bDraw);

  if (bDraw && !pControlCombo->GetEnabled() && !pControlCombo->GetEditCtrl())
  {
   CRect rc = pControlCombo->GetRect();
   int nThumb = pControlCombo->m_nThumbWidth;
   CRect rcBtn (rc.right - nThumb, rc.top, rc.right, rc.bottom);


   BOOL bPopupBar = pControlCombo->GetParent()->GetType() == xtpBarTypePopup;
   if (bPopupBar ||pControlCombo->GetStyle() == xtpComboLabel)
   {
    rc.left += pControlCombo->m_nLabelWidth;
   }

   CRect rcText(rc); rcText.DeflateRect(3, 1, rcBtn.Width(), 1);
   pDC->SetTextColor(GetXtremeColor(COLOR_ GRAYTEXT));
   pDC->DrawText(pControlCombo->GetText (), rcText, DT_SINGLELINE | DT_VCENTER);  
  }

  return sz;
 }

};

 

 

usage:

 XTPPaintManager()->SetCustomTheme(new CCustomPaintManager());

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