Example #1
0
    def __init__(self,
                 parent,
                 notifications,
                 for_contact=None,
                 plusminus_buttons=None):
        TreeList.__init__(self, parent, TreeListModel(), style=wx.NO_BORDER)
        InstanceTracker.track(self)

        if for_contact is not None and not hasattr(for_contact, 'idstr'):
            raise TypeError(
                'for_contact must be a contact, a metacontact, or None')

        # if for_contact is None we'll show both global ztnotifications and
        # notifications for each contact
        info('showing notifications for %s',
             'everybody' if for_contact is None else for_contact.idstr())
        self.for_contact = for_contact
        self.notifications = notifications

        if plusminus_buttons is not None:
            plus, minus = plusminus_buttons
            plus.Bind(wx.EVT_BUTTON, self.on_add)
            minus.Bind(wx.EVT_BUTTON, self.on_remove)
            #TODO: disable add/deleted when no not. is selected

        self.update_view()

        self.BBind(LEFT_DCLICK=self.on_add_or_edit,
                   LEFT_DOWN=self.on_left_down,
                   LISTBOX=self.on_selection)

        self.SetDrawCallback(self.cskin_drawcallback)
Example #2
0
    def __init__(self, parent, notifications, for_contact = None, plusminus_buttons = None):
        TreeList.__init__(self, parent, TreeListModel(), style = wx.NO_BORDER)
        InstanceTracker.track(self)

        if for_contact is not None and not hasattr(for_contact, 'idstr'):
            raise TypeError('for_contact must be a contact, a metacontact, or None')

        # if for_contact is None we'll show both global ztnotifications and
        # notifications for each contact
        info('showing notifications for %s', 'everybody' if for_contact is None else for_contact.idstr())
        self.for_contact = for_contact
        self.notifications = notifications

        if plusminus_buttons is not None:
            plus, minus = plusminus_buttons
            plus.Bind(wx.EVT_BUTTON, self.on_add)
            minus.Bind(wx.EVT_BUTTON, self.on_remove)
            #TODO: disable add/deleted when no not. is selected

        self.update_view()

        self.BBind(LEFT_DCLICK = self.on_add_or_edit,
                   LEFT_DOWN   = self.on_left_down,
                   LISTBOX     = self.on_selection)

        self.SetDrawCallback(self.cskin_drawcallback)
Example #3
0
    def __init__(self, parent, model, keyhandler = None):
        TreeList.__init__(self, parent, model, keyhandler = keyhandler)
        self.last_pair = (-1, -1)
        self.hilite = None # Where the mouse is dragging.

        self.SetDrawCallback(self.cskin_drawcallback)
        self.SetPaintCallback(self.PostPaint)
Example #4
0
    def __init__(self, parent, model, keyhandler=None):
        TreeList.__init__(self, parent, model, keyhandler=keyhandler)
        self.last_pair = (-1, -1)
        self.hilite = None  # Where the mouse is dragging.

        self.SetDrawCallback(self.cskin_drawcallback)
        self.SetPaintCallback(self.PostPaint)