%{
#include "helpers.h"
#include "pyistream.h"
-#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/caret.h>
#include <wx/tipdlg.h>
#include <wx/mimetype.h>
#include <wx/snglinst.h>
#include <wx/effects.h>
-//#include <wx/spawnbrowser.h>
+#include <wx/sysopt.h>
%}
//----------------------------------------------------------------------
wxWindow *parent = NULL,
int x = -1, int y = -1);
+// TODO: wxFileSelectorEx
+
+
// Ask for filename to load
wxString wxLoadFileSelector(const wxString& what,
const wxString& extension,
#ifdef __WXMSW__
bool wxCheckForInterrupt(wxWindow *wnd);
-void wxFlushEvents();
+// link error? void wxFlushEvents();
#endif
wxWindow* wxGetTopLevelParent(wxWindow *win);
+class wxSystemOptions : public wxObject
+{
+public:
+ wxSystemOptions() { }
+
+ // User-customizable hints to wxWindows or associated libraries
+ // These could also be used to influence GetSystem... calls, indeed
+ // to implement SetSystemColour/Font/Metric
+
+ static void SetOption(const wxString& name, const wxString& value);
+ %name(SetOptionInt)static void SetOption(const wxString& name, int value);
+ static wxString GetOption(const wxString& name) ;
+ static int GetOptionInt(const wxString& name) ;
+ static bool HasOption(const wxString& name) ;
+};
+
+
//---------------------------------------------------------------------------
// wxToolTip
void SetSize(const wxSize& size);
void Show(int show = TRUE);
void Hide();
+
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
};
%inline %{
bool IsOneShot();
bool IsRunning();
void SetOwner(wxEvtHandler *owner, int id = -1);
- void Start(int milliseconds=-1, int oneShot=FALSE);
+ bool Start(int milliseconds=-1, int oneShot=FALSE);
void Stop();
};
static void OnLog(unsigned long level, const wxString& szString, int t=0);
virtual void Flush();
- bool HasPendingMessages() const;
-
static void FlushActive();
static wxLog *GetActiveTarget();
static wxLog *SetActiveTarget(wxLog *pLogger);
bool SetCapture(wxWindow* win, int pollingFreq = 0);
bool ReleaseCapture();
+
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
};
//----------------------------------------------------------------------
class wxWave : public wxObject
{
public:
- wxWave(const wxString& fileName, bool isResource = FALSE);
- ~wxWave();
+ wxWave(const wxString& fileName, bool isResource = FALSE);
+ ~wxWave();
+
+ bool IsOk() const;
+ bool Play(bool async = TRUE, bool looped = FALSE) const;
- bool IsOk() const;
- bool Play(bool async = TRUE, bool looped = FALSE) const;
+ %pragma(python) addtoclass = "def __nonzero__(self): return self.IsOk()"
};
%new wxWave* wxWaveData(const wxString& data);
%addmethods {
// Get the icon corresponding to this file type
%new wxIcon* GetIcon() {
- wxIcon icon;
- if (self->GetIcon(&icon))
- return new wxIcon(icon);
+ wxIconLocation loc;
+ if (self->GetIcon(&loc))
+ return new wxIcon(loc);
else
return NULL;
}
// Get the icon corresponding to this file type, the name of the file
// where this icon resides, and its index in this file if applicable.
PyObject* GetIconInfo() {
- wxIcon icon;
- wxString iconFile;
- int iconIndex;
- if (self->GetIcon(&icon, &iconFile, &iconIndex)) {
+ wxIconLocation loc;
+ if (self->GetIcon(&loc)) {
+ wxString iconFile = loc.GetFileName();
+ int iconIndex = -1;
+#ifdef __WXMSW__
+ iconIndex = loc.GetIndex();
+#endif
+ // Make a tuple and put the values in it
wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(3);
- PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
- wxT("wxIcon"), TRUE));
+ PyTuple_SetItem(tuple, 0,
+ wxPyConstructObject(new wxIcon(loc), wxT("wxIcon"), TRUE));
#if wxUSE_UNICODE
PyTuple_SetItem(tuple, 1, PyUnicode_FromWideChar(iconFile.c_str(), iconFile.Len()));
#else
//
// use the extraDir parameter if you want to look for files in another
// directory
- void Initialize(int mailcapStyle = wxMAILCAP_STANDARD,
+ void Initialize(int mailcapStyle = wxMAILCAP_ALL,
const wxString& extraDir = wxPyEmptyString);
// and this function clears all the data from the manager
%{
#if 0
%}
+// See also wxPy_ReinitStockObjects in helpers.cpp
extern wxMimeTypesManager* wxTheMimeTypesManager;
%{
#endif
wxART_QUESTION = 'wxART_QUESTION'
wxART_WARNING = 'wxART_WARNING'
wxART_INFORMATION = 'wxART_INFORMATION'
+wxART_MISSING_IMAGE = 'wxART_MISSING_IMAGE'
"
%{ // Python aware wxArtProvider
// Accessors
wxString GetHistoryFile(int i) const;
- // A synonym for GetNoHistoryFiles
int GetCount() const;
- int GetNoHistoryFiles() const;
+ %pragma(python) addtoclass = "GetNoHistoryFiles = GetCount"
};
//----------------------------------------------------------------------
-// %{
-// #if wxUSE_UNICODE
-// #define ADD_STRING(dict, str) \
-// wxString tmp##str(str); \
-// PyDict_SetItemString(dict, #str, \
-// PyUnicode_FromWideChar(tmp##str.c_str(), tmp##str.Len()))
-// #else
-// #define ADD_STRING(dict, str) \
-// PyDict_SetItemString(d, #str, PyString_FromString(str))
-// #endif
-// %}
-
-
%init %{
wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage");
wxPyPtrTypeMap_Add("wxProcess", "wxPyProcess");