mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
Just a little cleanup and comments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -174,7 +174,7 @@ class MyTreeListModel(dv.PyDataViewModel):
|
|||||||
1 : "",
|
1 : "",
|
||||||
2 : "",
|
2 : "",
|
||||||
3 : "",
|
3 : "",
|
||||||
4 : wx.DateTimeFromTimeT(0), # TODO: There should be some way to indicate a null value...
|
4 : wx.DateTime.FromTimeT(0), # TODO: There should be some way to indicate a null value...
|
||||||
5 : False,
|
5 : False,
|
||||||
}
|
}
|
||||||
return mapper[col]
|
return mapper[col]
|
||||||
@@ -223,7 +223,8 @@ class MyTreeListModel(dv.PyDataViewModel):
|
|||||||
node.date = value
|
node.date = value
|
||||||
elif col == 5:
|
elif col == 5:
|
||||||
node.like = value
|
node.like = value
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -254,13 +255,15 @@ class TestPanel(wx.Panel):
|
|||||||
# parameter which tells the view which col in the data model to pull
|
# parameter which tells the view which col in the data model to pull
|
||||||
# values from for each view column.
|
# values from for each view column.
|
||||||
if 1:
|
if 1:
|
||||||
self.tr = tr = dv.DataViewTextRenderer()
|
# here is an example of adding a column with full control over the renderer, etc.
|
||||||
|
tr = dv.DataViewTextRenderer()
|
||||||
c0 = dv.DataViewColumn("Genre", # title
|
c0 = dv.DataViewColumn("Genre", # title
|
||||||
tr, # renderer
|
tr, # renderer
|
||||||
0, # data model column
|
0, # data model column
|
||||||
width=80)
|
width=80)
|
||||||
self.dvc.AppendColumn(c0)
|
self.dvc.AppendColumn(c0)
|
||||||
else:
|
else:
|
||||||
|
# otherwise there are convenience methods for the simple cases
|
||||||
self.dvc.AppendTextColumn("Genre", 0, width=80)
|
self.dvc.AppendTextColumn("Genre", 0, width=80)
|
||||||
|
|
||||||
c1 = self.dvc.AppendTextColumn("Artist", 1, width=170, mode=dv.DATAVIEW_CELL_EDITABLE)
|
c1 = self.dvc.AppendTextColumn("Artist", 1, width=170, mode=dv.DATAVIEW_CELL_EDITABLE)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import random
|
|||||||
def makeBlank(self):
|
def makeBlank(self):
|
||||||
# Just a little helper function to make an empty image for our
|
# Just a little helper function to make an empty image for our
|
||||||
# model to use.
|
# model to use.
|
||||||
empty = wx.EmptyBitmap(16,16,32)
|
empty = wx.Bitmap(16,16,32)
|
||||||
dc = wx.MemoryDC(empty)
|
dc = wx.MemoryDC(empty)
|
||||||
dc.SetBackground(wx.Brush((0,0,0,0)))
|
dc.SetBackground(wx.Brush((0,0,0,0)))
|
||||||
dc.Clear()
|
dc.Clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user