Changeset 655
- Timestamp:
- 08/11/03 10:34:03 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBSkinning/RBSkinning/wxTools/wxIncrementalTreeModel.py
r600 r655 71 71 72 72 class wxIncrementalTreeModel(object): 73 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 #~ Events 75 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 73 77 OnAddedNode = ObjectEventProperty() # treemodel, treenode 74 78 OnCleared = ObjectEventProperty() # treemodel … … 79 83 80 84 def __init__(self, treewin=None): 85 self.imagelists = {} 81 86 if treewin is not None: 82 87 self.SetTreeWindow(treewin) 83 88 84 #~ Tree population~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 def SetImageList(self, imagelist, kind='normal'): 90 self.imagelists[kind] = imagelist 91 if kind == 'normal': 92 self.treewin.SetImageList(imagelist) 93 elif kind == 'state': 94 self.treewin.SetStateImageList(imagelist) 95 else: 96 raise KeyError, '%r is not a vaild imagelist kind' % (kind,) 85 97 86 98 def ClearTree(self): 87 99 self.treewin.DeleteAllItems() 100 for imagelist in self.imagelists.itervalues(): 101 imagelist.RemoveAll() 88 102 self.OnCleared() 103 104 #~ Tree population~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 105 90 106 def PopulateTree(self, node): trunk/RBSkinning/RBSkinning/wxTools/wxReflectedListModel.py
r604 r655 68 68 69 69 listwin = None 70 imagelistkindmap = { 71 'normal':wx.wxIMAGE_LIST_NORMAL, 72 'small':wx.wxIMAGE_LIST_SMALL, 73 'state':wx.wxIMAGE_LIST_STATE, 74 } 70 75 71 76 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 74 79 75 80 def __init__(self, listwin=None): 81 self.imagelists = {} 76 82 if listwin is not None: 77 83 self.SetListWindow(listwin) 78 84 85 def SetImageList(self, imagelist, kind='normal'): 86 self.imagelists[kind] = imagelist 87 self.listwin.SetImageList(imagelist, self.imagelistkindmap[kind]) 88 79 89 def ClearList(self): 80 90 self.listwin.DeleteAllItems() 91 for imagelist in self.imagelists.itervalues(): 92 imagelist.RemoveAll() 81 93 self._IDtoItem = {} 82 94 self.OnCleared()
