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();
|
||||
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) {
|
||||
|
@@ -17,12 +17,11 @@
|
||||
#ifdef __WXMSW__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/treectrl.h>
|
||||
#include <wx/imaglist.h>
|
||||
#include <wx/dirctrl.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 {
|
||||
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
|
||||
|
@@ -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();
|
||||
|
@@ -17,6 +17,8 @@
|
||||
%{
|
||||
#include "helpers.h"
|
||||
#include "pyistream.h"
|
||||
#include "pytree.h"
|
||||
|
||||
#include <wx/resource.h>
|
||||
#include <wx/tooltip.h>
|
||||
#include <wx/caret.h>
|
||||
@@ -35,6 +37,8 @@
|
||||
#include <wx/snglinst.h>
|
||||
#include <wx/effects.h>
|
||||
//#include <wx/spawnbrowser.h>
|
||||
|
||||
|
||||
%}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -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();
|
||||
|
||||
|
@@ -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 {
|
||||
@@ -45,3 +110,4 @@ public:
|
||||
PyObject* m_obj;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user