X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a047aff270905b377a81657a90f92eb3297157d0..9cd722e33761671e3a03a30313ef6486a55d2730:/src/generic/srchctlg.cpp diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index f9ac1a41dd..49b469f033 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -134,6 +134,24 @@ public: return m_descriptiveText; } + + // provide access to the base class protected methods to wxSearchCtrl which + // needs to forward to them + void DoSetValue(const wxString& value, int flags) + { + wxTextCtrl::DoSetValue(value, flags); + } + + bool DoLoadFile(const wxString& file, int fileType) + { + return wxTextCtrl::DoLoadFile(file, fileType); + } + + bool DoSaveFile(const wxString& file, int fileType) + { + return wxTextCtrl::DoSaveFile(file, fileType); + } + protected: void OnText(wxCommandEvent& eventText) { @@ -334,7 +352,8 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id, #else style |= wxBORDER_SIMPLE; #endif - if ( !wxTextCtrlBase::Create(parent, id, pos, size, style, validator, name) ) + if ( !wxSearchCtrlBaseBaseClass::Create(parent, id, pos, size, + style, validator, name) ) { return false; } @@ -342,8 +361,6 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id, m_text = new wxSearchTextCtrl(this, value, style & ~wxBORDER_MASK); m_text->SetDescriptiveText(_("Search")); - wxSize sizeText = m_text->GetBestSize(); - m_searchButton = new wxSearchButton(this, wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, m_searchBitmap); @@ -540,7 +557,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) searchMargin = 0; cancelMargin = 0; } - wxCoord textWidth = width - sizeSearch.x - sizeCancel.x - searchMargin - cancelMargin; + wxCoord textWidth = width - sizeSearch.x - sizeCancel.x - searchMargin - cancelMargin - 1; // position the subcontrols inside the client area @@ -899,9 +916,17 @@ wxTextCtrl& operator<<(const wxChar c); void wxSearchCtrl::DoSetValue(const wxString& value, int flags) { - m_text->ChangeValue( value ); - if ( flags & SetValue_SendEvent ) - SendTextUpdatedEvent(); + 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 @@ -1178,7 +1203,7 @@ void wxSearchCtrl::RecalcBitmaps() m_cancelBitmap.GetWidth() != bitmapHeight ) { - m_cancelBitmap = RenderCancelBitmap(bitmapHeight-BORDER,bitmapHeight-BORDER); // square + m_cancelBitmap = RenderCancelBitmap(bitmapHeight-BORDER-1,bitmapHeight-BORDER-1); // square m_cancelButton->SetBitmapLabel(m_cancelBitmap); } // else this bitmap was set by user, don't alter