Align initial size handling with other ports.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -196,12 +196,8 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
|||||||
// font
|
// font
|
||||||
ChangeFont(false);
|
ChangeFont(false);
|
||||||
|
|
||||||
wxSize best = GetBestSize();
|
|
||||||
if( size.x != -1 ) best.x = size.x;
|
|
||||||
if( size.y != -1 ) best.y = size.y;
|
|
||||||
|
|
||||||
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
|
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
|
||||||
pos.x, pos.y, best.x, best.y);
|
pos.x, pos.y, size.x, size.y);
|
||||||
|
|
||||||
ChangeBackgroundColour();
|
ChangeBackgroundColour();
|
||||||
|
|
||||||
@@ -683,7 +679,13 @@ wxSize wxDoGetSingleTextCtrlBestSize( Widget textWidget,
|
|||||||
wxSize wxTextCtrl::DoGetBestSize() const
|
wxSize wxTextCtrl::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
if( IsSingleLine() )
|
if( IsSingleLine() )
|
||||||
return wxDoGetSingleTextCtrlBestSize( (Widget)m_mainWidget, this );
|
{
|
||||||
|
wxSize best = wxControl::DoGetBestSize();
|
||||||
|
|
||||||
|
if( best.x < 110 ) best.x = 110;
|
||||||
|
|
||||||
|
return best;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return wxWindow::DoGetBestSize();
|
return wxWindow::DoGetBestSize();
|
||||||
}
|
}
|
||||||
|
@@ -364,7 +364,7 @@ wxWindow::~wxWindow()
|
|||||||
g_captureWindow = NULL;
|
g_captureWindow = NULL;
|
||||||
|
|
||||||
m_isBeingDeleted = true;
|
m_isBeingDeleted = true;
|
||||||
|
|
||||||
// Motif-specific actions first
|
// Motif-specific actions first
|
||||||
WXWidget wMain = GetMainWidget();
|
WXWidget wMain = GetMainWidget();
|
||||||
if ( wMain )
|
if ( wMain )
|
||||||
@@ -1436,6 +1436,8 @@ void wxWindow::DoMoveWindowIntr(int xx, int yy, int w, int h,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if( xx < 0 ) xx = 0;
|
||||||
|
if( yy < 0 ) yy = 0;
|
||||||
if( w < 1 ) w = 1;
|
if( w < 1 ) w = 1;
|
||||||
if( h < 1 ) h = 1;
|
if( h < 1 ) h = 1;
|
||||||
|
|
||||||
@@ -1832,13 +1834,18 @@ bool wxWindow::AttachWidget (wxWindow* WXUNUSED(parent), WXWidget mainWidget,
|
|||||||
XtFree ((char *) ptr);
|
XtFree ((char *) ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x == -1)
|
SetInitialBestSize(wxSize(width, height));
|
||||||
x = 0;
|
|
||||||
if (y == -1)
|
|
||||||
y = 0;
|
|
||||||
SetSize (x, y, width, height);
|
|
||||||
|
|
||||||
return TRUE;
|
if (x != -1 || y != -1)
|
||||||
|
{
|
||||||
|
if (x == -1)
|
||||||
|
x = 0;
|
||||||
|
if (y == -1)
|
||||||
|
y = 0;
|
||||||
|
Move(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove event handler, remove from hash table
|
// Remove event handler, remove from hash table
|
||||||
|
Reference in New Issue
Block a user