X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b37c7e1dcdad16c20d9800d2abaf53cc6b653a64..922ba68045d84789ab1dfceb4d1aa1b6e2c5e810:/wxPython/src/misc2.i diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 1538501710..1e11812c29 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -46,6 +46,7 @@ %import gdi.i %import events.i %import streams.i +%import utils.i %{ static wxString wxPyEmptyStr(""); @@ -346,8 +347,8 @@ IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEnc public: wxPyFontEnumerator(); ~wxPyFontEnumerator(); - void _setCallbackInfo(PyObject* self, PyObject* _class); - %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxFontEnumerator)" + void _setCallbackInfo(PyObject* self, PyObject* _class, bool incref); + %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxFontEnumerator, 0)" bool EnumerateFacenames( wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all @@ -359,12 +360,12 @@ public: %addmethods { PyObject* GetEncodings() { wxArrayString* arr = self->GetEncodings(); - return wxArrayString2PyList_helper(arr); + return wxArrayString2PyList_helper(*arr); } PyObject* GetFacenames() { wxArrayString* arr = self->GetFacenames(); - return wxArrayString2PyList_helper(arr); + return wxArrayString2PyList_helper(*arr); } } }; @@ -409,7 +410,11 @@ public: %inline %{ bool wxThread_IsMain() { +#ifdef WXP_WITH_THREAD return wxThread::IsMain(); +#else + return TRUE; +#endif } %} @@ -1277,6 +1282,42 @@ extern wxMimeTypesManager* wxTheMimeTypesManager; %} %readwrite +//---------------------------------------------------------------------- + +%{ +#include +%} + +class wxFileHistory : public wxObject +{ +public: + wxFileHistory(int maxFiles = 9); + ~wxFileHistory(); + + // Operations + void AddFileToHistory(const wxString& file); + void RemoveFileFromHistory(int i); + int GetMaxFiles() const; + void UseMenu(wxMenu *menu); + + // Remove menu from the list (MDI child may be closing) + void RemoveMenu(wxMenu *menu); + + void Load(wxConfigBase& config); + void Save(wxConfigBase& config); + + void AddFilesToMenu(); + %name(AddFilesToSingleMenu)void AddFilesToMenu(wxMenu* menu); + + // Accessors + wxString GetHistoryFile(int i) const; + + // A synonym for GetNoHistoryFiles + int GetCount() const; + int GetNoHistoryFiles() const; + +}; + //---------------------------------------------------------------------- //----------------------------------------------------------------------