def __init__(self, **kwargs): self.my_state_bits = 0 self.control_buttons = None super(NotificationItem, self).__init__(**kwargs) self.cols = 3 self.padding = [8, 6] self.size_hint_y = None self.height = 60 l = Label(text = '', markup = True, halign="left") l.bind(size=l.setter('text_size')) self.my_label = l d = Label(text = '', markup = True, halign="left") d.bind(size=d.setter('text_size')) self.my_description = d lb = GridLayout() lb.cols = 1 lb.size_hint = (0.65, 1) lb.add_widget(l) lb.add_widget(d) self.add_widget(lb) self.my_user_name = '' self.my_password = '' self.my_privileges = '' self.my_ip = ''
def __init__(self, **kwargs): super(MessagesScreen, self).__init__(**kwargs) self.name = "messages" self.message_input = TextInput(multiline=True, text="", font_size=pt(10)) btn_send = Button(text="Send", size_hint=(.2, 1), on_release=self.on_send_button) btn_voice = Button(text="Voice", size_hint=(.2, 1), on_release=self.on_voice_message) vbox = BoxLayout(orientation="vertical") messagebar = GridLayout(cols=3, rows=1) messagebar.size_hint = (1, .3) messagebar.add_widget(self.message_input) messagebar.add_widget(btn_send) messagebar.add_widget(btn_voice) vbox.add_widget(messagebar) vbox.add_widget( BoxLayout(orientation="horizontal", size_hint=(1, None), height=dp(20))) # Create second row rc_messages = RecycleViewMessages() rc_messages.viewclass = "RecycleViewMessagesButton" vbox.add_widget(rc_messages) self.add_widget(vbox)
def __init__(self, **kwargs): self.my_state_bits = 0 self.my_up = True self.my_down = True super(Item, self).__init__(**kwargs) self.cols = 2 self.padding = [8, 6] self.size_hint_y = None self.height = 60 l = Label(text = '', markup = True, halign="left") l.bind(size=l.setter('text_size')) self.my_label = l d = Label(text = '', markup = True, halign="left") d.bind(size=d.setter('text_size')) self.my_description = d lb = GridLayout() lb.cols = 1 lb.size_hint = (0.65, 1) lb.add_widget(l) lb.add_widget(d) self.add_widget(lb)
def getPropertyEditors(self, skin): """ get all the controls for editing the extra properties of this control. The list of controls that is returned, our bound to this object (changes will be stored in the skin object) :param skin: json object :return: a list of kivy controls that can be used for editing the properties for the skin. """ items = [] grd = GridLayout(cols=2) grd.bind(minimum_height = grd.setter('height')) grd.size_hint = (1, None) chk = CheckBox(active=sm.getVar(skin, self.asset, "show_label", False), height='28dp', size_hint=(1, None)) chk.bind(active=self.on_show_labelChanged) lbl = Label(text='show label', height='28dp', size_hint=(1, None), halign='right') lbl.bind(size = lbl.setter('text_size')) grd.add_widget(lbl) grd.add_widget(chk) chk = CheckBox(active=sm.getVar(skin, self.asset, "show_marker", False), height='28dp', size_hint=(1, None)) chk.bind(active=self.on_show_markerChanged) lbl = Label(text='show marker', height='28dp', size_hint=(1, None), halign='right') lbl.bind(size = lbl.setter('text_size')) grd.add_widget(lbl) grd.add_widget(chk) chk = CheckBox(active=sm.getVar(skin, self.asset, "send_on_release", False), height='28dp', size_hint=(1, None)) chk.bind(active=self.on_send_on_release_Changed) lbl = Label(text='send on release', height='28dp', size_hint=(1, None), halign='right') lbl.bind(size = lbl.setter('text_size')) grd.add_widget(lbl) grd.add_widget(chk) items.append(grd) return items
def setup(self): self.cols = 1 self.rows = 2 self.turn_label = Label(text='[b]Turn:[/b] [color='+ self.player_color[self.game.turn] + ']' \ + self.player_name[self.game.turn] + '[/color]', markup=True) self.turn_label.font_size = 48 inner_layout = GridLayout() inner_layout.rows = 3 inner_layout.cols = 3 inner_layout.padding = (8, 8) for x in range(3): for y in range(3): self.button_matrix[x][y] = Button( text="" + str(self.game.board_matrix[x][y]), font_size=48, markup=True) if self.game.board_matrix[x][y] != "-": # Player 2 (AI) can have already placed his first move self.button_matrix[x][ y].text = '[b][color=' + self.player_color[ 2] + ']' + self.player_symbol[2] + '[/color][/b]' self.button_matrix[x][y].bind( on_press=partial(self.button_pressed, x, y)) inner_layout.add_widget(self.button_matrix[x][y]) self.add_widget(self.turn_label) inner_layout.size_hint = (2.5, 2) self.add_widget(inner_layout)
def __init__(self, multiplayer=False, sm=None, **kwargs): super().__init__(**kwargs) self.btns = [] # 0 = kruzok ; 1 = iksko self.turn = randint(0, 1) if multiplayer else 1 self.__multi = multiplayer content = BoxLayout(orientation='vertical') self.status_label = Label(text=str(self.status)) content.add_widget(self.status_label) dismiss_btns = BoxLayout(orientation='horizontal') dismiss_btns.add_widget( Button(text='RESTART', on_press=lambda i: self.restart())) dismiss_btns.add_widget( Button(text='EXIT', on_press=lambda i: self.exit(sm))) content.add_widget(dismiss_btns) self.pop = Popup(title='GAME OVER', content=content, size_hint=(0.5, 0.2), pos_hint={'y': 0.75}, auto_dismiss=False) main_layout = BoxLayout(orientation='vertical') row_1 = BoxLayout(orientation='horizontal', spacing=20) self.X = Label(text='X', font_size=50) self.X.underline = True if self.turn == 1 else False row_1.add_widget(self.X) self.O = Label(text='O', font_size=50) self.O.underline = True if self.turn == 0 else False row_1.add_widget(self.O) main_layout.add_widget(row_1) row_2 = GridLayout(rows=3, cols=3) row_2.size_hint = (0.5, 1.0) row_2.pos_hint = {'x': 0.25} for i in range(9): btn = Button(font_size=30) btn.bind(on_press=self.key_stroke) self.btns.append(btn) row_2.add_widget(btn) main_layout.add_widget(row_2) row_3 = BoxLayout(orientation='horizontal') self._player1_label = Label(text=str(self.player1)) self._player1_label.font_size = 40 row_3.add_widget(self._player1_label) self._player2_label = Label(text=str(self.player2)) self._player2_label.font_size = 40 row_3.add_widget(self._player2_label) main_layout.add_widget(row_3) self.add_widget(main_layout)
def getPropertyEditors(self, skin): """ get all the controls for editing the extra properties of this control. The list of controls that is returned, our bound to this object (changes will be stored in the skin object) :param skin: json object :return: a list of kivy controls that can be used for editing the properties for the skin. """ items = [] grd = GridLayout(cols=2) grd.bind(minimum_height=grd.setter('height')) grd.size_hint = (1, None) chk = CheckBox(active=sm.getVar(skin, self.asset, "show_label", False), height='28dp', size_hint=(1, None)) chk.bind(active=self.on_show_labelChanged) lbl = Label(text='show label', height='28dp', size_hint=(1, None), halign='right') lbl.bind(size=lbl.setter('text_size')) grd.add_widget(lbl) grd.add_widget(chk) chk = CheckBox(active=sm.getVar(skin, self.asset, "show_marker", False), height='28dp', size_hint=(1, None)) chk.bind(active=self.on_show_markerChanged) lbl = Label(text='show marker', height='28dp', size_hint=(1, None), halign='right') lbl.bind(size=lbl.setter('text_size')) grd.add_widget(lbl) grd.add_widget(chk) chk = CheckBox(active=sm.getVar(skin, self.asset, "send_on_release", False), height='28dp', size_hint=(1, None)) chk.bind(active=self.on_send_on_release_Changed) lbl = Label(text='send on release', height='28dp', size_hint=(1, None), halign='right') lbl.bind(size=lbl.setter('text_size')) grd.add_widget(lbl) grd.add_widget(chk) items.append(grd) return items
def setup(self): self.cols = 1 self.rows = 3 self.turn_label = Label(text='[b]Turn:[/b] [color='+ self.player_color[self.game.turn] + ']' \ + self.player_name[self.game.turn] + '[/color]', markup=True) self.turn_label.font_size = 48 inner_layout = GridLayout() inner_layout.rows = 6 inner_layout.cols = 7 inner_layout.padding = (8, 8) for row in range(6): for col in range(7): self.label_matrix[row][col] = Label(text=str(self.game.board_matrix[row][col]), font_size = 48, markup = True) if self.game.board_matrix[row][col] != "-": # Player 2 (AI) can have already placed his first move self.label_matrix[row][col].text = '[b][color=' + self.player_color[2] +']' + self.player_symbol[2] + '[/color][/b]' #self.button_matrix[x][y].bind(on_press=partial (self.button_pressed, x, y)) inner_layout.add_widget(self.label_matrix[row][col]) self.add_widget(self.turn_label) inner_layout.size_hint=(2.5, 2) self.add_widget(inner_layout) # Row of Button, one for each column button_row_layout = GridLayout() button_row_layout.rows = 1 button_row_layout.cols = 7 for col in range(7): button = Button(text="[b]O[/b]", font_size = 40, markup = True) button.bind(on_press=partial(self.button_pressed, col)) button_row_layout.add_widget(button) button_row_layout.size_hint=(0.5, 0.5) self.add_widget(button_row_layout)
def settings(self): settings_grid = GridLayout() settings_grid.rows = 8 settings_grid.size_hint = (1,1) settings_grid.add_widget(Label(text="Clear hosts list.", color=(0,0,0,1), size_hint=(None,1))) settings_grid.add_widget(Button(text="Clear", color=(0,0,0,1), size_hint=(None,None),height=10, on_release= lambda a: self.on_button_click())) settings_grid.add_widget(Label(text="This is place for future settings", color=(0,0,0,1))) settings_grid.add_widget(Label(text="This is place for future settings", color=(0,0,0,1))) settings_grid.add_widget(Label(text="This is place for future settings", color=(0,0,0,1))) self.add_widget(settings_grid)
def __init__(self, **kwargs): super(CryptoScreen, self).__init__(**kwargs) self.cols = 2 self.rows = 4 self.add_widget( Label(text='Original', size_hint=[0.2, 0.4], font_size='30', color=[160 / 255, 229 / 255, 0, 1])) self.original = TextInput(multiline=True, size_hint=[0.8, 0.4]) self.add_widget(self.original) self.add_widget( Label(text='Encrypted', size_hint=[0.2, 0.4], font_size='30', color=[160 / 255, 229 / 255, 0, 1])) self.encrypted = TextInput(multiline=True, size_hint=[0.8, 0.4]) self.add_widget(self.encrypted) self.add_widget( Label(text='KEY', size_hint=[0.2, 0.4], font_size='30', color=[1, 191 / 255, 0, 1])) self.key = TextInput(multiline=False, size_hint=[0.8, 0.4]) self.add_widget(self.key) self.add_widget(Label(text='', size_hint=[0.2, 0.2])) self.butt = Button(text="Encrypt", font_size='30', color=[1, 0, 54 / 255, 1], background_color=[0, 102 / 255, 204 / 255, 1]) self.butt.bind(on_press=self.encode, ) self.butt2 = Button(text="Decrypt", font_size='30', color=[1, 0, 54 / 255, 1], background_color=[0, 102 / 255, 204 / 255, 1]) self.butt2.bind(on_press=self.decode) layout = GridLayout(cols=2) layout.size_hint = [0.8, 0.3] layout.add_widget(self.butt) layout.add_widget(self.butt2) self.add_widget(layout)
def __init__(self, *args, **kwargs): super(HostScreen, self).__init__(**kwargs) self.name = "host" gdlayout = GridLayout(cols=1, rows=2, spacing=[dp(5)]) btn_continue = Button(text="Continue", on_release=lambda *args: setattr( Globals.app.root, "current", "status")) btn_debug = Button(text="Debug", on_release=self._on_button_debug) gdlayout.add_widget(btn_continue) gdlayout.add_widget(btn_debug) self.add_widget(gdlayout) gdlayout.size_hint = (.5, .3) gdlayout.pos_hint = {"center_x": .5, "center_y": .5}
def __init__(self, *args, **kwargs): super(ExtrasScreen, self).__init__(**kwargs) self.name = "extras" btn_kick = Button(text="Kick Drivers", on_release=self.on_kick_driver_button) btn_messages = Button(text="Messages", on_release=self.on_message_button) btn_bookings = Button(text="Bookings", on_release=self.on_bookings_button_press) btn_log = Button(text="Log", on_release=self.on_log_button_press) btn_about = Button(text="About", on_release=self.on_about_button_press) grid_layout = GridLayout(cols=1, rows=5) grid_layout.size_hint = (.5, .5) grid_layout.pos_hint = {"center_x": .5, "center_y": .5} grid_layout.add_widget(btn_kick) grid_layout.add_widget(btn_messages) grid_layout.add_widget(btn_bookings) grid_layout.add_widget(btn_log) grid_layout.add_widget(btn_about) self.add_widget(grid_layout)
def show_control_buttons(self): if self.control_buttons != None: return lb = GridLayout() lb.size_hint = (0.65, 1) lb.add_widget(Widget()) # Make buttons ncols = 1 flaglist = self.my_flags.split(',') for button_name in flaglist: b = IconButton() b.set_image(button_name, None, None) # groupdict, groupname) b.my_button_action = button_name b.bind(on_release = self.my_user_button_pressed) lb.add_widget(b) ncols += 1 lb.cols = ncols self.add_widget(lb) self.control_buttons = lb
def render_builder(self,tab): self.MainBx=BoxLayout(orientation='vertical') self.MainBx.size_hint=( 1, 1) UpBx=BoxLayout() UpBx.padding=10 UpBx.spacing=10 UpBx.size_hint = (1,.99) btnBuild=Button(text='Build',size_hint=(1, 1)) btnBuild.bind(on_press=self.start_build) btnInstall=Button(text='Install',size_hint=(1,1)) btnInstall.bind(on_press=self.start_install) btnInstall.bind(on_release=self.install_prj) btnInstall.disabled=False BtnBx=BoxLayout() BtnBx.size_hint = (1,.1) BtnBx.add_widget(btnBuild) BtnBx.add_widget(btnInstall) self.MainBx.add_widget(UpBx) self.MainBx.add_widget(BtnBx) DxBox=BoxLayout(orientation='vertical') DxBox.padding=5 DxBox.spacing=5 ProojIntBx = GridLayout(cols=2) #init ProojIntBx.size_hint = (1, 0.3) vl=Label(text=u'Version') vl.text_size=(self.width, None) self.vt=TextInput() self.vt.multiline=False pnl=Label(text=u'Project Name') self.pnt=TextInput() self.pnt.multiline=False pkgl=Label(text=u'Base Package Name') self.pkgt=TextInput() self.pkgt.multiline=False ProojIntBx.add_widget(vl) ProojIntBx.add_widget(self.vt) ProojIntBx.add_widget(pnl) ProojIntBx.add_widget(self.pnt) ProojIntBx.add_widget(pkgl) ProojIntBx.add_widget(self.pkgt) FileBx=BoxLayout() #add file search and list permission FileBx.size_hint = (1, 0.95) self.prj_path=FileChooserListView(path=self.prj_load_path) self.prj_path.size_hint = (1, 1) FileBx.add_widget(self.prj_path) ActionOptBx = GridLayout(cols=4) #debug install .... ActionOptBx.padding=10 ActionOptBx.spacing=10 ActionOptBx.size_hint = (1, 0.1) DebugBox=BoxLayout() DebugBox.add_widget(Label(text='Debug')) self.chkDebug=CheckBox() DebugBox.add_widget(self.chkDebug) DebugBox.add_widget(Label(text='Release')) self.chkRelease=CheckBox() DebugBox.add_widget(self.chkRelease) ActionOptBx.add_widget(DebugBox) DxBox.add_widget(ProojIntBx) DxBox.add_widget(FileBx) DxBox.add_widget(ActionOptBx) #dxbox -> second in up box PermissionBx=BoxLayout(orientation='vertical') #treeviw pwrmission PermissionBx.padding=5 PermissionBx.spacing=5 PermissionBx.pos=(10, 0) #~ PermissionBx.size_hint = (1, 1) layouttv = GridLayout(cols=1, spacing=5, size_hint_y=None,pos=(0,10)) layouttv.bind(minimum_height=layouttv.setter('height')) for x in self.obj_builder.permissions_list: btn = ToggleButton(text=x, size_hint_y=None, height=40) btn.bind(state=self.add_remove_permission) layouttv.add_widget(btn) root = ScrollView(size_hint=(None, None), size=(400, 500)) root.size_hint = (1, .9) root.add_widget(layouttv) PermissionBx.add_widget(root) #reder all UpBx.add_widget(DxBox) UpBx.add_widget(PermissionBx) #add all in tab item tab.add_widget(self.MainBx)
layout_pai = BoxLayout(orientation='vertical') # Box que recebe todos os box box_label = BoxLayout() # Box que recebe a Label de título box_label.size_hint = 1, 0.2 box_meio = BoxLayout( orientation='vertical' ) # Box que recebe o boxgrid dos radioButtom e o box do spin box_resumo = BoxLayout( orientation='vertical' ) # Recebe a Label que mostrará o resumo do cliente selecionado box_check = GridLayout() # Agrupa os radioButtom box_check.cols = 3 box_check.size_hint = 1, 0.5 box_spin = BoxLayout() # Box do spin box_spin.size_hint = 1, 0.5 box_bt = BoxLayout() # Box dos botões box_bt.size_hint = 1, 0.37 # Label título ======================================== label = Label() label.size_hint = 0.5, 1.5 label.text = 'Gerenciador de clientes e pedidos' # Label resumo ========================================
def build(self): #*******ROOTWIDGET******* layout = GridLayout(rows=2) #*******SUB-WIDGETS******* layoutTop = GridLayout(cols=3,rows=1)#SUB-WIDGET-1 layoutTop.size_hint = (1, 0.1) layoutMid = GridLayout(cols=1, size_hint_x=1)#SUB-WIDGET-2 #*******CONTENT-OF-SUB-WIDGET-1******* backbtn = Button() title = Label(text = 'Pro-Forma App', font_size = '20sp', pos = (0,300), size_hint_y = None,size_hint_x=None, width=200, halign ='right', valign='middle') title.size_hint = (None, 0.1) dropbtn = Button() #*******CONTENT-OF-SUB-WIDGET-2******* tp_panel = TabbedPanel() tp_panel.default_tab_text = "Login Tab" #*******TAB1******* th_tab1 = TabbedPanelHeader(text = 'Pro-Forma') #*******MAIN-LAYOUT-FOR-TAB1******* mainlayout = GridLayout(cols=1, spacing=10) #*******LAYOUT-FOR-PROPERTY-INFORMATION******* layouttab1 = GridLayout(cols=2,rows=6, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40) #*******LAYOUT-FOR-UNIT-MIX******* layoutmix = GridLayout(cols=4, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40) #*******LAYOUT-FOR-EXPENSES******* layoutexpense = GridLayout(cols=2) #*******LAYOUT-FOR-ACCOUNTS******* #*******CONTENT1******* mainlayout.add_widget(Label(text='Property Information',size_hint_y=None, height=50)) #*******CONTENT2******* layouttab1.add_widget(Label(text= 'Property Name', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Property Address', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Town/City', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Asking Price', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Total Units', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Square Footage', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) mainlayout.add_widget(layouttab1) #*******CONTENT3******* mainlayout.add_widget(Label(text='Unit Mix',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT4******* layoutmix.add_widget(Label(text='# of Units')) layoutmix.add_widget(Label(text='Unit Type')) layoutmix.add_widget(Label(text='SquareFeet')) layoutmix.add_widget(Label(text='Monthly Rent')) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) mainlayout.add_widget(layoutmix) #*******CONTENT5******* mainlayout.add_widget(Label(text='Expenses',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT6******* layoutexpense.add_widget(Label(text='Accounting')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Advertising')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Bank Charges')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Electricity')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Gas')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Security')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='All insurance')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Permits and fees')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Maintenance')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Trash Pick-up')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='All other')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) mainlayout.add_widget(layoutexpense) #*******CONTENT7******* mainlayout.add_widget(Label(text='Accounts')) #*******CONTENT7******* #*******SCOLLABILITY******* #*******CALLING-MAINLAYOUT-IN-TAB1******* th_tab1.content = mainlayout #___*******TAB2*******___# th_tab2 = TabbedPanelHeader(text = 'Info. Tab') #___*******TAB3*******___# th_tab3 = TabbedPanelHeader(text = 'Due Deligence') #___*******TAB4*******___# th_tab4 = TabbedPanelHeader(text = 'Saved Reports') #*******CALLING-TABS-TO-tp_panel******* tp_panel.add_widget(th_tab1) tp_panel.add_widget(th_tab2) tp_panel.add_widget(th_tab3) tp_panel.add_widget(th_tab4) #*******ADDING-CONTENTS-OF-SUB-WIDGETS******* layoutTop.add_widget(backbtn) layoutTop.add_widget(title) layoutTop.add_widget(dropbtn) layoutMid.add_widget(tp_panel) #*******ADDING-CONTENTS-OF-ROOT-WIDGET******* layout.add_widget(layoutTop) layout.add_widget(layoutMid) #*******CALLING-THE-ROOT-WIDGET******* return layout
def new_back(self): # Popup for changing backgrounds val = '180dp' self.popup = Popup(title='Choose background', auto_dismiss=True, size_hint=(0.95, 0.62), separator_color=(0, 0, 1, 1), title_align='center', title_color=(1, 1, 1, 1), title_size='16sp', title_font='fonts/Fcarbim.ttf') scroll = ScrollView() scroll.size_hint = (1, 1) scroll.do_scroll_x = False scroll.do_scroll_y = True grd = GridLayout(cols=3, spacing='3dp') grd.size_hint = (1, None) grd.bind(minimum_height=grd.setter('height')) but1 = ImageButton( source='boc/BackOfCards.png', on_release=lambda x: self.receive('boc/BackOfCards.png'), size_hint=(1, None), height=val) but2 = ImageButton( source='boc/BackOfCards1.png', on_release=lambda x: self.receive('boc/BackOfCards1.png'), size_hint=(1, None), height=val) but3 = ImageButton( source='boc/BackOfCards2.png', on_release=lambda x: self.receive('boc/BackOfCards2.png'), size_hint=(1, None), height=val) but4 = ImageButton( source='boc/BackOfCards3.png', on_release=lambda x: self.receive('boc/BackOfCards3.png'), size_hint=(1, None), height=val) but5 = ImageButton( source='boc/BackOfCards4.png', on_release=lambda x: self.receive('boc/BackOfCards4.png'), size_hint=(1, None), height=val) but6 = ImageButton( source='boc/BackOfCards5.png', on_release=lambda x: self.receive('boc/BackOfCards5.png'), size_hint=(1, None), height=val) grd.add_widget(but1) grd.add_widget(but2) grd.add_widget(but3) grd.add_widget(but4) grd.add_widget(but5) grd.add_widget(but6) scroll.add_widget(grd) self.popup.add_widget(scroll) self.popup.open()
def build(self): #*******THE-ROOT-WIDGET****** root = GridLayout(cols=1, rows=2, spacing=10) #*******CHILDREN-OF-ROOT-WIDGET****** layouttop = GridLayout(cols=3, rows=1) layouttop.size_hint = (1, 0.1) layoutmid = GridLayout(cols=1, spacing=10) #******CHILDREN-OF-LAYOUTTOP****** menubtn = Button() menubtn.size_hint = (0.1, 0.1) head = Label(text='PRO-FORMA',size_hint_y = None,size_hint_x=None, width=200) head.size_hint = (0.8, 0.1) backbtn = Button() backbtn.size_hint = (0.1, 0.1) #******CHILDREN-OF-LAYOUTMID****** tp_panel = TabbedPanel() #___*******TAB1*****************************___# th_tab1 = TabbedPanelHeader(text = 'Info. Tab') layoutinfo = GridLayout(rows=2) layoutinfo.add_widget(Label(text='Powered by kivy')) #*******CALLING-SUB-WIDGETS-TAB2****** th_tab1.content = layoutinfo tp_panel.add_widget(th_tab1) #___*******TAB2*****************************___# th_tab2 = TabbedPanelHeader(text = 'Pro-Forma') #******children-of-tab1****** scroll = ScrollView(size_hint=(None, None), size=(800, 1000), pos_hint={'center_x':1,'center_y':1}) mainlayout = GridLayout(cols = 1, spacing = 10, size_hint_y=None) mainlayout.bind(minimum_height=mainlayout.setter('height')) #children-of-main-layout layouttab1 = GridLayout(cols=2, pos_hint ={'center_x': 1, 'center_y': 1},row_force_default=True, row_default_height=40, size_hint_y=None, height = 250) layoutmix = GridLayout(cols=4, pos_hint ={'center_x': 1, 'center_y': 1},row_force_default=True, row_default_height=40 ,size_hint_y=None, height = 80) layoutexpense = GridLayout(cols=2, pos_hint ={'center_x': 1, 'center_y': 1},row_force_default=True, row_default_height=40, size_hint_y=None, height = 1000) layoutacc = GridLayout(cols=1, pos_hint ={'center_x': 1, 'center_y': 1},row_force_default=True, row_default_height=40, size_hint_y=None, height = 250) #******CONTENT1******* mainlayout.add_widget(Label(text='Property Information',size_hint_y=None, height=50)) #*******CONTENT2******* layouttab1.add_widget(Label(text= 'Property Name', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Property Address', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Town/City', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Asking Price', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Total Units', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) layouttab1.add_widget(Label(text= 'Square Footage', size_hint_x=None, width=200,size_hint_y=None, height=50, font_size='20sp')) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle')) mainlayout.add_widget(layouttab1) #*******CONTENT3******* mainlayout.add_widget(Label(text='Unit Mix',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT4******* layoutmix.add_widget(Label(text='# of Units')) layoutmix.add_widget(Label(text='Unit Type')) layoutmix.add_widget(Label(text='SquareFeet')) layoutmix.add_widget(Label(text='Monthly Rent')) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) mainlayout.add_widget(layoutmix) #*******CONTENT5******* mainlayout.add_widget(Label(text='Expenses',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT6******* layoutexpense.add_widget(Label(text='Accounting')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Advertising')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Bank Charges')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Electricity')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Gas')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Security')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='All insurance')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Permits and fees')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Maintenance')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Trash Pick-up')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='All other')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) mainlayout.add_widget(layoutexpense) #*******CONTENT7******* mainlayout.add_widget(Label(text='Accounts',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT8layoutacc layoutacc.add_widget(Label(text='Select your financing type')) mainlayout.add_widget(layoutacc) #*******CALLING-SUB-WIDGETS-TAB2****** scroll.add_widget(mainlayout) th_tab2.content = scroll tp_panel.add_widget(th_tab2) #___*******TAB3*******___# th_tab3 = TabbedPanelHeader(text = 'Saved Reports') #*******CALLING-SUB-WIDGETS-TAB3****** tp_panel.add_widget(th_tab3) #******CALLING-WIDGETS****** layouttop.add_widget(menubtn) layouttop.add_widget(head) layouttop.add_widget(backbtn) layoutmid.add_widget(tp_panel) root.add_widget(layouttop) root.add_widget(layoutmid) #******RETURN-ROOT****** return root
def build(self): #*******ROOTWIDGET******* layout = GridLayout(rows=2) #*******SUB-WIDGETS******* layoutTop = GridLayout(cols=3,rows=1)#SUB-WIDGET-1 layoutTop.size_hint = (1, 0.1) layoutMid = FloatLayout()#SUB-WIDGET-2 layoutMid.size_hint = (1, 1) #*******CONTENT-OF-SUB-WIDGET-1******* menubtn = Button(text='Menu') menubtn.size_hint = (0.1, 0.1) head = Label(text='PRO-FORMA',size_hint_y = None,size_hint_x=None, width=200) head.size_hint = (0.8, 0.1) backbtn = Button(text='Drop') backbtn.size_hint = (0.1, 0.1) #dropbtn = Button() #*******CONTENT-OF-SUB-WIDGET-2******* tp_panel = TabbedPanel() tp_panel.default_tab_text = "Global News" layoutnews = GridLayout(rows=2) upperlayout = GridLayout(cols=3, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40, size_hint_y=None, height = 50, size_hint_x=1) lowerlayout = GridLayout(row=1) upperlayout.add_widget(Button(text='S', size_hint=(0.1, None))) upperlayout.add_widget(TextInput(text='search', size_hint=(0.8, None), focus=True, multiline=False)) upperlayout.add_widget(Button(text='settings', size_hint=(0.1, None))) lowerlayout.add_widget(Label()) layoutnews.add_widget(upperlayout) layoutnews.add_widget(lowerlayout) tp_panel.default_tab_content = layoutnews #*******TAB1******* th_tab1 = TabbedPanelHeader(text = 'Pro-Forma') #*******SCROLLABILITY-WIDGET******* scroll = ScrollView(size_hint=(1, None), size=(800, 1000)) mainlayout = GridLayout(cols = 1, spacing = 10, size_hint_y=None, size_hint_x=1) mainlayout.bind(minimum_height=mainlayout.setter('height')) #*******LAYOUT-FOR-PROPERTY-INFORMATION******* layouttab1 = GridLayout(cols=2,rows=6, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40, size_hint_y=None, height = 250, size_hint_x=1) #*******LAYOUT-FOR-UNIT-MIX******* layoutmix = GridLayout(cols=4, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40,size_hint_y=None, height = 80) #*******LAYOUT-FOR-EXPENSES******* layoutexpense = GridLayout(cols=2, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40, size_hint_y=None, height = 960) #*******LAYOUT-FOR-ACCOUNTS******* layoutacc = GridLayout(cols=2, pos_hint ={'center_x': .5, 'center_y': .5},row_force_default=True, row_default_height=40,size_hint_y=None, height = 240) #*******CONTENT1***** mainlayout.add_widget(Label(text='Property Information',size_hint=(None, 1))) #*******CONTENT2******* layouttab1.add_widget(Label(text= 'Property Name', font_size=15, size_hint=(0.4, None))) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle',size_hint=(0.6, None),multiline=False, focus=True)) layouttab1.add_widget(Label(text= 'Property Address', font_size=15, size_hint=(0.4, None))) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle',size_hint=(0.6, None),multiline=False, focus=True)) layouttab1.add_widget(Label(text= 'Town/City', font_size=15, size_hint=(0.4, None))) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle',size_hint=(0.6, None),multiline=False, focus=True)) layouttab1.add_widget(Label(text= 'Asking Price', font_size=15, size_hint=(0.4, None))) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle',size_hint=(0.6, None),multiline=False, focus=True)) layouttab1.add_widget(Label(text= 'Total Units', font_size=15, size_hint=(0.4, None))) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle',size_hint=(0.6, None),multiline=False, focus=True)) layouttab1.add_widget(Label(text= 'Square Footage', font_size=15, size_hint=(0.4, None))) layouttab1.add_widget(TextInput(text='input', font_size=15, halign ='left', valign='middle',size_hint=(0.6, None),multiline=False, focus=True)) mainlayout.add_widget(layouttab1) #*******CONTENT3******* mainlayout.add_widget(Label(text='Unit Mix',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT4******* layoutmix.add_widget(Label(text='# of Units')) layoutmix.add_widget(Label(text='Unit Type')) layoutmix.add_widget(Label(text='SquareFeet')) layoutmix.add_widget(Label(text='Monthly Rent')) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) layoutmix.add_widget(TextInput(text='Input', font_size=15)) mainlayout.add_widget(layoutmix) #*******CONTENT7******* mainlayout.add_widget(Label(text='Accounts',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT7******* layoutacc.add_widget(Label(text='Purchase Price')) layoutacc.add_widget(TextInput(text='Input')) layoutacc.add_widget(Label(text='Deposit')) layoutacc.add_widget(TextInput(text='Input')) layoutacc.add_widget(Label(text='Loan Amount')) layoutacc.add_widget(TextInput(text='Input')) layoutacc.add_widget(Label(text='Annual Interest')) layoutacc.add_widget(TextInput(text='Input')) layoutacc.add_widget(Label(text='Period')) layoutacc.add_widget(TextInput(text='Input')) layoutacc.add_widget(Label(text='Total Cash Outlay')) layoutacc.add_widget(TextInput(text='Input')) mainlayout.add_widget(layoutacc) #*******CONTENT5******* mainlayout.add_widget(Label(text='Expenses',size_hint_x=None, width=200, size_hint_y=None, height=50)) #*******CONTENT6******* layoutexpense.add_widget(Label(text='Accounting')) layoutexpense.add_widget(TextInput(text='Input', font_size=15,)) layoutexpense.add_widget(Label(text='Advertising')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Bank Charges')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Electricity')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Gas')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Security')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='All insurance')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Permits and fees')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Maintenance')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='Trash Pick-up')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) layoutexpense.add_widget(Label(text='All other')) layoutexpense.add_widget(TextInput(text='Input', font_size=15)) mainlayout.add_widget(layoutexpense) #*******CALLING-MAINLAYOUT-IN-TAB1******* scroll.add_widget(mainlayout) th_tab1.content = scroll tp_panel.add_widget(th_tab1) #___*******TAB3*******___# th_tab3 = TabbedPanelHeader(text = 'Saved Reports') tp_panel.add_widget(th_tab3) #*******ADDING-CONTENTS-OF-SUB-WIDGETS******* layoutTop.add_widget(menubtn) layoutTop.add_widget(head) layoutTop.add_widget(backbtn) layoutMid.add_widget(tp_panel) #*******ADDING-CONTENTS-OF-ROOT-WIDGET******* layout.add_widget(layoutTop) layout.add_widget(layoutMid) #*******CALLING-THE-ROOT-WIDGET******* return layout
def build(self): chord_list = [ 'C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B', 'Cm', 'Dbm', 'Dm', 'Ebm', 'Em', 'Fm', 'Gbm', 'Gm', 'Abm', 'Am', 'Bbm', 'Bm' ] #box layout, root of all layouts root = BoxLayout(orientation='vertical') #grid layout for top half of the screen top_grid = GridLayout(cols=3) #grid_layout for buttons on side button_group = GridLayout(rows=4) #start button to start playing playlist start = Button(text='START') start.bind(on_press=self.play_playlist) start.background_color = (1, 2.55, 1, 1) button_group.add_widget(start) #clear button to clear the playlist clear = Button(text='CLEAR') clear.bind(on_press=self.clear_playlist) clear.background_color = (2.55, 1, 1, 1) button_group.add_widget(clear) #text box saying "demo mode" text = Label(text="Demo \nMode") #check box to determine whether or not the app is in 'demo' mode checkbox = CheckBox() checkbox.active = self.is_demo checkbox.bind(active=self.in_demo_mode) checkbox.size_hint = (.5, .5) checkbox.color = (2.55, 2.55, 2.55, 1) button_group.add_widget(text) button_group.add_widget(checkbox) button_group.size_hint = (.2, .2) #grid layout for chord suggestions suggestions_layout = GridLayout(rows=2, cols=2) for i in range(0, 4): temp = Button() self.suggestions.append(temp) suggestions_layout.add_widget(temp) temp.bind(on_press=self.select_chord) #grid layout for playlist playlist_layout = GridLayout(rows=1) #setting up playlist buttons for i in range(0, 8): temp = Button() self.playlist_buttons.append(temp) playlist_layout.add_widget(temp) #grid defining chord keyboard bottom_grid = GridLayout(cols=12) #list of all buttons in chord keyboard buttons = [] for chord in chord_list: temp = Button(text=chord) buttons.append(temp) temp.background_color = (self.chord_color_map[chord]) bottom_grid.add_widget(temp) temp.bind(on_release=self.select_chord) top_grid.add_widget(button_group) top_grid.add_widget(playlist_layout) top_grid.add_widget(suggestions_layout) root.add_widget(top_grid) root.add_widget(bottom_grid) bottom_grid.size_hint = (1, .70) return root