示例#1
0
    def onItemSelected(self, ev):
        """Handle the wxWidgets event that is sent when the current
        selection changes in the list box.

        @param ev A wxWidgets event.
        """
        ev.Skip()
        events.send(
            events.SelectNotify(self.widgetId,
                                self.items[ev.GetSelection()][0]))
示例#2
0
    def onTabChange(self, ev):
        """Handle the wxWidgets event that occurs when the currently
        selected tab changes."""

        # Figure out which panel is now visible.
        tabPanel = self.getWxWidget().GetPage(ev.GetSelection())

        # Send a notification event.
        notification = events.SelectNotify(self.widgetId,
                                           self.__lookupPanel(tabPanel))
        events.send(notification)
示例#3
0
    def onRightDown(self, event):
        """Right button down."""

        w = self.getWxWidget()

        #print "right down in list " + str(event.GetPosition())
        item = w.HitTest(event.GetPosition())
        #print item
        if item >= 0:
            w.SetSelection(item)
            if self.widgetId:
                events.send(
                    events.SelectNotify(self.widgetId, self.items[item][0]))

        event.Skip()
示例#4
0
    def onItemSelected(self, event):
        """Handle the wxWidgets item selection event.

        @param event A wxWidgets event.
        """
        if self.widgetId and self.style == List.STYLE_COLUMNS:
            # Identifier of the selected item is sent with the
            # notification.
            item = self.items[self.getWxWidget().GetItemData(event.GetIndex())]

            # Send a notification about the selected item.
            events.send(events.SelectNotify(self.widgetId, item))

        event.Skip()
        self.react()
示例#5
0
    def onItemSelected(self, ev):
        """Handle the wxWidgets event that is sent when the current
        selection changes in the list box.

        @param ev A wxWidgets event.
        """
        if self.widgetId:
            newSelection = self.items[ev.GetSelection()]

            if sb.confdb.isSettingDefined(self.widgetId):
                # This is a setting.
                if newSelection == 'default':
                    pr.getActive().removeValue(self.widgetId)
                else:
                    pr.getActive().setValue(self.widgetId, newSelection)

                # Notify everyone of the change.
                events.send(events.EditNotify(self.widgetId, newSelection))
            else:
                # Normal list.
                events.send(events.SelectNotify(self.widgetId, newSelection))
示例#6
0
 def onItemDoubleClick(self, ev):
     ev.Skip()
     events.send(
         events.SelectNotify(self.widgetId,
                             self.items[ev.GetSelection()][0], True))
示例#7
0
 def onSelectionChanged(self, treeEvent):
     """Send a notification that the selection has changed in the tree."""
     
     item = treeEvent.GetItem()
     events.send(events.SelectNotify(self.widgetId, self.lookupItem(item)))
示例#8
0
 def onPageChange(self, event):
     pageId = event.GetPage().getId()
     events.send(events.SelectNotify('wizard', pageId))
     if self.pageReaction:
         self.pageReaction(event.GetPage())