From 76fa8a9b108050c62ad09c5ee01b7fdd433bb7e0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 15 Jan 2004 17:43:36 +0000 Subject: [PATCH] Move wxPyTreeCtrl declaration to header file git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@25189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/controls.i | 2 ++ wxPython/src/controls2.i | 73 +++++++--------------------------------- wxPython/src/html.i | 10 ++++++ wxPython/src/misc2.i | 8 +++-- wxPython/src/pytree.h | 66 ++++++++++++++++++++++++++++++++++++ 5 files changed, 96 insertions(+), 63 deletions(-) diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index e6a0fbbf63..2932899b86 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -1134,6 +1134,8 @@ public: int GetValue(); void SetRange(int min, int max); void SetValue(int value); + %name(SetValueString) void SetValue(const wxString& text); + #ifdef __WXGTK__ %addmethods { void SetSelection(long from, long to) { diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index a0368dbc64..5c9208f07f 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -17,12 +17,11 @@ #ifdef __WXMSW__ #include #endif -#include -#include -#include -#include #include "pytree.h" + +#include +#include %} //---------------------------------------------------------------------- @@ -378,35 +377,9 @@ public: }; -%{ // C++ Version of a Python aware class -class wxPyListCtrl : public wxListCtrl { - DECLARE_ABSTRACT_CLASS(wxPyListCtrl); -public: - wxPyListCtrl() : wxListCtrl() {} - wxPyListCtrl(wxWindow* parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) : - wxListCtrl(parent, id, pos, size, style, validator, name) {} - - bool Create(wxWindow* parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) { - return wxListCtrl::Create(parent, id, pos, size, style, validator, name); - } - - DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText); - DEC_PYCALLBACK_INT_LONG(OnGetItemImage); - DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr); - - PYPRIVATE; -}; - +%{ +// See declaration in pytree.h + IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl); IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText); @@ -1058,31 +1031,13 @@ public: -%{ // C++ version of Python aware wxTreeCtrl -class wxPyTreeCtrl : public wxTreeCtrl { - DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl); -public: - wxPyTreeCtrl() : wxTreeCtrl() {} - wxPyTreeCtrl(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) : - wxTreeCtrl(parent, id, pos, size, style, validator, name) {} +%{ // See class def in pytree.h - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) { - return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name); - } +IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl); - - int OnCompareItems(const wxTreeItemId& item1, - const wxTreeItemId& item2) { +int wxPyTreeCtrl::OnCompareItems(const wxTreeItemId& item1, + const wxTreeItemId& item2) + { int rval = 0; bool found; wxPyBeginBlockThreads(); @@ -1098,11 +1053,7 @@ public: rval = wxTreeCtrl::OnCompareItems(item1, item2); return rval; } - PYPRIVATE; -}; - -IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl); - + %} // These are for the GetFirstChild/GetNextChild methods below diff --git a/wxPython/src/html.i b/wxPython/src/html.i index c462f8fbdd..8e15e908ce 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -89,6 +89,14 @@ enum { wxHTML_COND_ISANCHOR, wxHTML_COND_ISIMAGEMAP, wxHTML_COND_USER, + + wxHTML_FONT_SIZE_1, + wxHTML_FONT_SIZE_2, + wxHTML_FONT_SIZE_3, + wxHTML_FONT_SIZE_4, + wxHTML_FONT_SIZE_5, + wxHTML_FONT_SIZE_6, + wxHTML_FONT_SIZE_7, }; @@ -378,6 +386,8 @@ public: int GetWidth(); int GetHeight(); int GetDescent(); + const wxString& GetId() const; + void SetId(const wxString& id); wxHtmlLinkInfo* GetLink(int x = 0, int y = 0); wxHtmlCell* GetNext(); wxHtmlContainerCell* GetParent(); diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 92c58de35a..e36008e533 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -17,6 +17,8 @@ %{ #include "helpers.h" #include "pyistream.h" +#include "pytree.h" + #include #include #include @@ -35,6 +37,8 @@ #include #include //#include + + %} //---------------------------------------------------------------------- @@ -504,8 +508,8 @@ public: const wxCursor& cursor = wxNullCursor); %name(wxDragString)wxGenericDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor); - %name(wxDragTreeItem)wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id); - %name(wxDragListItem)wxGenericDragImage(const wxListCtrl& listCtrl, long id); + %name(wxDragTreeItem)wxGenericDragImage(const wxPyTreeCtrl& treeCtrl, wxTreeItemId& id); + %name(wxDragListItem)wxGenericDragImage(const wxPyListCtrl& listCtrl, long id); ~wxGenericDragImage(); diff --git a/wxPython/src/pytree.h b/wxPython/src/pytree.h index dc178a7278..96cb8a620b 100644 --- a/wxPython/src/pytree.h +++ b/wxPython/src/pytree.h @@ -12,6 +12,71 @@ ///////////////////////////////////////////////////////////////////////////// +#ifndef __pytree_h__ +#define __pytree_h__ + +#include +#include + + +class wxPyListCtrl : public wxListCtrl { + DECLARE_ABSTRACT_CLASS(wxPyListCtrl); +public: + wxPyListCtrl() : wxListCtrl() {} + wxPyListCtrl(wxWindow* parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) : + wxListCtrl(parent, id, pos, size, style, validator, name) {} + + bool Create(wxWindow* parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) { + return wxListCtrl::Create(parent, id, pos, size, style, validator, name); + } + + DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText); + DEC_PYCALLBACK_INT_LONG(OnGetItemImage); + DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr); + + PYPRIVATE; +}; + + + + +class wxPyTreeCtrl : public wxTreeCtrl { + DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl); +public: + wxPyTreeCtrl() : wxTreeCtrl() {} + wxPyTreeCtrl(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) : + wxTreeCtrl(parent, id, pos, size, style, validator, name) {} + + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) { + return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name); + } + + + int OnCompareItems(const wxTreeItemId& item1, + const wxTreeItemId& item2); + + PYPRIVATE; +}; class wxPyTreeItemData : public wxTreeItemData { @@ -45,3 +110,4 @@ public: PyObject* m_obj; }; +#endif