X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8fb6915941f155741ab282eb8fcffb480407a982..c4b330b35d6d23868e522da196a6c520808f81ea:/wxPython/src/_srchctrl.i diff --git a/wxPython/src/_srchctrl.i b/wxPython/src/_srchctrl.i index cac34b3cfd..894b8a49a6 100644 --- a/wxPython/src/_srchctrl.i +++ b/wxPython/src/_srchctrl.i @@ -23,8 +23,8 @@ MAKE_CONST_WXSTRING(SearchCtrlNameStr); // define a dummy class for builds that don't have wxSearchCtrl enum { - wxEVT_COMMAND_SEARCHCTRL_CANCEL, - wxEVT_COMMAND_SEARCHCTRL_SEARCH + wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, + wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN }; class wxSearchCtrl : public wxTextCtrl @@ -58,6 +58,9 @@ public: virtual void ShowCancelButton( bool ) {} virtual bool IsCancelButtonVisible() const { return false; } + + virtual void SetDescriptiveText(const wxString& text); + virtual wxString GetDescriptiveText() const; }; #endif %} @@ -71,7 +74,7 @@ DocStr(wxSearchCtrl, "A search control is a composite of a `wx.TextCtrl` with optional bitmap buttons and a drop-down menu. Controls like this can typically be found on a toolbar of applications that support some form of search -functionality. On the Mac this control is implemneted using the +functionality. On the Mac this control is implemented using the native HISearchField control, on the other platforms a generic control is used, although that may change in the future as more platforms introduce native search widgets. @@ -94,14 +97,14 @@ Enter key in the control and wishes to start a search. Events ------- - ====================== ========================================= - EVT_SEARCHCTRL_SEARCH Sent when the search icon is clicked - EVT_SEARCHCTRL_CANCEL Sent when the cancel icon is clicked - EVT_TEXT Sent when the text changes - EVT_TEXT_ENTER Sent when the RETURN/ENTER key is pressed - in the search control and the control has - the wx.TE_PROCESS_ENTER style flag set. - ====================== ========================================= + ========================= ========================================= + EVT_SEARCHCTRL_SEARCH_BTN Sent when the search icon is clicked + EVT_SEARCHCTRL_CANCEL_BTN Sent when the cancel icon is clicked + EVT_TEXT Sent when the text changes + EVT_TEXT_ENTER Sent when the RETURN/ENTER key is pressed + in the search control and the control has + the wx.TE_PROCESS_ENTER style flag set. + ========================= ========================================= "); @@ -158,7 +161,6 @@ v10.3", ""); attached, the search button will be visible regardless of the search button visibility value. This always returns false in Mac OS X v10.3", ""); - DocDeclStr( virtual void , ShowCancelButton( bool show ), "Shows or hides the cancel button.", ""); @@ -168,6 +170,17 @@ button visibility value. This always returns false in Mac OS X v10.3", ""); "Indicates whether the cancel button is visible. ", ""); + DocDeclStr( + virtual void , SetDescriptiveText(const wxString& text), + "Set the text to be displayed when the user has not yet typed anything +in the control.", ""); + + DocDeclStr( + virtual wxString , GetDescriptiveText() const, + "Get the text to be displayed when the user has not yet typed anything +in the control.", ""); + + DocStr(SetSearchBitmap, "Sets the bitmap to use for the search button. This currently does not work on the Mac.", ""); @@ -178,6 +191,7 @@ on the Mac.", ""); DocStr(SetCancelBitmap, "Sets the bitmap to use for the cancel button. This currently does not work on the Mac.", ""); + #ifdef __WXMAC__ %extend { @@ -195,17 +209,18 @@ work on the Mac.", ""); %property(Menu, GetMenu, SetMenu); %property(SearchButtonVisible, IsSearchButtonVisible, ShowSearchButton); %property(CancelButtonVisible, IsCancelButtonVisible, ShowCancelButton); + %property(DescriptiveText, GetDescriptiveText, SetDescriptiveText); }; -%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_CANCEL; -%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_SEARCH; +%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN; +%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN; %pythoncode { - EVT_SEARCHCTRL_CANCEL = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL, 1) - EVT_SEARCHCTRL_SEARCH = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH, 1) + EVT_SEARCHCTRL_CANCEL_BTN = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, 1) + EVT_SEARCHCTRL_SEARCH_BTN = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, 1) } //---------------------------------------------------------------------------