srchctrl.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/srchctrl.h
  3. // Purpose: mac carbon wxSearchCtrl class
  4. // Author: Vince Harron
  5. // Created: 2006-02-19
  6. // Copyright: Vince Harron
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_SEARCHCTRL_H_
  10. #define _WX_SEARCHCTRL_H_
  11. #if wxUSE_SEARCHCTRL
  12. class wxSearchWidgetImpl;
  13. class WXDLLIMPEXP_CORE wxSearchCtrl : public wxSearchCtrlBase
  14. {
  15. public:
  16. // creation
  17. // --------
  18. wxSearchCtrl();
  19. wxSearchCtrl(wxWindow *parent, wxWindowID id,
  20. const wxString& value = wxEmptyString,
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. long style = 0,
  24. const wxValidator& validator = wxDefaultValidator,
  25. const wxString& name = wxSearchCtrlNameStr);
  26. virtual ~wxSearchCtrl();
  27. bool Create(wxWindow *parent, wxWindowID id,
  28. const wxString& value = wxEmptyString,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = 0,
  32. const wxValidator& validator = wxDefaultValidator,
  33. const wxString& name = wxSearchCtrlNameStr);
  34. // get/set search button menu
  35. // --------------------------
  36. virtual void SetMenu( wxMenu* menu );
  37. virtual wxMenu* GetMenu();
  38. // get/set search options
  39. // ----------------------
  40. virtual void ShowSearchButton( bool show );
  41. virtual bool IsSearchButtonVisible() const;
  42. virtual void ShowCancelButton( bool show );
  43. virtual bool IsCancelButtonVisible() const;
  44. // TODO: In 2.9 these should probably be virtual, and declared in the base class...
  45. void SetDescriptiveText(const wxString& text);
  46. wxString GetDescriptiveText() const;
  47. virtual bool HandleSearchFieldSearchHit() ;
  48. virtual bool HandleSearchFieldCancelHit() ;
  49. wxSearchWidgetImpl * GetSearchPeer() const;
  50. protected:
  51. wxSize DoGetBestSize() const;
  52. void Init();
  53. wxMenu *m_menu;
  54. wxString m_descriptiveText;
  55. private:
  56. DECLARE_DYNAMIC_CLASS(wxSearchCtrl)
  57. DECLARE_EVENT_TABLE()
  58. };
  59. #endif // wxUSE_SEARCHCTRL
  60. #endif // _WX_SEARCHCTRL_H_