Modified form of Patch #1611222, adds wxSearchCtrl (generic & native carbon HISearchField)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
99
wxPython/src/_srchctrl.i
Normal file
99
wxPython/src/_srchctrl.i
Normal file
@@ -0,0 +1,99 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: _srchctrl.i
|
||||
// Purpose: SWIG interface for wxSearchCtrl
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 9-Dec-2006
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2006 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Not a %module
|
||||
|
||||
%{
|
||||
#include <wx/srchctrl.h>
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%newgroup
|
||||
|
||||
MAKE_CONST_WXSTRING(SearchCtrlNameStr);
|
||||
|
||||
|
||||
MustHaveApp(wxSearchCtrl);
|
||||
|
||||
|
||||
class wxSearchCtrl : public wxTextCtrl
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxSearchCtrl "self._setOORInfo(self)";
|
||||
%pythonAppend wxSearchCtrl() "";
|
||||
|
||||
wxSearchCtrl(wxWindow *parent, wxWindowID id=-1,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPySearchCtrlNameStr);
|
||||
|
||||
DocCtorStrName(
|
||||
wxSearchCtrl(),
|
||||
"Precreate a wx.SearchCtrl for 2-phase creation.", "",
|
||||
PreSearchCtrl);
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id=-1,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPySearchCtrlNameStr);
|
||||
|
||||
|
||||
// get/set search button menu
|
||||
// --------------------------
|
||||
virtual void SetMenu( wxMenu* menu );
|
||||
virtual wxMenu* GetMenu();
|
||||
|
||||
// get/set search options
|
||||
// ----------------------
|
||||
virtual void SetSearchButtonVisible( bool show );
|
||||
virtual bool GetSearchButtonVisible() const;
|
||||
|
||||
virtual void SetCancelButtonVisible( bool show );
|
||||
virtual bool GetCancelButtonVisible() const;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
%extend {
|
||||
void SetSearchBitmap( const wxBitmap& ) {}
|
||||
void SetSearchMenuBitmap( const wxBitmap& ) {}
|
||||
void SetCancelBitmap( const wxBitmap& ) {}
|
||||
}
|
||||
#else
|
||||
void SetSearchBitmap( const wxBitmap& bitmap );
|
||||
void SetSearchMenuBitmap( const wxBitmap& bitmap );
|
||||
void SetCancelBitmap( const wxBitmap& bitmap );
|
||||
#endif
|
||||
|
||||
|
||||
%property(Menu, GetMenu, SetMenu);
|
||||
%property(SearchButtonVisible, GetSearchButtonVisible, SetSearchButtonVisible);
|
||||
%property(CancelButtonVisible, GetCancelButtonVisible, SetCancelButtonVisible);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_CANCEL;
|
||||
%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_SEARCH;
|
||||
|
||||
%pythoncode {
|
||||
EVT_SEARCHCTRL_CANCEL = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL, 1)
|
||||
EVT_SEARCHCTRL_SEARCH = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH, 1)
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user