Paul McNett пишет:
import wx
import dabo
dabo.ui.loadUI("wx")
class GridTowns(dabo.ui.dGrid):
def initProperties(self):
self.DataSet = [{'town' : 'Moscow', 'country' : 'Russia'},
{'town' : 'Hollister', 'country' : 'United
States'}]
self.Editable = False
self.Sortable = True
self.Searchable = True
def afterInit(self):
GridTowns.doDefault()
col = dabo.ui.dColumn(self, Name='Town', DataField='town',
Width=200, Caption=u"",
Sortable=True, Searchable=True, Editable=False)
self.addColumn(col)
col = dabo.ui.dColumn(self, Name='Country', DataField='country',
Width=175, Caption=u"",
Sortable=True, Searchable=True, Editable=False)
self.addColumn(col)
self.ShowRowLabels = False
self.SelectionMode = 'Row'
self.MultipleSelection = True
app = wx.App()
frm = wx.Frame(None, -1, "test")
grd = GridTowns(frm)
frm.Show()
app.MainLoop()
New questions for the above example, how to make following:
1. Set event handler for left single click on row (wich event I must
catch, and how correctly handle it)?
1.2. And how to catch left double click?
2. From previous event handler get a selected item in DataSet?
3. Delete selected row and item in DataSet?
4. Insert a new row and item in DataSet?
4.1. Is there built-in function to make row and item duplicate?
5. Should I manually (and how to) update dGrid subclass after updating
the DataSet outside the class?
5.1. How to make correct grid with an empty DataSet?
Thank you!
--
Basil Shubin
Freelance Software Developer
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users