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
This commit is contained in:
@@ -1134,6 +1134,8 @@ public:
|
|||||||
int GetValue();
|
int GetValue();
|
||||||
void SetRange(int min, int max);
|
void SetRange(int min, int max);
|
||||||
void SetValue(int value);
|
void SetValue(int value);
|
||||||
|
%name(SetValueString) void SetValue(const wxString& text);
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
%addmethods {
|
%addmethods {
|
||||||
void SetSelection(long from, long to) {
|
void SetSelection(long from, long to) {
|
||||||
|
@@ -17,12 +17,11 @@
|
|||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <wx/listctrl.h>
|
|
||||||
#include <wx/treectrl.h>
|
|
||||||
#include <wx/imaglist.h>
|
|
||||||
#include <wx/dirctrl.h>
|
|
||||||
|
|
||||||
#include "pytree.h"
|
#include "pytree.h"
|
||||||
|
|
||||||
|
#include <wx/imaglist.h>
|
||||||
|
#include <wx/dirctrl.h>
|
||||||
%}
|
%}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -378,35 +377,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
%{ // C++ Version of a Python aware class
|
%{
|
||||||
class wxPyListCtrl : public wxListCtrl {
|
// See declaration in pytree.h
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl);
|
IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl);
|
||||||
|
|
||||||
IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText);
|
IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText);
|
||||||
@@ -1058,31 +1031,13 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
%{ // C++ version of Python aware wxTreeCtrl
|
%{ // See class def in pytree.h
|
||||||
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,
|
IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
|
||||||
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 wxPyTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
|
||||||
int OnCompareItems(const wxTreeItemId& item1,
|
const wxTreeItemId& item2)
|
||||||
const wxTreeItemId& item2) {
|
{
|
||||||
int rval = 0;
|
int rval = 0;
|
||||||
bool found;
|
bool found;
|
||||||
wxPyBeginBlockThreads();
|
wxPyBeginBlockThreads();
|
||||||
@@ -1098,11 +1053,7 @@ public:
|
|||||||
rval = wxTreeCtrl::OnCompareItems(item1, item2);
|
rval = wxTreeCtrl::OnCompareItems(item1, item2);
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
PYPRIVATE;
|
|
||||||
};
|
|
||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
// These are for the GetFirstChild/GetNextChild methods below
|
// These are for the GetFirstChild/GetNextChild methods below
|
||||||
|
@@ -89,6 +89,14 @@ enum {
|
|||||||
wxHTML_COND_ISANCHOR,
|
wxHTML_COND_ISANCHOR,
|
||||||
wxHTML_COND_ISIMAGEMAP,
|
wxHTML_COND_ISIMAGEMAP,
|
||||||
wxHTML_COND_USER,
|
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 GetWidth();
|
||||||
int GetHeight();
|
int GetHeight();
|
||||||
int GetDescent();
|
int GetDescent();
|
||||||
|
const wxString& GetId() const;
|
||||||
|
void SetId(const wxString& id);
|
||||||
wxHtmlLinkInfo* GetLink(int x = 0, int y = 0);
|
wxHtmlLinkInfo* GetLink(int x = 0, int y = 0);
|
||||||
wxHtmlCell* GetNext();
|
wxHtmlCell* GetNext();
|
||||||
wxHtmlContainerCell* GetParent();
|
wxHtmlContainerCell* GetParent();
|
||||||
|
@@ -17,6 +17,8 @@
|
|||||||
%{
|
%{
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "pyistream.h"
|
#include "pyistream.h"
|
||||||
|
#include "pytree.h"
|
||||||
|
|
||||||
#include <wx/resource.h>
|
#include <wx/resource.h>
|
||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
#include <wx/caret.h>
|
#include <wx/caret.h>
|
||||||
@@ -35,6 +37,8 @@
|
|||||||
#include <wx/snglinst.h>
|
#include <wx/snglinst.h>
|
||||||
#include <wx/effects.h>
|
#include <wx/effects.h>
|
||||||
//#include <wx/spawnbrowser.h>
|
//#include <wx/spawnbrowser.h>
|
||||||
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -504,8 +508,8 @@ public:
|
|||||||
const wxCursor& cursor = wxNullCursor);
|
const wxCursor& cursor = wxNullCursor);
|
||||||
%name(wxDragString)wxGenericDragImage(const wxString& str,
|
%name(wxDragString)wxGenericDragImage(const wxString& str,
|
||||||
const wxCursor& cursor = wxNullCursor);
|
const wxCursor& cursor = wxNullCursor);
|
||||||
%name(wxDragTreeItem)wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
|
%name(wxDragTreeItem)wxGenericDragImage(const wxPyTreeCtrl& treeCtrl, wxTreeItemId& id);
|
||||||
%name(wxDragListItem)wxGenericDragImage(const wxListCtrl& listCtrl, long id);
|
%name(wxDragListItem)wxGenericDragImage(const wxPyListCtrl& listCtrl, long id);
|
||||||
|
|
||||||
~wxGenericDragImage();
|
~wxGenericDragImage();
|
||||||
|
|
||||||
|
@@ -12,6 +12,71 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __pytree_h__
|
||||||
|
#define __pytree_h__
|
||||||
|
|
||||||
|
#include <wx/listctrl.h>
|
||||||
|
#include <wx/treectrl.h>
|
||||||
|
|
||||||
|
|
||||||
|
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 {
|
class wxPyTreeItemData : public wxTreeItemData {
|
||||||
@@ -45,3 +110,4 @@ public:
|
|||||||
PyObject* m_obj;
|
PyObject* m_obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user