Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 5
0
 def on_doubleclick(self, e = None):
     if not self.open_convo_with_selected():
         TreeList.on_doubleclick( self, e )
Ejemplo n.º 6
0
 def set_root(self, root):
     return TreeList.set_root(self, root)
Ejemplo n.º 7
0
 def on_doubleclick(self, e=None):
     if not self.open_convo_with_selected():
         TreeList.on_doubleclick(self, e)
Ejemplo n.º 8
0
 def set_root(self, root):
     return TreeList.set_root(self, root)