def __init__(self, *args, **kwargs): super(Employees, self).__init__(orientation="vertical") # kontent aplikace global app app = App.get_running_app() rolovaci = ScrollView() self.list = MDList() self.db = Database(dbtype='sqlite', dbname='firmy.db') self.vypis_prepis() rolovaci.add_widget(self.list) self.add_widget(rolovaci) #Tlačítko pro vytvoření nové firmy button1 = MDFlatButton() button1.text = "NOVÁ FIRMA" button1.size_hint = (0, .1) button1.font_style = "Button" button1.on_release = self.create_firma self.add_widget(button1) button2 = MDFlatButton() button2.text = "NOVÝ ZAMĚSTNANEC" button2.size_hint = (0, .1) button2.font_style = "Button" button2.on_release = self.create_zamestnanec self.add_widget(button2)
def __init__(self, *args, **kwargs): super(Animals, self).__init__(orientation="vertical") global app app = App.get_running_app() scrollview = ScrollView() self.list = MDList() self.database = Database(dbtype='sqlite', dbname='animals.db') self.rewrite_list() scrollview.add_widget(self.list) self.add_widget(scrollview) button_box = BoxLayout(orientation='horizontal', size_hint_y=0.1) #button 1 btn_animal = MDFlatButton() btn_animal.text = "Add new animal" btn_animal.font_style = "Button" btn_animal.on_release = self.on_create_animal # button 2 btn_type = MDFlatButton() btn_type.text = "Add new animal type" btn_type.font_style = "Button" btn_type.on_release = self.on_create_type button_box.add_widget(btn_animal) button_box.add_widget(btn_type) self.add_widget(button_box)
def __init__(self, **kwargs): super(OneUIHeaders, self).__init__(**kwargs) self.rows = 2 self.spacing = 5 self.__headers.orientation = "vertical" self.md_bg_color = [0.3, 0.3, 0.1, 1] __add_new = MDFlatButton() __add_new.text = "Add New" __add_new.bind(on_release=lambda x: self.add()) super().add_widget(self.__headers) super().add_widget(__add_new)