def multchoicebox(message='Pick as many items as you like.', title='', choices=['program logic error - no choices specified']): """Original doc: Present the user with a list of choices. allow him to select multiple items and return them in a list. if the user doesn't choose anything from the list, return the empty list. return None if he cancelled selection. """ return psidialogs.multi_choice(message=message, title=title, choices=choices)
def gui(): """remove libraries by GUI.""" sel = psidialogs.multi_choice(libraries(), 'select libraries to remove from %s!' % libraries_dir(), title='remove boards') print('%s selected' % sel) if sel: if psidialogs.ask_yes_no('Do you really want to remove selected libraries?\n' + '\n'.join(sel)): for x in sel: remove_lib(x) print('%s was removed' % x)
def gui(): """remove libraries by GUI.""" sel = psidialogs.multi_choice(libraries(), 'select libraries to remove from %s!' % libraries_dir(), title='remove boards') print('%s selected' % sel) if sel: if psidialogs.ask_yes_no( 'Do you really want to remove selected libraries?\n' + '\n'.join(sel)): for x in sel: remove_lib(x) print('%s was removed' % x)
def remove_boards_gui(hwpack=""): """remove boards by GUI.""" if not hwpack: if len(hwpack_names()) > 1: hwpack = psidialogs.choice(hwpack_names(), "select hardware package to select board from!", title="select") else: hwpack = hwpack_names()[0] print("%s selected" % hwpack) if hwpack: sel = psidialogs.multi_choice( board_names(hwpack), "select boards to remove from %s!" % boards_txt(hwpack), title="remove boards" ) print("%s selected" % sel) if sel: for x in sel: remove_board(x) print("%s was removed" % x)
def remove_boards_gui(hwpack=''): """remove boards by GUI.""" if not hwpack: if len(hwpack_names()) > 1: hwpack = psidialogs.choice( hwpack_names(), 'select hardware package to select board from!', title='select') else: hwpack = hwpack_names()[0] print('%s selected' % hwpack) if hwpack: sel = psidialogs.multi_choice(board_names(hwpack), 'select boards to remove from %s!' % boards_txt(hwpack), title='remove boards') print('%s selected' % sel) if sel: for x in sel: remove_board(x) print('%s was removed' % x)
def multipleChoiceDialog(parent=None, message='', title='', lst=[], pos=wx.Point(-1, -1), size=wx.Size(-1, -1)): return psidialogs.multi_choice(message=message, title=title, choices=lst)