CHTMLControlSection::CHTMLControlSection( CHTMLSection *pSectParent, GS::FontDef &fdef, const StringClass &strWindowClass, UINT uStyle, UINT uStyleEx, UINT uWidth, UINT uHeight ) : CHTMLSectionABC( pSectParent ) , m_fdef( fdef ) { SetKeep( true ); m_hwnd = CreateWindowEx( uStyleEx, strWindowClass, _T(""), uStyle, 0, 0, uWidth, uHeight, pSectParent->GetHwnd(), NULL, g_hQHTMInstance, NULL ); ASSERT( m_hwnd ); SubclassControl( m_hwnd, pSectParent, this ); }
CHTMLComboSection::CHTMLComboSection( CHTMLSection *pSectParent, GS::FontDef &fdef, CHTMLSelect *pFormObject, class CHTMLSectionCreator *psc ) : CHTMLSectionABC( pSectParent ) , m_fdef( fdef ) , m_pFormObject( pFormObject ) , m_uComboHeight( 0 ) { SetKeep( true ); if( !psc->IsMeasuring() && !psc->GetDC().IsPrinting() ) { DWORD dwStyle = WS_BORDER | WS_VSCROLL | WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL | CBS_NOINTEGRALHEIGHT; LPTSTR endptr; UINT uID = pFormObject->m_strID.GetLength() ? _tcstol( pFormObject->m_strID, &endptr, 10 ) : 0; m_hwnd = CreateWindowEx( WS_EX_STATICEDGE, _T("COMBOBOX"), NULL, dwStyle, 0, 0, 0, 0, pSectParent->GetHwnd(), (HMENU)uID, g_hQHTMInstance, NULL ); ASSERT( m_hwnd ); for( UINT u = 0; u < pFormObject->m_arrItems.GetSize(); u++ ) { CHTMLOption *pOption = pFormObject->m_arrItems[ u ]; LPCTSTR pcszText = (LPCTSTR)pOption->m_strText; if( pcszText ) { int nItem = SendMessage( m_hwnd, CB_ADDSTRING, 0, (LPARAM)pcszText ); if( pOption->m_bSelected ) { SendMessage( m_hwnd, CB_SETCURSEL, nItem, 0 ); } } } if( pFormObject->m_bDisabled ) { EnableWindow( m_hwnd, FALSE ); } SubclassControl( m_hwnd, pSectParent, this ); } }
void AeroControlBase::SubclassOkCancelHelp(CWnd* parent) { SubclassControl(parent, IDCANCEL); SubclassControl(parent, IDOK); SubclassControl(parent, IDHELP); }
bool AeroControlBase::SubclassControl(CWnd* parent, int controlId) { return SubclassControl(parent->GetDlgItem(controlId)->GetSafeHwnd()); }