menu attached.
-\membersection{wxSearchCtrl::SetSearchButtonVisible}\label{wxsearchctrlsetsearchbuttonvisible}
+\membersection{wxSearchCtrl::ShowSearchButton}\label{wxsearchctrlshowsearchbutton}
-\func{virtual void}{SetSearchButtonVisible}{\param{bool }{ show}}
+\func{virtual void}{ShowSearchButton}{\param{bool }{ show}}
Sets the search button visibility value on the search control.
If there is a menu attached, the search button will be visible regardless of the search
This has no effect in Mac OS X v10.3
-\membersection{wxSearchCtrl::GetSearchButtonVisible}\label{wxsearchctrlgetsearchbuttonvisible}
+\membersection{wxSearchCtrl::IsSearchButtonVisible}\label{wxsearchctrlissearchbuttonvisible}
-\func{virtual bool}{GetSearchButtonVisible}{\void}
+\func{virtual bool}{IsSearchButtonVisible}{\void}
Returns the search button visibility value.
If there is a menu attached, the search button will be visible regardless of the search
This always returns false in Mac OS X v10.3
-\membersection{wxSearchCtrl::SetCancelButtonVisible}\label{wxsearchctrlsetcancelbuttonvisible}
+\membersection{wxSearchCtrl::ShowCancelButton}\label{wxsearchctrlshowcancelbutton}
-\func{virtual void}{SetCancelButtonVisible}{\param{bool }{ show}}
+\func{virtual void}{ShowCancelButton}{\param{bool }{ show}}
Shows or hides the cancel button.
-\membersection{wxSearchCtrl::GetCancelButtonVisible}\label{wxsearchctrlgetcancelbuttonvisible}
+\membersection{wxSearchCtrl::IsCancelButtonVisible}\label{wxsearchctrliscancelbuttonvisible}
-\func{virtual bool}{GetCancelButtonVisible}{\void}
+\func{virtual bool}{IsCancelButtonVisible}{\void}
Indicates whether the cancel button is visible.
#if wxUSE_SEARCHCTRL
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma interface "srchctlg.h"
-#endif
-
#include "wx/bitmap.h"
-// ----------------------------------------------------------------------------
-
class WXDLLEXPORT wxSearchButton;
class WXDLLEXPORT wxSearchTextCtrl;
-class WXDLLEXPORT wxSearchCtrlBase : public wxTextCtrlBase
-{
-public:
- wxSearchCtrlBase() {}
- virtual ~wxSearchCtrlBase() {}
-
- // search control
- virtual void SetMenu( wxMenu* menu ) = 0;
- virtual wxMenu* GetMenu() = 0;
-
-
- // get/set options
- virtual void SetSearchButtonVisible( bool show ) = 0;
- virtual bool GetSearchButtonVisible() const = 0;
-
- virtual void SetCancelButtonVisible( bool show ) = 0;
- virtual bool GetCancelButtonVisible() const = 0;
-protected:
-};
-
// ----------------------------------------------------------------------------
// wxSearchCtrl is a combination of wxTextCtrl and wxSearchButton
// ----------------------------------------------------------------------------
// get/set search options
// ----------------------
- virtual void SetSearchButtonVisible( bool show );
- virtual bool GetSearchButtonVisible() const;
+ virtual void ShowSearchButton( bool show );
+ virtual bool IsSearchButtonVisible() const;
- virtual void SetCancelButtonVisible( bool show );
- virtual bool GetCancelButtonVisible() const;
+ virtual void ShowCancelButton( bool show );
+ virtual bool IsCancelButtonVisible() const;
// accessors
// ---------
#if wxUSE_SEARCHCTRL
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma interface "srchctrl.h"
-#endif
-
-class WXDLLEXPORT wxSearchCtrlBase : public wxTextCtrl
-{
-public:
- wxSearchCtrlBase() {}
- virtual ~wxSearchCtrlBase() {}
-
- // search control
- virtual void SetMenu( wxMenu* menu ) = 0;
- virtual wxMenu* GetMenu() = 0;
-
-
- // get/set options
- virtual void SetSearchButtonVisible( bool show ) = 0;
- virtual bool GetSearchButtonVisible() const = 0;
-
- virtual void SetCancelButtonVisible( bool show ) = 0;
- virtual bool GetCancelButtonVisible() const = 0;
-protected:
-};
-
class wxMacSearchFieldControl;
class WXDLLEXPORT wxSearchCtrl : public wxSearchCtrlBase
// get/set search options
// ----------------------
- virtual void SetSearchButtonVisible( bool show );
- virtual bool GetSearchButtonVisible() const;
+ virtual void ShowSearchButton( bool show );
+ virtual bool IsSearchButtonVisible() const;
- virtual void SetCancelButtonVisible( bool show );
- virtual bool GetCancelButtonVisible() const;
+ virtual void ShowCancelButton( bool show );
+ virtual bool IsCancelButtonVisible() const;
virtual wxInt32 MacSearchFieldSearchHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
virtual wxInt32 MacSearchFieldCancelHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
#include "wx/textctrl.h"
+#if !defined(__WXUNIVERSAL__) && defined(__WXMAC__) && defined(__WXMAC_OSX__) \
+ && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
+ // search control was introduced in Mac OS X 10.3 Panther
+ #define wxUSE_NATIVE_SEARCH_CONTROL 1
+
+ #define wxSearchCtrlBaseBaseClass wxTextCtrl
+#else
+ // no native version, use the generic one
+ #define wxUSE_NATIVE_SEARCH_CONTROL 0
+
+ #define wxSearchCtrlBaseBaseClass wxTextCtrlBase
+#endif
+
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// it is based on the MacOSX 10.3 control HISearchFieldCreate
// ----------------------------------------------------------------------------
-// include the platform-dependent class implementation
-#if !defined(__WXUNIVERSAL__) && defined(__WXMAC__) && defined(__WXMAC_OSX__) \
- && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
- // search control was introduced in Mac OS X 10.3 Panther
- #define wxUSE_NATIVE_SEARCH_CONTROL 1
-#else
- // no native version, use the generic one
- #define wxUSE_NATIVE_SEARCH_CONTROL 0
-#endif
+class WXDLLEXPORT wxSearchCtrlBase : public wxSearchCtrlBaseBaseClass
+{
+public:
+ wxSearchCtrlBase() { }
+ virtual ~wxSearchCtrlBase() { }
+
+ // search control
+ virtual void SetMenu(wxMenu *menu) = 0;
+ virtual wxMenu *GetMenu() = 0;
+
+ // get/set options
+ virtual void ShowSearchButton( bool show ) = 0;
+ virtual bool IsSearchButtonVisible() const = 0;
+ virtual void ShowCancelButton( bool show ) = 0;
+ virtual bool IsCancelButtonVisible() const = 0;
+};
+
+
+// include the platform-dependent class implementation
#if wxUSE_NATIVE_SEARCH_CONTROL
#if defined(__WXMAC__)
#include "wx/mac/srchctrl.h"
void SearchCtrlWidgetsPage::OnToggleSearchButton(wxCommandEvent&)
{
- m_srchCtrl->SetSearchButtonVisible( m_searchBtnCheck->GetValue() );
+ m_srchCtrl->ShowSearchButton( m_searchBtnCheck->GetValue() );
}
void SearchCtrlWidgetsPage::OnToggleCancelButton(wxCommandEvent&)
{
- m_srchCtrl->SetCancelButtonVisible( m_cancelBtnCheck->GetValue() );
+ m_srchCtrl->ShowCancelButton( m_cancelBtnCheck->GetValue() );
}
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "srchctlg.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
return m_menu;
}
-void wxSearchCtrl::SetSearchButtonVisible( bool show )
+void wxSearchCtrl::ShowSearchButton( bool show )
{
if ( m_searchButtonVisible == show )
{
LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight());
}
-bool wxSearchCtrl::GetSearchButtonVisible() const
+bool wxSearchCtrl::IsSearchButtonVisible() const
{
return m_searchButtonVisible;
}
-void wxSearchCtrl::SetCancelButtonVisible( bool show )
+void wxSearchCtrl::ShowCancelButton( bool show )
{
if ( m_cancelButtonVisible == show )
{
LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight());
}
-bool wxSearchCtrl::GetCancelButtonVisible() const
+bool wxSearchCtrl::IsCancelButtonVisible() const
{
return m_cancelButtonVisible;
}
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "srchctrl.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
}
// search field options
- virtual void SetSearchButtonVisible( bool show );
- virtual bool GetSearchButtonVisible() const;
+ virtual void ShowSearchButton( bool show );
+ virtual bool IsSearchButtonVisible() const;
- virtual void SetCancelButtonVisible( bool show );
- virtual bool GetCancelButtonVisible() const;
+ virtual void ShowCancelButton( bool show );
+ virtual bool IsCancelButtonVisible() const;
virtual void SetSearchMenu( wxMenu* menu );
virtual wxMenu* GetSearchMenu() const;
OptionBits attributes = 0;
if ( UMAGetSystemVersion() >= 0x1040 )
{
- attributes = kHISearchFieldAttributesSearchIcon;
- }
+ attributes = kHISearchFieldAttributesSearchIcon;
+ }
HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } };
verify_noerr( HISearchFieldCreate(
&hibounds,