wxPython stuff:

1. Added test for HTML printing
  2. Update wxFontEnumerator
  3. wxPyEvent and wxPyCommandEvent derived classes now return the
     actual Python object in the event handler.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-11-07 07:49:09 +00:00
parent e4a330f1e5
commit 65dd82cbce
33 changed files with 611 additions and 321 deletions

View File

@@ -66,10 +66,10 @@ PyObject* __wxSetDictionary(PyObject*, PyObject* args);
void wxPyEventThunker(wxObject*, wxEvent& event);
HELPEREXPORT PyObject* wxPyConstructObject(void* ptr, char* className);
HELPEREXPORT PyObject* wxPyConstructObject(void* ptr, const char* className);
HELPEREXPORT bool wxPyRestoreThread();
HELPEREXPORT void wxPySaveThread(bool doSave);
HELPEREXPORT PyObject* wxPy_ConvertList(wxListBase* list, char* className);
HELPEREXPORT PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
//----------------------------------------------------------------------
// These are helpers used by the typemaps
@@ -182,6 +182,46 @@ private:
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// These classes can be derived from in Python and passed through the event
// system without loosing anything. They do this by keeping a reference to
// themselves and some special case handling in wxPyCallback::EventThunker.
class wxPySelfRef {
public:
wxPySelfRef();
~wxPySelfRef();
void SetSelf(PyObject* self, bool clone=FALSE);
PyObject* GetSelf() const;
protected:
PyObject* m_self;
bool m_cloned;
};
class wxPyEvent : public wxEvent, public wxPySelfRef {
DECLARE_DYNAMIC_CLASS(wxPyEvent)
public:
wxPyEvent(int id=0);
~wxPyEvent();
void CopyObject(wxObject& dest) const;
};
class wxPyCommandEvent : public wxCommandEvent, public wxPySelfRef {
DECLARE_DYNAMIC_CLASS(wxPyCommandEvent)
public:
wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0);
~wxPyCommandEvent();
void CopyObject(wxObject& dest) const;
};
//---------------------------------------------------------------------------
// These macros are used to implement the virtual methods that should