Пример #1
0
 def build(self):
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     model1 = bandcl.Model("Burgh")
     model2 = bandcl.Model("Zerbigh")
     model1.set_combat(4)
     model1.add_capacity(capa_list[3])
     model2.set_quality(2)
     model2.add_capacity(capa_list[38])
     liste = []
     mainwin = SelectPopup(capa_list)
     return mainwin
Пример #2
0
 def build(self):
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     model1 = bandcl.Model("Burgh")
     model2 = bandcl.Model("Zerbigh")
     model1.set_combat(4)
     model1.add_capacity(capa_list[3])
     model2.set_quality(2)
     model2.add_capacity(capa_list[38])
     band = bandcl.Band("My Band")
     band.add_model(model1)
     band.add_model(model2)
     page = MyCollectionPage(band, capa_list)
     return page
Пример #3
0
 def build(self):
     model = bandcl.Model("Burgh")
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     model.set_combat(4)
     model.add_capacity(capa_list[3])
     model.add_capacity(capa_list[38])
     return ModelEditor(model, capa_list)
Пример #4
0
 def build(self):
     capa_list = bandcl.load_capacities_from_file("data/list_capa.txt")
     band = bandcl.Band("Les Zinzins")
     model1 = bandcl.Model("Burgh")
     model2 = bandcl.Model("Zerbigh")
     model1.set_combat(4)
     model1.add_capacity(capa_list[3])
     model2.set_quality(2)
     model2.add_capacity(capa_list[38])
     band.add_model(model1)
     band.add_model(model2)
     band2 = bandcl.Band("hehe")
     band3 = bandcl.Band("Waaaaagh")
     band2.add_model(model1)
     band3.add_model(model2)
     band_list = [band, band2, band3, band, band2, band3, band, band2, band3]
     page = BandPage(band_list, capa_list)
     return page
Пример #5
0
    def __init__(self, band, capa_list, **kwargs):
        super(MyCollectionPage, self).__init__(**kwargs)
        self.padding = [10, 0, 10, 10]
        self.band = band
        self.fill_collection_layout()
        self.ids.but_add_model.bind(on_press=self.create_model)

        self.model_editor_view = gui_modelmaker.ModelEditor(
            bandcl.Model("New Model"), capa_list)
        self.popup_model_editor = Popup(title='Edit Model')
        self.popup_model_editor.add_widget(self.model_editor_view)

        self.model_editor_view.bind(
            on_ok_clicked=self.close_popup_model_editor)

        # create event for external
        self.register_event_type('on_band_change')
Пример #6
0
class GuiModelApp(App):
    models_wid = GridLayout(cols=1, spacing=10, padding=[0, 10, 0, 10], size_hint=[1, None])
    my_mod = bandcl.Model("Barbare")
    ind = 0
    listc = bandcl.load_capacities_from_file("data/list_capa.txt")

    # FONCTION DE TEST
    def add_mdl(self, instance):
        self.my_mod.add_capacity(self.listc[self.ind])
        self.ind += 1
        self.models_wid.add_widget(
            EditModelLayout(self.my_mod))
        self.models_wid.height = self.models_wid.height + 120

    def build(self):
        main_win = ScrollView()
        add_mdl_but = Button(text="Add model...", height=50, size_hint=[1, None], on_press=self.add_mdl)
        self.models_wid.add_widget(add_mdl_but)
        self.models_wid.height = 70
        main_win.add_widget(self.models_wid)
        return main_win
Пример #7
0
 def on_popup_return(self, popup, *args):
     self.sel_layout.dismiss()
     new_model = bandcl.Model()
     new_model.copy_model(popup.item_selected)
     self.model_lay.add_model(new_model)
     self.update_display_band(self.band)
Пример #8
0
 def copy_model(self, instance, model_src):
     new_model = bandcl.Model("")
     new_model.copy_model(model_src)
     self.add_model(new_model)
     self.dispatch('on_band_change')
Пример #9
0
 def create_model(self, instance):
     new_model = bandcl.Model("New Model")
     self.add_model(new_model)
     self.edit_model(instance, new_model)
     self.dispatch('on_band_change')