1. Renamed Set/GetXXXVisible() to ShowXXX() and IsXXXVisible()

2. Moved wxSearchCtrlBase to wx/srchctrl.h to avoid duplicating it
3. Removed gcc #pragmas


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-12-11 13:48:18 +00:00
parent 8138b9a4e2
commit ec184e3242
7 changed files with 60 additions and 95 deletions

View File

@@ -14,37 +14,11 @@
#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
// ----------------------------------------------------------------------------
@@ -81,11 +55,11 @@ public:
// 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
// ---------

View File

@@ -14,30 +14,6 @@
#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
@@ -72,11 +48,11 @@ public:
// 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 ) ;

View File

@@ -18,6 +18,19 @@
#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
// ----------------------------------------------------------------------------
@@ -34,16 +47,26 @@ END_DECLARE_EVENT_TYPES()
// 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"