def popup_empty_menu ( self , sender): """ Displays the empty list editor popup menu. """ from traitsui.qt4.menu import MakeMenu from pyface.qt import QtCore, QtGui self._cur_control = control = sender menu = MakeMenu( self.empty_list_menu, self, True, control ).menu menu.exec_(control.mapToGlobal(QtCore.QPoint(0, 0)))
def popup_empty_menu(self, sender): """ Displays the empty list editor popup menu. """ from traitsui.qt4.menu import MakeMenu from pyface.qt import QtCore, QtGui self._cur_control = control = sender menu = MakeMenu(self.empty_list_menu, self, True, control).menu menu.exec_(control.mapToGlobal(QtCore.QPoint(0, 0)))
def popup_menu ( self , sender): """ Displays the list editor popup menu. """ from traitsui.qt4.menu import MakeMenu from pyface.qt import QtCore, QtGui self._cur_control = sender proxy = sender.proxy index = proxy.index menu = MakeMenu( self.list_menu, self, True, sender ).menu len_list = len( proxy.list ) not_full = (len_list < self._trait_handler.maxlen) self._menu_before.enabled( not_full ) self._menu_after.enabled( not_full ) self._menu_delete.enabled( len_list > self._trait_handler.minlen ) self._menu_up.enabled( index > 0 ) self._menu_top.enabled( index > 0 ) self._menu_down.enabled( index < (len_list - 1) ) self._menu_bottom.enabled( index < (len_list - 1) ) menu.exec_(sender.mapToGlobal(QtCore.QPoint(0, 0)))
def popup_menu(self, sender): """ Displays the list editor popup menu. """ from traitsui.qt4.menu import MakeMenu from pyface.qt import QtCore, QtGui self._cur_control = sender proxy = sender.proxy index = proxy.index menu = MakeMenu(self.list_menu, self, True, sender).menu len_list = len(proxy.list) not_full = (len_list < self._trait_handler.maxlen) self._menu_before.enabled(not_full) self._menu_after.enabled(not_full) self._menu_delete.enabled(len_list > self._trait_handler.minlen) self._menu_up.enabled(index > 0) self._menu_top.enabled(index > 0) self._menu_down.enabled(index < (len_list - 1)) self._menu_bottom.enabled(index < (len_list - 1)) menu.exec_(sender.mapToGlobal(QtCore.QPoint(0, 0)))