X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8366ab05cd8541c272e5132e2482e9cfb20cbf27..059d234d4176165d975048eaa5436ef40af7d037:/src/generic/srchctlg.cpp diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 2beebcf613..494ae1537f 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -139,17 +139,17 @@ public: // needs to forward to them void DoSetValue(const wxString& value, int flags) { - m_text->DoSetValue(value, flags); + wxTextCtrl::DoSetValue(value, flags); } bool DoLoadFile(const wxString& file, int fileType) { - return m_text->DoLoadFile(file, fileType); + return wxTextCtrl::DoLoadFile(file, fileType); } bool DoSaveFile(const wxString& file, int fileType) { - return m_text->DoSaveFile(file, fileType); + return wxTextCtrl::DoSaveFile(file, fileType); } protected: @@ -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 @@ -574,7 +577,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) // accessors // --------- -wxString wxSearchCtrl::GetValue() const +wxString wxSearchCtrl::DoGetValue() const { wxString value = m_text->GetValue(); if (value == m_text->GetDescriptiveText()) @@ -582,11 +585,6 @@ wxString wxSearchCtrl::GetValue() const else return value; } -void wxSearchCtrl::SetValue(const wxString& value) -{ - m_text->SetValue(value); -} - wxString wxSearchCtrl::GetRange(long from, long to) const { return m_text->GetRange(from, to); @@ -808,7 +806,7 @@ long wxSearchCtrl::GetInsertionPoint() const { return m_text->GetInsertionPoint(); } -wxTextPos wxSearchCtrl::GetLastPosition() const +long wxSearchCtrl::GetLastPosition() const { return m_text->GetLastPosition(); } @@ -914,6 +912,21 @@ wxTextCtrl& operator<<(double d); wxTextCtrl& operator<<(const wxChar c); #endif +void wxSearchCtrl::DoSetValue(const wxString& value, int flags) +{ + m_text->DoSetValue(value, flags); +} + +bool wxSearchCtrl::DoLoadFile(const wxString& file, int fileType) +{ + return m_text->DoLoadFile(file, fileType); +} + +bool wxSearchCtrl::DoSaveFile(const wxString& file, int fileType) +{ + return m_text->DoSaveFile(file, fileType); +} + // do the window-specific processing after processing the update event void wxSearchCtrl::DoUpdateWindowUI(wxUpdateUIEvent& event) {