X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdb7278a27d12c030edd59307b09103e5ade1501..654c223bc7c5457e407ff7d127a8129c821b07e4:/src/generic/srchctlg.cpp diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 49b469f033..e520c7dd24 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -532,6 +532,8 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) y += BORDER; width -= horizontalBorder*2; height -= BORDER*2; + if (width < 0) width = 0; + if (height < 0) height = 0; wxSize sizeSearch(0,0); wxSize sizeCancel(0,0); @@ -558,6 +560,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) cancelMargin = 0; } wxCoord textWidth = width - sizeSearch.x - sizeCancel.x - searchMargin - cancelMargin - 1; + if (textWidth < 0) textWidth = 0; // position the subcontrols inside the client area @@ -808,7 +811,7 @@ long wxSearchCtrl::GetInsertionPoint() const { return m_text->GetInsertionPoint(); } -wxTextPos wxSearchCtrl::GetLastPosition() const +long wxSearchCtrl::GetLastPosition() const { return m_text->GetLastPosition(); }