1. wxChoice and wxComboBox support client data under MSW
2. control creation streamlined under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,6 +58,39 @@ wxControl::~wxControl()
|
||||
m_isBeingDeleted = TRUE;
|
||||
}
|
||||
|
||||
bool wxControl::MSWCreateControl(const wxChar *classname, WXDWORD style)
|
||||
{
|
||||
m_hWnd = (WXHWND)::CreateWindowEx
|
||||
(
|
||||
GetExStyle(style), // extended style
|
||||
classname, // the kind of control to create
|
||||
NULL, // the window name
|
||||
style, // the window style
|
||||
0, 0, 0, 0, // the window position and size
|
||||
GetHwndOf(GetParent()), // parent
|
||||
(HMENU)GetId(), // child id
|
||||
wxGetInstance(), // app instance
|
||||
NULL // creation parameters
|
||||
);
|
||||
|
||||
if ( !m_hWnd )
|
||||
{
|
||||
#ifdef __WXDEBUG__
|
||||
wxLogError(_T("Failed to create a control of class '%s'"), classname);
|
||||
#endif // DEBUG
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
// controls use the same font and colours as their parent dialog by default
|
||||
InheritAttributes();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxSize wxControl::DoGetBestSize()
|
||||
{
|
||||
return wxSize(DEFAULT_ITEM_WIDTH, DEFAULT_ITEM_HEIGHT);
|
||||
@@ -147,6 +180,19 @@ void wxControl::OnEraseBackground(wxEraseEvent& event)
|
||||
::SetMapMode((HDC) event.GetDC()->GetHDC(), mode);
|
||||
}
|
||||
|
||||
WXDWORD wxControl::GetExStyle(WXDWORD& style) const
|
||||
{
|
||||
bool want3D;
|
||||
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
|
||||
|
||||
// Even with extended styles, need to combine with WS_BORDER
|
||||
// for them to look right.
|
||||
if ( want3D || wxStyleHasBorder(m_windowStyle) )
|
||||
style |= WS_BORDER;
|
||||
|
||||
return exStyle;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user