X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6eacb2570419a4ab5f9ac6aefcac61c37bc548f..9fd9e47a93dfcdd99c2722e288a0f28a51ce6f5f:/wxPython/src/misc2.i?ds=sidebyside diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 4da32debd9..eb1c5a8eb0 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -56,7 +55,7 @@ // Put some wx default wxChar* values into wxStrings. DECLARE_DEF_STRING(FileSelectorPromptStr); DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); - + DECLARE_DEF_STRING(DirSelectorPromptStr); static const wxString wxPyEmptyString(wxT("")); %} @@ -84,6 +83,13 @@ wxString wxSaveFileSelector(const wxString& what, const wxString& default_name = wxPyEmptyString, wxWindow *parent = NULL); + +wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr, + const wxString& defaultPath = wxPyEmptyString, + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON, + const wxPoint& pos = wxDefaultPosition, + wxWindow *parent = NULL); + wxString wxGetTextFromUser(const wxString& message, const wxString& caption = wxPyEmptyString, const wxString& default_value = wxPyEmptyString, @@ -365,52 +371,6 @@ public: //---------------------------------------------------------------------- -%{ -class wxPyFontEnumerator : public wxFontEnumerator { -public: - wxPyFontEnumerator() {} - ~wxPyFontEnumerator() {} - - DEC_PYCALLBACK_BOOL_STRING(OnFacename); - DEC_PYCALLBACK_BOOL_STRINGSTRING(OnFontEncoding); - - PYPRIVATE; -}; - -IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFacename); -IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding); - -%} - -%name(wxFontEnumerator) class wxPyFontEnumerator { -public: - wxPyFontEnumerator(); - ~wxPyFontEnumerator(); - void _setCallbackInfo(PyObject* self, PyObject* _class, bool incref); - %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxFontEnumerator, 0)" - - bool EnumerateFacenames( - wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all - bool fixedWidthOnly = FALSE); - bool EnumerateEncodings(const wxString& facename = wxPyEmptyString); - - //wxArrayString* GetEncodings(); - //wxArrayString* GetFacenames(); - %addmethods { - PyObject* GetEncodings() { - wxArrayString* arr = self->GetEncodings(); - return wxArrayString2PyList_helper(*arr); - } - - PyObject* GetFacenames() { - wxArrayString* arr = self->GetFacenames(); - return wxArrayString2PyList_helper(*arr); - } - } -}; - -//---------------------------------------------------------------------- - class wxBusyCursor { public: wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR); @@ -619,7 +579,7 @@ public: static void SetTimestamp(const wxString& ts); static const wxString& GetTimestamp(); - bool GetVerbose() const { return m_bVerbose; } + bool GetVerbose() const; static wxTraceMask GetTraceMask(); static bool IsAllowedTraceMask(const wxString& mask); @@ -672,14 +632,6 @@ public: }; -class wxLogNull -{ -public: - wxLogNull(); - ~wxLogNull(); -}; - - class wxLogChain : public wxLog { public: @@ -703,9 +655,19 @@ void wxLogStatus(const wxString& szFormat); %name(wxLogStatusFrame)void wxLogStatus(wxFrame *pFrame, const wxString& szFormat); void wxLogSysError(const wxString& szFormat); +// Suspress logging while an instance of this class exists +class wxLogNull +{ +public: + wxLogNull(); + ~wxLogNull(); +}; + + + %{ -// A Log class that can be derived from in wxPython +// A wxLog class that can be derived from in wxPython class wxPyLog : public wxLog { public: wxPyLog() : wxLog() {} @@ -1388,7 +1350,7 @@ public: void Save(wxConfigBase& config); void AddFilesToMenu(); - %name(AddFilesToSingleMenu)void AddFilesToMenu(wxMenu* menu); + %name(AddFilesToThisMenu)void AddFilesToMenu(wxMenu* menu); // Accessors wxString GetHistoryFile(int i) const; @@ -1404,7 +1366,6 @@ public: %init %{ - wxPyPtrTypeMap_Add("wxFontEnumerator", "wxPyFontEnumerator"); wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage"); wxPyPtrTypeMap_Add("wxProcess", "wxPyProcess"); %}