Example #1
0
    def __init__(self):
        super().__init__()
        self.back_btn = gui.Button(_("Go Back"), f.MAIN, callback=lambda *_: setattr(self, 'done', True), layout_gravity=gui.Gravity.BOTTOMRIGHT)
        self.fullscreen_btn = gui.CheckBox(_("Toggle Fullscreen"), f.MAIN, callback=lambda *_: display.toggle_fullscreen(), padding=25)

        def res_setter(res):
            return lambda *_: display.set_resolution(res)
        resolutions = [("{0[0]}x{0[1]}".format(res), res_setter(res)) for res in pygame.display.list_modes()]
        self.resolutions_menu = gui.Menu(resolutions, f.MAIN, die_when_done=False)
        self.add_children(self.back_btn, self.fullscreen_btn, self.resolutions_menu)
Example #2
0
 def pause_menu(self):
     menu_entries = [(_('Return to Game'), None),
                     (_('Return to Main Menu'), self.reset),
                     (_('Return to O.S.'), utils.return_to_os)]
     display.darken(200)
     menu = gui.Menu(menu_entries,
                     f.MAIN,
                     layout_gravity=gui.Gravity.CENTER,
                     dismiss_callback=True,
                     clear_screen=None)
     room.run_room(menu)
Example #3
0
 def __init__(self, image):
     super().__init__(layout_width=gui.LayoutParams.FILL_PARENT,
                      layout_height=gui.LayoutParams.FILL_PARENT,
                      gravity=gui.Gravity.CENTER,
                      bg_color=c.BLACK,
                      bg_image=image)
     self.files = [(file, self.chosen) for file in resources.list_maps()]
     self.choose_label = gui.Label(_("Choose a map!"),
                                   f.MAIN_MENU,
                                   txt_color=c.ICE,
                                   bg_color=c.MENU_BG)
     self.menu = gui.Menu(self.files,
                          f.MAIN,
                          padding=(25, 25),
                          die_when_done=False)
     self.back_btn = gui.Button(_("Go Back"),
                                f.MAIN,
                                callback=self.back,
                                layout_gravity=gui.Gravity.BOTTOMRIGHT)
     self.add_children(self.choose_label, self.menu, self.back_btn)
Example #4
0
def execute(arr):
    
    execGUI = gui.Menu(1,arr)
    curses.wrapper(execGUI.gui())
        
    return
Example #5
0

# --- gui2py designer generated code starts ---

with gui.Window(
        name='consultas',
        title=u'Aplicativo Facturaci\xf3n Electr\xf3nica',
        resizable=True,
        height='636px',
        left='181',
        top='52',
        width='794px',
        image='',
):
    with gui.MenuBar(name='menubar_83_155', ):
        with gui.Menu(name='menu_114', ):
            gui.MenuItemSeparator(name='menuitemseparator_130', )
    gui.StatusBar(
        name='statusbar_15_91',
        text=u'Servicio Web Factura Electr\xf3nica mercado interno (WSFEv1)',
    )
    with gui.Panel(
            label=u'',
            name='panel',
            image='',
    ):
        gui.Image(
            name='image_507_571',
            height='36',
            left='17',
            top='545',
Example #6
0
		#	item['col_status'] = status['result_code']

	def get_balance(self, evt):
		cash, point = self.__get_balance__()
		gui.alert('cash : %u, point : %u' % (cash, point))

ui = smsui()

gui.Window(name='mywin', title='COOLSMS Messaging'
		, resizable=True, height='420px'
		, left='180', top='24'
		, width='600px', bgcolor='#E0E0E0')

# menu
gui.MenuBar(name='menubar', fgcolor='#000000', parent='mywin')
gui.Menu(label='File', name='menu', fgcolor='#000000', parent='mywin.menubar')
gui.MenuItem(label='Quit', help='quit program', name='menu_quit', parent='mywin.menubar.menu')

# tab panel
gui.Notebook(name='notebook', height='211', left='10', top='10', width='590', parent='mywin', selection=0, )
gui.TabPanel(name='tab_setup', parent='mywin.notebook', selected=True, text='Setup')
gui.TabPanel(name='tab_message', parent='mywin.notebook', selected=True, text='Message')
gui.TabPanel(name='tab_list', parent='mywin.notebook', selected=True, text='List')

#### setup #####
# user_id
#gui.Label(name='label_userid', left='10', top='22', parent='mywin.notebook.tab_setup', text='User Id')
#gui.TextBox(name='user_id', left='80', top='22', width='150', parent='mywin.notebook.tab_setup', value='test')

# api_key
gui.Label(name='label_api_key', left='10', top='50', parent='mywin.notebook.tab_setup', text='API Key')
Example #7
0
 def draw_iventory(self):
     menu_list = []
     for item in self.inventory:
         menu_list.append(item.name)
     menu = gui.Menu(menu_list, (10, 10), (150, 100))
     menu.draw()
Example #8
0
    def main(self):
        verticalContainer = gui.Widget(640, 680, False, 10)

        horizontalContainer = gui.Widget(620, 620, True, 10)

        subContainerLeft = gui.Widget(340, 530, False, 10)
        self.img = gui.Image(100, 100, './res/logo.png')

        self.table = gui.Table(300, 200)
        row = gui.TableRow()
        item = gui.TableTitle()
        item.append(str(id(item)), 'ID')
        row.append(str(id(item)), item)
        item = gui.TableTitle()
        item.append(str(id(item)), 'First Name')
        row.append(str(id(item)), item)
        item = gui.TableTitle()
        item.append(str(id(item)), 'Last Name')
        row.append(str(id(item)), item)
        self.table.append(str(id(row)), row)
        self.add_table_row(self.table, '101', 'Danny', 'Young')
        self.add_table_row(self.table, '102', 'Christine', 'Holand')
        self.add_table_row(self.table, '103', 'Lars', 'Gordon')
        self.add_table_row(self.table, '104', 'Roberto', 'Robitaille')
        self.add_table_row(self.table, '105', 'Maria', 'Papadopoulos')

        # the arguments are	width - height - layoutOrientationOrizontal
        subContainerRight = gui.Widget(240, 560, False, 10)

        self.lbl = gui.Label(200, 30, 'This is a LABEL!')

        self.bt = gui.Button(200, 30, 'Press me!')
        # setting the listener for the onclick event of the button
        self.bt.set_on_click_listener(self, 'on_button_pressed')

        self.txt = gui.TextInput(200, 30)
        self.txt.set_text('This is a TEXTAREA')
        self.txt.set_on_change_listener(self, 'on_text_area_change')

        self.spin = gui.SpinBox(200, 30)
        self.spin.set_on_change_listener(self, 'on_spin_change')

        self.btInputDiag = gui.Button(200, 30, 'Open InputDialog')
        self.btInputDiag.set_on_click_listener(self, 'open_input_dialog')

        self.btFileDiag = gui.Button(200, 30, 'File Selection Dialog')
        self.btFileDiag.set_on_click_listener(self,
                                              'open_fileselection_dialog')

        self.btUploadFile = gui.FileUploader(200, 30, './')
        self.btUploadFile.set_on_success_listener(self,
                                                  'fileupload_on_success')
        self.btUploadFile.set_on_failed_listener(self, 'fileupload_on_failed')

        self.listView = gui.ListView(300, 120)
        self.listView.set_on_selection_listener(self, "list_view_on_selected")
        li0 = gui.ListItem(279, 20, 'Danny Young')
        li1 = gui.ListItem(279, 20, 'Christine Holand')
        li2 = gui.ListItem(279, 20, 'Lars Gordon')
        li3 = gui.ListItem(279, 20, 'Roberto Robitaille')
        self.listView.append('0', li0)
        self.listView.append('1', li1)
        self.listView.append('2', li2)
        self.listView.append('3', li3)

        self.dropDown = gui.DropDown(200, 20)
        c0 = gui.DropDownItem(200, 20, 'DropDownItem 0')
        c1 = gui.DropDownItem(200, 20, 'DropDownItem 1')
        self.dropDown.append('0', c0)
        self.dropDown.append('1', c1)
        self.dropDown.set_on_change_listener(self, 'drop_down_changed')

        self.slider = gui.Slider(200, 20, 10, 0, 100, 5)
        self.slider.set_on_change_listener(self, 'slider_changed')

        self.colorPicker = gui.ColorPicker(200, 20, '#ffbb00')
        self.colorPicker.set_on_change_listener(self, 'color_picker_changed')

        self.date = gui.Date(200, 20, '2015-04-13')
        self.date.set_on_change_listener(self, 'date_changed')

        # appending a widget to another, the first argument is a string key
        subContainerRight.append('1', self.lbl)
        subContainerRight.append('2', self.bt)
        subContainerRight.append('3', self.txt)
        subContainerRight.append('4', self.spin)
        subContainerRight.append('5', self.btInputDiag)
        subContainerRight.append('5_', self.btFileDiag)
        subContainerRight.append(
            '5__',
            gui.FileDownloader(200, 30, 'download test', './res/logo.png'))
        subContainerRight.append('5___', self.btUploadFile)
        subContainerRight.append('6', self.dropDown)
        subContainerRight.append('7', self.slider)
        subContainerRight.append('8', self.colorPicker)
        subContainerRight.append('9', self.date)
        self.subContainerRight = subContainerRight

        subContainerLeft.append('0', self.img)
        subContainerLeft.append('1', self.table)
        subContainerLeft.append('2', self.listView)

        horizontalContainer.append('0', subContainerLeft)
        horizontalContainer.append('1', subContainerRight)

        menu = gui.Menu(620, 40)
        m1 = gui.MenuItem(100, 40, 'File')
        m2 = gui.MenuItem(100, 40, 'View')
        m2.set_on_click_listener(self, 'menu_view_clicked')
        m11 = gui.MenuItem(100, 40, 'Save')
        m12 = gui.MenuItem(100, 40, 'Open')
        m12.set_on_click_listener(self, 'menu_open_clicked')
        m111 = gui.MenuItem(100, 40, 'Save')
        m111.set_on_click_listener(self, 'menu_save_clicked')
        m112 = gui.MenuItem(100, 40, 'Save as')
        m112.set_on_click_listener(self, 'menu_saveas_clicked')

        menu.append('1', m1)
        menu.append('2', m2)
        m1.append('11', m11)
        m1.append('12', m12)
        m11.append('111', m111)
        m11.append('112', m112)

        verticalContainer.append('0', menu)
        verticalContainer.append('1', horizontalContainer)

        # returning the root widget
        return verticalContainer
Example #9
0
    label=u'??? ????',
    name='removebombb',
    left='125',
    top='775',
    fgcolor=u'#000000',
    parent='mywin',
    visible=True,
)

gui.MenuBar(
    name='menubar',
    parent='mywin',
)
gui.Menu(
    name='menu',
    label=u'????????',
    parent='mywin.menubar',
    left='400',
)
gui.MenuItem(
    help=u'??? ????',
    id=120,
    name='bombtype',
    label=u'??? ????',
    parent='mywin.menubar.menu',
)
gui.MenuItem(
    help=u'???? ??? ??????',
    id=125,
    name='menu_edit_count',
    label=u'???? ??? ??????',
    parent='mywin.menubar.menu',
Example #10
0
        for event in pygame.event.get():
            quit_attempt = False
            if event.type == pygame.QUIT:
                quit_attempt = True
            elif event.type == pygame.KEYDOWN:
                alt_pressed = pressed_keys[pygame.K_LALT] or \
                              pressed_keys[pygame.K_RALT]
                if event.key == pygame.K_ESCAPE:
                    quit_attempt = True
                elif event.key == pygame.K_F4 and alt_pressed:
                    quit_attempt = True

            if quit_attempt:
                active_scene.Terminate()
            else:
                filtered_events.append(event)

        active_scene.ProcessInput(filtered_events, pressed_keys)
        screen = active_scene.screen

        active_scene.Update()
        active_scene.Render(screen)

        active_scene = active_scene.next

        pygame.display.flip()
        clock.tick(fps)


run_game(400, 300, 60, gui.Menu())