Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Ulrich Heinicke
|
Jan 6, 2008 - 4:58 AM
|
|
|
Technical Support
|
Jan 11, 2008 - 8:30 AM
|
Yes, this is an appropriate solution.
|
|
Ulrich Heinicke
|
Jan 10, 2008 - 5:00 AM
|
To only remove the WM_PAINT handler from COXComboPickerCtrl will be draw the control not like http://www.ibh-software.org/combobox2.png. But i find a way to solve that problem, i overwrite into the COXComboPickerCtrl the function _OnDrawComboImpl and remove the WM_PAINT handler. Here is the overwrite function: void COXComboPickerCtrl::_OnDrawComboImpl(bool bPressed, bool bHover, CDC * pDC) { bool bCallReleaseDC = false; if( pDC == NULL ) { pDC = GetDC(); ASSERT( pDC != NULL ); bCallReleaseDC = true; }
CRect rectClient; GetClientRect(rectClient);
CBrush BkBrush (GetSysColor (COLOR_WINDOW));
pDC->FillRect (&rectClient, &BkBrush);
// draw dropdown button CRect rectDropdownButton=GetDropdownButtonRect();
HFONT hFont = OnQueryFont(); if( ! PmBridge_GetPM()->AdjustControlFont( hFont, this ) ) { LOGFONT _lf; ::memset( &_lf, 0, sizeof(LOGFONT) ); ::GetObject( (HGDIOBJ)hFont, sizeof(LOGFONT), (LPVOID) &_lf ); _lf.lfWeight = (_lf.lfWeight > FW_BOLD) ? _lf.lfWeight : FW_BOLD; hFont = ::CreateFontIndirect( &_lf ); } ASSERT( hFont != NULL ); CFont _fontDestructor; _fontDestructor.Attach( hFont );
CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd( this, true, rectDropdownButton, _T(""), NULL, false, bHover, false, false, true, true, false, false, false, hFont, false, 0, false );
PmBridge_GetPM()->PaintPushButton( *pDC, _ppbd );
CRect rcDDButtonGlyph( rectDropdownButton ); // if( m_bPushed ) rcDDButtonGlyph.OffsetRect(1,1);
// paint arrow down CExtPaintManager::glyph_t * pGlyph = CExtPaintManager::g_DockingCaptionGlyphs[ CExtPaintManager::__DCBT_ARROW_DOWN ]; ASSERT( pGlyph != NULL ); COLORREF ColorValues[2] = { RGB(0,0,0), ::GetSysColor( COLOR_BTNTEXT ) }; PmBridge_GetPM()->PaintGlyphCentered( *pDC, rcDDButtonGlyph, *pGlyph, ColorValues );
// draw border pDC->Draw3dRect(rectClient,::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DHILIGHT)); rectClient.DeflateRect(1,1); pDC->Draw3dRect(rectClient,::GetSysColor(COLOR_3DDKSHADOW), ::GetSysColor(COLOR_3DFACE)); rectClient.DeflateRect(1,1);
// adjust for dropdown button rectClient.right=rectDropdownButton.left-1; rectClient.DeflateRect(1,1); // do default painting DRAWITEMSTRUCT dis={ sizeof(&dis) }; dis.CtlType=ODT_COMBOBOX; dis.CtlID=GetDlgCtrlID(); dis.itemID=0; dis.itemAction=ODA_DRAWENTIRE; dis.hwndItem=GetSafeHwnd(); dis.hDC=pDC->GetSafeHdc(); dis.rcItem=rectClient; dis.itemData=0; dis.itemState=((::GetFocus()==GetSafeHwnd() && !GetDroppedState()) ? ODS_FOCUS : 0); DrawItem(&dis);
if( bCallReleaseDC ) ReleaseDC( pDC ); } Now it’s work ok. Ulrich
|
|
Technical Support
|
Jan 10, 2008 - 2:58 AM
|
You derived your class COXComboPickerCtrl from CExtComboBox . The latter paints its content itself. So you should remove the WM_PAINT handler from COXComboPickerCtrl .
|
|
Ulrich Heinicke
|
Jan 9, 2008 - 10:22 AM
|
|
|
Ulrich Heinicke
|
Jan 9, 2008 - 10:21 AM
|
|
|
Technical Support
|
Jan 9, 2008 - 6:34 AM
|
Actually the combo box on the File Dialog is an extended version of the simple combo box control which provides support for image lists (CComboBoxEx ). So it is incorrect to subclass it with the CExtComboBox class which is derived from the simple CComboBox . We spent a lot of time to create the Prof-UIS skinned extended combo box but failed. It simply ignores the WM_PAINT message and draws itself in some other way. If you find a way how to create a skinned version of CComboBoxEx then you will be able to use it in the File Dialog window.
If you are creating these dialogs from scratch and encounter this error, please send us the source code so we can test it on our side and find out what is wrong.
|
|