Hi Ed,

On Sun, 2 Oct 2005 14:04:29 -0400, Ed Leafe wrote:
> On Oct 2, 2005, at 1:19 PM, Adi J. Sieker wrote:
>
>> It looks like you also wiped the setItemData Method which I was
>> using. Was that on purpose and if so how do I set item data?
>>
>
> It was intentional, but I scanned the Dabo source and thought it
> wasn't being used. Sorry about that.
>
> I guess I'm not clear on what this 'data' is supposed to represent.
> If it is a value to be associated with a particular row, then it
> needs to be reconciled with the other Dabo properties, such as
> ValueColumn. If not, then perhaps if you explain how you are using
> it I can figure out a way to integrate it into a consistent design.
>
I'm using the data field to store the record ID, so that when needed I can 
select a specific item in the list control
using FindItemData (which is still a wx method).
I also just updated the ui.dTreeView.dNode with a Data Property so I can do the 
same.
I don't know if this is the dabo way of doing things or not I didn't find 
another way.

heres a snippet of code to better show what I mean.
Methods of a Panel which contains the list control
    def _setSelection(self, val):
        list = self.pages['list']
        assert(isinstance(list, dabo.ui.dListControl))

        if val == None:
            list.unselectAll()
        else:
            item = list.FindItemData(-1,val)
            list.select(item)

        tree = self.pages['tree']
        assert(isinstance(tree, dabo.ui.dTreeView))
                # findNodeByData is part of my dTreeView class
        node = tree.findNodeByData(val)
        if node:
            tree.Selection =node

    Select = property(None, _setSelection, None,
                      "Set the Selection of the Notes")

this is an event handler that gets fired when a user clicks on specific words 
in a STC.
    def OnKeywordClicked(self, evt):
        biz = self.PrimaryBizobj
        biz.seek(evt.keyword,"name")
        self.lPanel.Select = biz.note_id
        self.refreshControls()

adi


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to