wxPython/wxGlade-0.9.1/widgets/menubar/menubar.py
def move_item_down(self, event):
        "moves the selected menu item after the next one at the same level in self.menu_items"
        self.menu_items.SetFocus()
        index = self.selected_index
        self.selected_index = -1
        if index < 0: return

        def get(i, j): return self.menu_items.GetItem(i, j).GetText()

        def getall(i): return [get(i, j) for j in range(6)]
        level = self.item_level(index)
        i = index+1
        while i < self.menu_items.GetItemCount():
            # collect the items to move down
            if level < self.item_level(i):
                i += 1
            else: break
        if i < self.menu_items.GetItemCount():
            # _do_move_item works with selected_index, so we must assing to
            # it the right value before the call
            #self.selected_index = i
            self.selected_index = self._do_move_item(event, i, True)
            # fix bug 698071
            state = wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED
            self.menu_items.SetItemState(self.selected_index, state, state)
        else:
            # restore the selected index
            self.selected_index = index
moves the selected menu item after the next one at the same level in self.menu_items
moves the selected menu item after the next one at the same level in self.menu_items
moves the selected menu item after the next one at the same level in self . menu_items
def move_item_down(self, event):
        self.menu_items.SetFocus()
        index = self.selected_index
        self.selected_index = -1
        if index < 0: return
        def get(i, j): return self.menu_items.GetItem(i, j).GetText()
        def getall(i): return [get(i, j) for j in range(6)]
        level = self.item_level(index)
        i = index+1
        while i < self.menu_items.GetItemCount():
            if level < self.item_level(i):
                i += 1
            else: break
        if i < self.menu_items.GetItemCount():
            self.selected_index = self._do_move_item(event, i, True)
            state = wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED
            self.menu_items.SetItemState(self.selected_index, state, state)
        else:
            self.selected_index = index
def move_item_down ( self , event ) : self . menu_items . SetFocus ( ) index = self . selected_index self . selected_index = - 1 if index < 0 : return def get ( i , j ) : return self . menu_items . GetItem ( i , j ) . GetText ( ) def getall ( i ) : return [ get ( i , j ) for j in range ( 6 ) ] level = self . item_level ( index ) i = index + 1 while i < self . menu_items . GetItemCount ( ) : if level < self . item_level ( i ) : i += 1 else : break if i < self . menu_items . GetItemCount ( ) : self . selected_index = self . _do_move_item ( event , i , True ) state = wx . LIST_STATE_SELECTED | wx . LIST_STATE_FOCUSED self . menu_items . SetItemState ( self . selected_index , state , state ) else : self . selected_index = index
moves the selected menu item after the next one at the same level in self.menu_items
moves the selected menu item after the next one at the same level in self . menu_items
"moves the selected menu item after the next one at the same level in self.menu_items" # collect the items to move down # _do_move_item works with selected_index, so we must assing to # it the right value before the call #self.selected_index = i # fix bug 698071 # restore the selected index
self
event