def setLayout(self): self.size = (1500, 1000) with self.canvas: Color(.532345, 1.0, .742, 1.0) Rectangle(size=self.size) sound_board_layout = AnchorLayout() sound_board_layout.anchor_x = "center" sound_board_layout.anchor_y = "top" sound_board_layout.size = self.size sound_board_layout.pos = self.pos sound_board_layout.size_hint = (1.0, 1.0) sound_board_layout.spacing = 50 self.title_layout.orientation = "vertical" self.title_layout.size_hint = (1.0, 1.0) self.title_layout.spacing = 10 title_label = Label() title_label.text = "Soundboard" title_label.color = [.6, .2, 1, .5] title_label.font_size = 50 title_label.font_name = "C:\\Windows\\Fonts\\Arial" title_label.size_hint = (1, 1) self.title_layout.add_widget(title_label) self.set_settings_layout() self.set_sounds() self.title_layout.add_widget(self.grid_layout) sound_board_layout.add_widget(self.title_layout) self.add_widget(sound_board_layout)
def __init__(self, app, parent, title, **kw): logging.info('PysolAboutDialog:') super(PysolAboutDialog, self).__init__() self._url = kw['url'] logging.info('PysolAboutDialog: txt=%s' % title) text = kw['text'] text = text + '\n' + self._url logging.info('PysolAboutDialog: txt=%s' % text) text = text + '\n\n' + 'Adaptation to Kivy/Android\n' + \ ' Copyright (C) (2016-17) LB' self.parent = parent self.app = app self.window = None self.running = False self.status = 1 # -> von help.py so benötigt self.button = 0 # -> von help.py so benötigt # bestehenden Dialog rezyklieren. logging.info('PysolAboutDialog: 1') onlyone = PysolAboutDialog.AboutDialog if (onlyone and onlyone.running): return if (onlyone): onlyone.parent.pushWork('AboutDialog', onlyone.window) onlyone.running = True return # neuen Dialog aufbauen. window = LTopLevel(parent, title, size_hint=(1.0, 1.0)) window.titleline.bind(on_press=self.onClick) self.parent.pushWork('AboutDialog', window) self.window = window self.running = True PysolAboutDialog.AboutDialog = self if kw['image']: image = LImage(texture=kw['image'].texture) image.size_hint = (1, 0.8) al = AnchorLayout() al.add_widget(image) al.size_hint = (1, 0.3) window.content.add_widget(al) label = FText(text=text, halign='center', size_hint=(1, 1)) window.content.add_widget(label) '''
def initPopup(self, instance): #Structuring the interface and adding the labels and text fields content = GridLayout() content.cols = 1 inside = GridLayout() content.add_widget(inside) inside.cols = 2 labelIP = BoxLayout() labelIP.width = 70 labelIP.size_hint_x = None labelIP.add_widget(Label(text="IP:")) inside.add_widget(labelIP) ipGrid = BoxLayout() inside.add_widget(ipGrid) for ipGrid.i in self.ip: tmp = AnchorLayout(anchor_x='center', anchor_y='center') ipGrid.add_widget(tmp) ipGrid.i.size_hint = (1, 0.45) tmp.add_widget(ipGrid.i) labelPort = BoxLayout() labelPort.width = 70 labelPort.size_hint_x = None labelPort.add_widget(Label(text="Port:")) inside.add_widget(labelPort) tmp = AnchorLayout(anchor_x='center', anchor_y='center') inside.add_widget(tmp) self.port.size_hint = (0.5, 0.45) tmp.add_widget(self.port) labelPass = BoxLayout() labelPass.width = 70 labelPass.size_hint_x = None labelPass.add_widget(Label(text="Password")) inside.add_widget(labelPass) tmp = AnchorLayout(anchor_x='center', anchor_y='center') inside.add_widget(tmp) self.password.size_hint = (1, 0.45) tmp.add_widget(self.password) #Adding submit button at the bottom of the popup window btnLay = AnchorLayout(anchor_x='center', anchor_y='center') btnLay.size_hint = (1, 0.2) content.add_widget(btnLay) btnLay.submitIPBtn = Button(text="Submit", font_size=0.025 * 720, size_hint=(0.4, 0.9)) btnLay.submitIPBtn.bind(on_release=self.submitIP) btnLay.add_widget(btnLay.submitIPBtn) self.popupWindow = Popup( title="Enter ip, port and password to access.", content=content, size_hint=(0.8, 0.6))