wxTreeCtrl now works (sort of) for wxPython-GTK. This is the new

TreeCtrl in src/gtk/treectrl.cpp not the old generic one.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 1998-11-11 04:40:53 +00:00
parent 630d84f26f
commit 60e05667cb
6 changed files with 2194 additions and 24 deletions

View File

@ -80,20 +80,12 @@ public:
class wxListCtrl : public wxControl {
public:
#ifdef __WXMSW__
wxListCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listCtrl");
#else
wxListCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize,
long style = wxLC_ICON,
char* name = "listctrl");
#endif
%pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
@ -189,16 +181,16 @@ public:
//----------------------------------------------------------------------
#ifdef __WXMSW__
//#ifdef __WXMSW__
class wxTreeItemId {
public:
wxTreeItemId();
~wxTreeItemId();
bool IsOk() const { return m_itemId != 0; }
%addmethods {
long GetId() { return (long)(*self); }
}
// %addmethods {
// long GetId() { return (long)(*self); }
// }
};
@ -315,13 +307,13 @@ public:
wxTextCtrl* GetEditControl();
void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE);
void SortChildren(const wxTreeItemId& item);
// void SortChildren(const wxTreeItemId& item);
// **** And this too
// wxTreeItemCmpFunc *cmpFunction = NULL);
};
#endif
//#endif
//----------------------------------------------------------------------
@ -383,7 +375,12 @@ public:
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
// Revision 1.8 1998/11/11 04:40:20 RD
// wxTreeCtrl now works (sort of) for wxPython-GTK. This is the new
// TreeCtrl in src/gtk/treectrl.cpp not the old generic one.
//
// Revision 1.7 1998/11/11 03:12:25 RD
//
// Additions for wxTreeCtrl
//
// Revision 1.6 1998/10/20 06:43:55 RD

File diff suppressed because it is too large Load Diff

View File

@ -293,6 +293,286 @@ class wxListCtrl(wxListCtrlPtr):
class wxTreeItemIdPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self):
if self.thisown == 1 :
controls2c.delete_wxTreeItemId(self.this)
def IsOk(self):
val = controls2c.wxTreeItemId_IsOk(self.this)
return val
def __repr__(self):
return "<C wxTreeItemId instance>"
class wxTreeItemId(wxTreeItemIdPtr):
def __init__(self) :
self.this = controls2c.new_wxTreeItemId()
self.thisown = 1
class wxTreeItemDataPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self):
if self.thisown == 1 :
controls2c.delete_wxTreeItemData(self.this)
def GetId(self):
val = controls2c.wxTreeItemData_GetId(self.this)
val = wxTreeItemIdPtr(val)
return val
def SetId(self,arg0):
val = controls2c.wxTreeItemData_SetId(self.this,arg0.this)
return val
def __repr__(self):
return "<C wxTreeItemData instance>"
class wxTreeItemData(wxTreeItemDataPtr):
def __init__(self) :
self.this = controls2c.new_wxTreeItemData()
self.thisown = 1
class wxTreeEventPtr(wxCommandEventPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def GetItem(self):
val = controls2c.wxTreeEvent_GetItem(self.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetOldItem(self):
val = controls2c.wxTreeEvent_GetOldItem(self.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetPoint(self):
val = controls2c.wxTreeEvent_GetPoint(self.this)
val = wxPointPtr(val)
val.thisown = 1
return val
def GetCode(self):
val = controls2c.wxTreeEvent_GetCode(self.this)
return val
def Veto(self):
val = controls2c.wxTreeEvent_Veto(self.this)
return val
def __repr__(self):
return "<C wxTreeEvent instance>"
class wxTreeEvent(wxTreeEventPtr):
def __init__(self,this):
self.this = this
class wxTreeCtrlPtr(wxControlPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def GetCount(self):
val = controls2c.wxTreeCtrl_GetCount(self.this)
return val
def GetIndent(self):
val = controls2c.wxTreeCtrl_GetIndent(self.this)
return val
def SetIndent(self,arg0):
val = controls2c.wxTreeCtrl_SetIndent(self.this,arg0)
return val
def GetImageList(self):
val = controls2c.wxTreeCtrl_GetImageList(self.this)
return val
def GetStateImageList(self):
val = controls2c.wxTreeCtrl_GetStateImageList(self.this)
return val
def SetImageList(self,arg0):
val = controls2c.wxTreeCtrl_SetImageList(self.this,arg0)
return val
def SetStateImageList(self,arg0):
val = controls2c.wxTreeCtrl_SetStateImageList(self.this,arg0)
return val
def GetItemText(self,arg0):
val = controls2c.wxTreeCtrl_GetItemText(self.this,arg0.this)
return val
def GetItemImage(self,arg0):
val = controls2c.wxTreeCtrl_GetItemImage(self.this,arg0.this)
return val
def GetItemSelectedImage(self,arg0):
val = controls2c.wxTreeCtrl_GetItemSelectedImage(self.this,arg0.this)
return val
def GetItemData(self,arg0):
val = controls2c.wxTreeCtrl_GetItemData(self.this,arg0.this)
val = wxTreeItemDataPtr(val)
return val
def SetItemText(self,arg0,arg1):
val = controls2c.wxTreeCtrl_SetItemText(self.this,arg0.this,arg1)
return val
def SetItemImage(self,arg0,arg1):
val = controls2c.wxTreeCtrl_SetItemImage(self.this,arg0.this,arg1)
return val
def SetItemSelectedImage(self,arg0,arg1):
val = controls2c.wxTreeCtrl_SetItemSelectedImage(self.this,arg0.this,arg1)
return val
def SetItemData(self,arg0,arg1):
val = controls2c.wxTreeCtrl_SetItemData(self.this,arg0.this,arg1.this)
return val
def IsVisible(self,arg0):
val = controls2c.wxTreeCtrl_IsVisible(self.this,arg0.this)
return val
def ItemHasChildren(self,arg0):
val = controls2c.wxTreeCtrl_ItemHasChildren(self.this,arg0.this)
return val
def IsExpanded(self,arg0):
val = controls2c.wxTreeCtrl_IsExpanded(self.this,arg0.this)
return val
def IsSelected(self,arg0):
val = controls2c.wxTreeCtrl_IsSelected(self.this,arg0.this)
return val
def GetRootItem(self):
val = controls2c.wxTreeCtrl_GetRootItem(self.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetSelection(self):
val = controls2c.wxTreeCtrl_GetSelection(self.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetParent(self,arg0):
val = controls2c.wxTreeCtrl_GetParent(self.this,arg0.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetFirstChild(self,arg0,arg1):
val = controls2c.wxTreeCtrl_GetFirstChild(self.this,arg0.this,arg1)
return val
def GetNextChild(self,arg0,arg1):
val = controls2c.wxTreeCtrl_GetNextChild(self.this,arg0.this,arg1)
return val
def GetNextSibling(self,arg0):
val = controls2c.wxTreeCtrl_GetNextSibling(self.this,arg0.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetPrevSibling(self,arg0):
val = controls2c.wxTreeCtrl_GetPrevSibling(self.this,arg0.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetFirstVisibleItem(self):
val = controls2c.wxTreeCtrl_GetFirstVisibleItem(self.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetNextVisible(self,arg0):
val = controls2c.wxTreeCtrl_GetNextVisible(self.this,arg0.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def GetPrevVisible(self,arg0):
val = controls2c.wxTreeCtrl_GetPrevVisible(self.this,arg0.this)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def AddRoot(self,arg0,*args):
argl = map(None,args)
try: argl[2] = argl[2].this
except: pass
args = tuple(argl)
val = apply(controls2c.wxTreeCtrl_AddRoot,(self.this,arg0,)+args)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def PrependItem(self,arg0,arg1,*args):
argl = map(None,args)
try: argl[2] = argl[2].this
except: pass
args = tuple(argl)
val = apply(controls2c.wxTreeCtrl_PrependItem,(self.this,arg0.this,arg1,)+args)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def InsertItem(self,arg0,arg1,arg2,*args):
argl = map(None,args)
try: argl[2] = argl[2].this
except: pass
args = tuple(argl)
val = apply(controls2c.wxTreeCtrl_InsertItem,(self.this,arg0.this,arg1.this,arg2,)+args)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def AppendItem(self,arg0,arg1,*args):
argl = map(None,args)
try: argl[2] = argl[2].this
except: pass
args = tuple(argl)
val = apply(controls2c.wxTreeCtrl_AppendItem,(self.this,arg0.this,arg1,)+args)
val = wxTreeItemIdPtr(val)
val.thisown = 1
return val
def Delete(self,arg0):
val = controls2c.wxTreeCtrl_Delete(self.this,arg0.this)
return val
def DeleteAllItems(self):
val = controls2c.wxTreeCtrl_DeleteAllItems(self.this)
return val
def Expand(self,arg0):
val = controls2c.wxTreeCtrl_Expand(self.this,arg0.this)
return val
def Collapse(self,arg0):
val = controls2c.wxTreeCtrl_Collapse(self.this,arg0.this)
return val
def CollapseAndReset(self,arg0):
val = controls2c.wxTreeCtrl_CollapseAndReset(self.this,arg0.this)
return val
def Toggle(self,arg0):
val = controls2c.wxTreeCtrl_Toggle(self.this,arg0.this)
return val
def Unselect(self):
val = controls2c.wxTreeCtrl_Unselect(self.this)
return val
def SelectItem(self,arg0):
val = controls2c.wxTreeCtrl_SelectItem(self.this,arg0.this)
return val
def EnsureVisible(self,arg0):
val = controls2c.wxTreeCtrl_EnsureVisible(self.this,arg0.this)
return val
def ScrollTo(self,arg0):
val = controls2c.wxTreeCtrl_ScrollTo(self.this,arg0.this)
return val
def EditLabel(self,arg0):
val = controls2c.wxTreeCtrl_EditLabel(self.this,arg0.this)
val = wxTextCtrlPtr(val)
return val
def GetEditControl(self):
val = controls2c.wxTreeCtrl_GetEditControl(self.this)
val = wxTextCtrlPtr(val)
return val
def EndEditLabel(self,arg0,*args):
val = apply(controls2c.wxTreeCtrl_EndEditLabel,(self.this,arg0.this,)+args)
return val
def __repr__(self):
return "<C wxTreeCtrl instance>"
class wxTreeCtrl(wxTreeCtrlPtr):
def __init__(self,arg0,*args) :
argl = map(None,args)
try: argl[1] = argl[1].this
except: pass
try: argl[2] = argl[2].this
except: pass
args = tuple(argl)
self.this = apply(controls2c.new_wxTreeCtrl,(arg0.this,)+args)
self.thisown = 1
wxp._StdWindowCallbacks(self)
#-------------- FUNCTION WRAPPERS ------------------

View File

@ -2886,7 +2886,7 @@ static PyObject *_wrap_wxSplitterWindow_SplitHorizontally(PyObject *self, PyObje
wxSplitterWindow * _arg0;
wxWindow * _arg1;
wxWindow * _arg2;
int _arg3 = -1;
int _arg3 = 0;
char * _argc0 = 0;
char * _argc1 = 0;
char * _argc2 = 0;
@ -2924,7 +2924,7 @@ static PyObject *_wrap_wxSplitterWindow_SplitVertically(PyObject *self, PyObject
wxSplitterWindow * _arg0;
wxWindow * _arg1;
wxWindow * _arg2;
int _arg3 = -1;
int _arg3 = 0;
char * _argc0 = 0;
char * _argc1 = 0;
char * _argc2 = 0;

View File

@ -33,8 +33,9 @@
* and things like that.
*
* $Log$
* Revision 1.6 1998/10/20 07:39:19 RD
* newly generated files from SWIG
* Revision 1.7 1998/11/11 04:40:51 RD
* wxTreeCtrl now works (sort of) for wxPython-GTK. This is the new
* TreeCtrl in src/gtk/treectrl.cpp not the old generic one.
*
************************************************************************/
@ -1651,6 +1652,8 @@ SWIGEXPORT(void,initwxpc)() {
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SET_INFO));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_EXPANDED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_EXPANDED));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_EXPANDING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_EXPANDING));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_COLLAPSED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_COLLAPSED));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_COLLAPSING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_COLLAPSING));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGED));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGING));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_TREE_KEY_DOWN));
@ -1712,6 +1715,7 @@ SWIGEXPORT(void,initwxpc)() {
SWIG_RegisterMapping("_wxPaintEvent","_class_wxPaintEvent",0);
SWIG_RegisterMapping("_wxIndividualLayoutConstraint","_class_wxIndividualLayoutConstraint",0);
SWIG_RegisterMapping("_wxCursor","_class_wxCursor",0);
SWIG_RegisterMapping("_class_wxTreeCtrl","_wxTreeCtrl",0);
SWIG_RegisterMapping("_wxMask","_class_wxMask",0);
SWIG_RegisterMapping("_wxGrid","_class_wxGrid",0);
SWIG_RegisterMapping("_wxPyMenu","_class_wxPyMenu",0);
@ -1763,6 +1767,7 @@ SWIGEXPORT(void,initwxpc)() {
SWIG_RegisterMapping("_wxPoint","_class_wxPoint",0);
SWIG_RegisterMapping("_class_wxButton","_wxButton",0);
SWIG_RegisterMapping("_wxRadioBox","_class_wxRadioBox",0);
SWIG_RegisterMapping("_wxTreeItemData","_class_wxTreeItemData",0);
SWIG_RegisterMapping("_class_wxFontData","_wxFontData",0);
SWIG_RegisterMapping("_wxBitmap","_class_wxBitmap",0);
SWIG_RegisterMapping("_wxPyTimer","_class_wxPyTimer",0);
@ -1792,6 +1797,7 @@ SWIGEXPORT(void,initwxpc)() {
SWIG_RegisterMapping("_class_wxDC","_wxDC",0);
SWIG_RegisterMapping("_wxPyApp","_class_wxPyApp",0);
SWIG_RegisterMapping("_wxMDIParentFrame","_class_wxMDIParentFrame",0);
SWIG_RegisterMapping("_class_wxTreeEvent","_wxTreeEvent",0);
SWIG_RegisterMapping("_class_wxPyTimer","_wxPyTimer",0);
SWIG_RegisterMapping("_wxFocusEvent","_class_wxFocusEvent",0);
SWIG_RegisterMapping("_wxMaximizeEvent","_class_wxMaximizeEvent",0);
@ -1843,6 +1849,7 @@ SWIGEXPORT(void,initwxpc)() {
SWIG_RegisterMapping("_class_wxCursor","_wxCursor",0);
SWIG_RegisterMapping("_wxPostScriptDC","_class_wxPostScriptDC",0);
SWIG_RegisterMapping("_wxScrolledWindow","_class_wxScrolledWindow",0);
SWIG_RegisterMapping("_wxTreeItemId","_class_wxTreeItemId",0);
SWIG_RegisterMapping("_unsigned_char","_byte",0);
SWIG_RegisterMapping("_class_wxMenu","_wxMenu",0);
SWIG_RegisterMapping("_wxControl","_class_wxControl",0);
@ -1888,6 +1895,8 @@ SWIGEXPORT(void,initwxpc)() {
SWIG_RegisterMapping("_class_wxInitDialogEvent","_wxInitDialogEvent",0);
SWIG_RegisterMapping("_class_wxComboBox","_wxComboBox",0);
SWIG_RegisterMapping("_class_wxRadioButton","_wxRadioButton",0);
SWIG_RegisterMapping("_class_wxTreeItemId","_wxTreeItemId",0);
SWIG_RegisterMapping("_wxTreeCtrl","_class_wxTreeCtrl",0);
SWIG_RegisterMapping("_class_wxLayoutConstraints","_wxLayoutConstraints",0);
SWIG_RegisterMapping("_wxIconizeEvent","_class_wxIconizeEvent",0);
SWIG_RegisterMapping("_class_wxControl","_wxControl",0);
@ -1907,11 +1916,13 @@ SWIGEXPORT(void,initwxpc)() {
SWIG_RegisterMapping("_class_wxClientDC","_wxClientDC",0);
SWIG_RegisterMapping("_class_wxSizeEvent","_wxSizeEvent",0);
SWIG_RegisterMapping("_class_wxListCtrl","_wxListCtrl",0);
SWIG_RegisterMapping("_class_wxTreeItemData","_wxTreeItemData",0);
SWIG_RegisterMapping("_class_wxGridCell","_wxGridCell",0);
SWIG_RegisterMapping("_class_wxSize","_wxSize",0);
SWIG_RegisterMapping("_class_wxBitmap","_wxBitmap",0);
SWIG_RegisterMapping("_class_wxMemoryDC","_wxMemoryDC",0);
SWIG_RegisterMapping("_wxMenuBar","_class_wxMenuBar",0);
SWIG_RegisterMapping("_wxTreeEvent","_class_wxTreeEvent",0);
SWIG_RegisterMapping("_wxEvtHandler","_class_wxPyApp",SwigwxPyAppTowxEvtHandler);
SWIG_RegisterMapping("_wxEvtHandler","_wxPyApp",SwigwxPyAppTowxEvtHandler);
SWIG_RegisterMapping("_wxEvtHandler","_class_wxEvtHandler",0);

View File

@ -587,6 +587,8 @@ wxEVT_COMMAND_TREE_GET_INFO = wxpc.wxEVT_COMMAND_TREE_GET_INFO
wxEVT_COMMAND_TREE_SET_INFO = wxpc.wxEVT_COMMAND_TREE_SET_INFO
wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxpc.wxEVT_COMMAND_TREE_ITEM_EXPANDED
wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxpc.wxEVT_COMMAND_TREE_ITEM_EXPANDING
wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxpc.wxEVT_COMMAND_TREE_ITEM_COLLAPSED
wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxpc.wxEVT_COMMAND_TREE_ITEM_COLLAPSING
wxEVT_COMMAND_TREE_SEL_CHANGED = wxpc.wxEVT_COMMAND_TREE_SEL_CHANGED
wxEVT_COMMAND_TREE_SEL_CHANGING = wxpc.wxEVT_COMMAND_TREE_SEL_CHANGING
wxEVT_COMMAND_TREE_KEY_DOWN = wxpc.wxEVT_COMMAND_TREE_KEY_DOWN
@ -1104,8 +1106,12 @@ class wxApp(wxPyApp):
#----------------------------------------------------------------------------
#
# $Log$
# Revision 1.6 1998/10/20 07:39:22 RD
# newly generated files from SWIG
# Revision 1.7 1998/11/11 04:40:53 RD
# wxTreeCtrl now works (sort of) for wxPython-GTK. This is the new
# TreeCtrl in src/gtk/treectrl.cpp not the old generic one.
#
# Revision 1.5 1998/10/20 07:38:02 RD
# bug fix
#
# Revision 1.4 1998/10/20 06:43:54 RD
# New wxTreeCtrl wrappers (untested)