fixd creation of controls with default initial size
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -98,14 +98,18 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
|||||||
// by default)
|
// by default)
|
||||||
style |= WS_CHILD | WS_VISIBLE;
|
style |= WS_CHILD | WS_VISIBLE;
|
||||||
|
|
||||||
|
int x = pos.x == -1 ? 0 : pos.x,
|
||||||
|
y = pos.y == -1 ? 0 : pos.y,
|
||||||
|
w = size.x == -1 ? 0 : size.x,
|
||||||
|
h = size.y == -1 ? 0 : size.y;
|
||||||
|
|
||||||
m_hWnd = (WXHWND)::CreateWindowEx
|
m_hWnd = (WXHWND)::CreateWindowEx
|
||||||
(
|
(
|
||||||
exstyle, // extended style
|
exstyle, // extended style
|
||||||
classname, // the kind of control to create
|
classname, // the kind of control to create
|
||||||
label, // the window name
|
label, // the window name
|
||||||
style, // the window style
|
style, // the window style
|
||||||
pos.x, pos.y, // the window position
|
x, y, w, h, // the window position and size
|
||||||
size.x, size.y, // and size
|
|
||||||
GetHwndOf(GetParent()), // parent
|
GetHwndOf(GetParent()), // parent
|
||||||
(HMENU)GetId(), // child id
|
(HMENU)GetId(), // child id
|
||||||
wxGetInstance(), // app instance
|
wxGetInstance(), // app instance
|
||||||
@@ -134,6 +138,12 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
|
|||||||
// controls use the same font and colours as their parent dialog by default
|
// controls use the same font and colours as their parent dialog by default
|
||||||
InheritAttributes();
|
InheritAttributes();
|
||||||
|
|
||||||
|
// set the size now if no initial size specified
|
||||||
|
if ( w == 0 || h == 0 )
|
||||||
|
{
|
||||||
|
SetBestSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user