示例#1
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)

        # Prepare the display areas
        self.gameboard = BoardDisplay(board=self.game.board,
                                      size_hint=(4, 1))
        self.round_counter = RoundCounter(round_number=self.game.round,
                                          max_round=GameSettings.NUM_ROUNDS,
                                          size_hint=(1, .075))
        self.scoreboard = ScoreDisplay(scoreboard=self.game.score,
                                       size_hint=(1, .4))
        self.tooltip = ToolTipDisplay(size_hint=(1, .5))
        self.hand_display = HandDisplay(hand=self.game.players[PLAYER],
                                        size_hint=(1, .3))

        # Lay out the display
        main = BoxLayout(orientation="vertical")
        layout = BoxLayout()
        layout.add_widget(self.gameboard)
        sidebar = BoxLayout(orientation="vertical")
        sidebar.add_widget(self.round_counter)
        sidebar.add_widget(self.scoreboard)
        sidebar.add_widget(self.tooltip)
        layout.add_widget(sidebar)
        main.add_widget(layout)
        main.add_widget(self.hand_display)
        self.add_widget(main)
示例#2
0
    def __init__(self, name=""):
        Screen.__init__(self, name=name)

        self.layout = FloatLayout()

        self.color = Label(text="Pick a Color or Animation",
                           pos_hint={'x': 0, 'y': .67},
                           size_hint=(1, .33),
                           font_size=32)

        self.animations = Button(text="Pick Animation",
                                 pos_hint={'x': 0, 'y': .34},
                                 size_hint=(1, .33),
                                 font_size=32)

        self.sliders = Button(text="Custom Color",
                              pos_hint={'x': 0, 'y': 0},
                              size_hint=(.5, .34),
                              font_size=32)

        self.main = Button(text="Return",
                           pos_hint={'x': .5, 'y': 0},
                           size_hint=(.5, .34),
                           font_size=32)

        self.main.bind(on_release=self.go_to_main)
        self.sliders.bind(on_release=self.go_to_sliders)
        self.animations.bind(on_release=self.go_to_anims)

        self.layout.add_widget(self.color)
        self.layout.add_widget(self.animations)
        self.layout.add_widget(self.sliders)
        self.layout.add_widget(self.main)

        self.add_widget(self.layout)
示例#3
0
 def __init__(self):
     Screen.__init__(self)
     self.name = 'file'
     
     self.file_chooser = FileChooserListView(path=os.getcwd())
     self.file_chooser.bind(on_submit=self.add_cards)
     self.add_widget(self.file_chooser)
示例#4
0
 def __init__(self):
     Screen.__init__(self)
     self.name = 'menu'
     self.config = ConfigParser()
     self.config.add_section("deck")
     self.config.add_section("card")
     self.config.adddefaultsection("menu")
     self.config.set("deck", "start_studying", 1)
     self.config.set("deck", "change_deck_mode", "Normal")
     self.config.set("deck", "show_list", True)
     self.config.set("deck", "undo", True)
     self.config.set("deck", "redo", True)
     self.config.set("card", "add", "")
     self.config.set("card", "edit", True)
     self.config.set("card", "remove", True)
     
     self.config.add_callback(self.check_deck_locks, "deck", "redo")
     self.config.add_callback(self.check_deck_locks, "deck", "undo")
     
     self.config.add_callback(self.check_card_locks, "card", "edit")
     self.config.add_callback(self.check_card_locks, "card", "add")
     
     
     self.menu = SettingsWithNoMenu()
     self.menu.register_type("screen", FlashcardAppManager.SettingNewScreen)
     self.menu.register_type("action", FlashcardAppManager.SettingDoAction)
     self.menu.add_json_panel("Flashcards", self.config, os.path.join(os.path.dirname(__file__), 'menu.json'))
     
     self.add_widget(self.menu)
示例#5
0
 def __init__(self, title, *args, **kwargs):
     """
         @title - tytul (nazwa) cwiczenia
     """
     Builder.load_file("kv/genericlevels.kv")
     Screen.__init__(self, *args, **kwargs)
     self.title = title
示例#6
0
    def __init__(self, player_file=None, **kwargs):
        Screen.__init__(self, **kwargs)        
        self.purchased = []
        if player_file is None:
            self._purchased_file = os.path.join("player", "backgrounds.txt")
        else: self._purchased_file = player_file
        self._read_purchased()
        self.purchased_cat = BackgroundCategory('Purchased')
        
        self.categories = []
        self._available_file = os.path.join("data", "Backgrounds.txt")
        self._read_available()

        layout = BoxLayout(orientation="vertical")
        layout.add_widget(ActionBar(size_hint=(1, .125)))
        scroller = ScrollView(do_scroll_x=False)
        self.grid = GridLayout(cols=1, size_hint_y=None)
        self.grid.add_widget(CategoryIcon(screen=self,
                                          category=self.purchased_cat))
        self.bind(size=self._resize_grid)
        for cat in self.categories:
            self.grid.add_widget(CategoryIcon(screen=self,
                                              category=cat))
        scroller.add_widget(self.grid)
        layout.add_widget(scroller)
        self.add_widget(layout)
示例#7
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     main = BoxLayout(orientation="vertical")
     main.add_widget(ActionBar(size_hint=(1, .125)))
     carousel = Carousel(direction='right')
     layout = GridLayout(rows=2)
     i, c = 0, 0
     for card in self.definition.cards(App.get_running_app().achievements,
                                       use_blocks=False):
         color = (1, 1, 1, 1)
         if str(card) in self.definition.blocked_cards:
             color = (.5, 0, 0, 1)
         layout.add_widget(CardSelect(card=card,
                                      color=color,
                                      callback=self._card_detail,
                                      args=(card,)))
         i += 1
         c += 1
         if i == 10:
             carousel.add_widget(layout)
             layout = GridLayout(rows=2)
             i = 0
     if c < 50 + len(self.definition.specials):
         layout.add_widget(CardSelect(card=self.LOCKED_CARD))
     carousel.add_widget(layout)
     main.add_widget(carousel)
     self.add_widget(main)
示例#8
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        self.tryout = StackLayout(orientation ='lr-bt') 
        self.floatt = FloatLayout()

        #variable for gettinginformation()
        self.counter = 0
        # Title of the screen
        self.floatt.add_widget(Label(text='[color=000000][size=40][font=yorkwhiteletter]EBOTS INFORMATION[/font][/size][/color]', size_hint=(0.5,0.2),markup=True,pos_hint={'x':0.05,'y':0.8}))
    
        #information on ebots with 'good' status 
        self.ebotgoodpic = Image(source='C:\Users\The Gt Zan\Pictures\ebotinfo.PNG')
        self.floatt.add_widget(self.ebotgoodpic)    

        #buttons at the bottom 
        self.switchtomenu = Button(text='[size=50][font=yorkwhiteletter][color=000000]MENU[/font][/size][/color]',markup=True, size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToMenu)
        self.switchtoebot = Button(text='[size=50][font=yorkwhiteletter][color=000000]EBOTS[/font][/size][/color]', markup=True,size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToebots)
        self.switchtopersonal = Button(text='[size=50][font=yorkwhiteletter][color=000000]INDIVIDUAL[/font][/size][/color]', markup=True,size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToPersonal)
        self.tryout.add_widget(self.switchtoebot)
        self.tryout.add_widget(self.switchtopersonal)
        self.tryout.add_widget(self.switchtomenu)

        #getting information 
        self.refresh=Button(text='[size=50][font=yorkwhiteletter][color=000000]REFRESH[/font][/size][/color]', markup = True, size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.gettinginformation)
        self.tryout.add_widget(self.refresh)

        #add layouts
        self.add_widget(self.tryout)
        self.add_widget(self.floatt)
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     self.layout = BoxLayout()
     # self.btnQuit = Button(text='Quit now!',on_press=app.quitApp)
     # self.add_widget(self.btnQuit)
     # Add your code below to add the two Buttons
     pass
示例#10
0
 def __init__(self,**kwargs):
     Screen.__init__(self,**kwargs)
     self.log = kwargs['log']
     
     self.status_display = None
     self.display_limit = 100
     self.visible = False
示例#11
0
	def __init__(self, n_procesadores, **kwargs):

		Builder.load_file(kwargs['archivo'])

		Screen.__init__(self, **kwargs)

		self.procesadores = None
		self.tabla_procesos = None
		self.popup_proceso = None

		self.inicializar(n_procesadores)

		self.tabla_procesos = self.tabla_procesos or TablaProcesosGUI(self.sistema.procesos)
		self.procesadores = self.procesadores or [ProcesadorGUI(p, self.tabla_procesos) for p in self.sistema.procesadores]
		
		self.popup_proceso = self.popup_proceso or ProcesoPopup(self.sistema)

		self.ids.titulo.text = "Simulacion para "+self.name
		
		self.popup_recurso = RecursoPopup(self.sistema)
		self.tabla_recursos = TablaRecursosGUI(self.sistema.recursos)

		self.ejecutando = False
		self.paso = False

		for p in self.procesadores:
			self.ids.procesadores.add_widget(p)

		self.c_procesos.add_widget(self.tabla_procesos)
		self.c_recursos.add_widget(self.tabla_recursos)

		self.sistema.asignar_vista(self)
示例#12
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     layout = BoxLayout(orientation="vertical")
     layout.add_widget(ActionBar(size_hint=(1, .125)))
     settings = SettingsWithNoMenu(size_hint=(1, .875))
     App.get_running_app().build_settings(settings)
     layout.add_widget(settings)
     self.add_widget(layout)
示例#13
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     layout = BoxLayout(orientation="vertical")
     layout.add_widget(ActionBar(size_hint=(1, .125)))
     self.main = StatisticsDisplay(statistics=self.statistics,
                                   deck=App.get_running_app().loaded_deck)
     layout.add_widget(self.main)
     self.add_widget(layout)
示例#14
0
 def __init__(self):
     Screen.__init__(self)
     self.name = 'deck'
     self.box_layout = BoxLayout(size=Window.size)
     self.add_widget(self.box_layout)
     
     FlashcardAppManager.deck_widget = DeckWidget()
     self.box_layout.add_widget(FlashcardAppManager.deck_widget)
示例#15
0
    def __init__(self, name="", custom_manager=None):
        Screen.__init__(self, name=name)

        self.current_page = 1

        self.obd_manager = custom_manager

        self.layout = FloatLayout()

        self.values = [Label(text="OBD", size_hint=(.5, .30), pos_hint={'x': 0, 'y': .6}, font_size=32),

                       Label(text="OBD2", size_hint=(.5, .30),
                             pos_hint={'x': .5, 'y': .6}, font_size=32),

                       Label(text="OBD3", size_hint=(.5, .30),
                             pos_hint={'x': 0, 'y': .20}, font_size=32),

                       Label(text="OBD4", size_hint=(.5, .30),
                             pos_hint={'x': .5, 'y': .20}, font_size=32)
                       ]

        self.types = [Label(text="FILLER",
                            size_hint=(.5, .1),
                            pos_hint={'x': 0, 'y': .9},
                            font_size=32),

                      Label(text="FILLER",
                            size_hint=(.5, .1),
                            pos_hint={'x': .5, 'y': .9},
                            font_size=32),

                      Label(text="FILLER",
                            size_hint=(.5, .1),
                            pos_hint={'x': 0, 'y': .5},
                            font_size=32),

                      Label(text="FILLER",
                            size_hint=(.5, .1),
                            pos_hint={'x': .5, 'y': .5},
                            font_size=32)
                      ]

        self.change = Button(
            text="Change OBD", size_hint=(.5, .20), pos_hint={'x': 0, 'y': 0}, font_size=32)
        self.main = Button(
            text="Return", size_hint=(.5, .20), pos_hint={'x': .5, 'y': 0}, font_size=32)

        self.change.bind(on_press=self.switch_commands)
        self.main.bind(on_release=self.go_to_parent)

        for i in range(4):
            self.layout.add_widget(self.values[i])
            self.layout.add_widget(self.types[i])

        self.layout.add_widget(self.change)
        self.layout.add_widget(self.main)

        self.add_widget(self.layout)
示例#16
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        Window.clearcolor=(1,1,1,1) #change master bg colour, RGB in .% , last is a binary: 1 = On, 0 = Off . Currently the colour is white
        #Layouts
        self.tryout = StackLayout(orientation ='lr-bt') #buttons would be placed from left to right first then bottom to top => the buttons would be stacked at the bottom from left to right first 
        self.floatt = FloatLayout() #free size 

        #variable for def gettinginformation()
        self.counter = 0 

        #title of the screen to be seen
        self.floatt.add_widget(Label(text='[color=000000][size=40][font=yorkwhiteletter]Last Screened Individual[/size][/font][/color]',size_hint= (0.5,0.2), halign='center',markup=True,pos_hint={'x':0.05,'y':0.8}))

        #information , left column. FIXED TEXT 
        '''x is moving left right, y is moving up and down
        0.0 for y is in the middle. to move down, use -ve 
        column of the table is fixed at x=0.2, or 0.2 left relative to floatlayout'''

        self.Lname=Label(text='[color=000000][size=40][font=Impact Label Reversed]Name\nBatch[/font][/size][/color]',markup = True,pos_hint={'x':-0.2,'y':0.1})
        self.Lid=Label(text='[color=000000][size=40][font=Impact Label Reversed]Card ID[/font][/size][/color]',markup = True,pos_hint={'x':-0.2,'y':0.0})
        self.Llocation = Label(text='[color=000000][size=40][font=Impact Label Reversed]Location[/font][/size][/color]',markup = True,pos_hint={'x':-0.2,'y':-0.1})
        self.Ltime=Label(text='[color=000000][size=40][font=Impact Label Reversed]Time\nDate[/font][/size][/color]',markup = True,pos_hint={'x':-0.2,'y':-0.2})

        self.floatt.add_widget(self.Lname)
        self.floatt.add_widget(self.Lid)
        self.floatt.add_widget(self.Ltime)
        self.floatt.add_widget(self.Llocation)
       
        #widgets to get information, depending on the card ID received, RHS column of information
        #currently made RHS columns contain a '-' to show no information is being displayed    
        self.namee = Label(text='[color=000000][size=40][font=Impact Label Reversed]-[/size][/font][/color]',halign='center',markup=True,pos_hint={'x':0.2,'y':0.1})
        self.Rid=Label(text='[color=000000][size=40][font=Impact Label Reversed]-[/size][/font][/color]',markup=True,pos_hint={'x':0.2,'y':0.0})
        self.Rlocation = Label(text='[color=000000][size=40][font=Impact Label Reversed]-[/size][/font][/color]',markup=True,pos_hint={'x':0.2,'y':-0.1})
        self.Rtime = Label(text='[color=000000][size=40][font=Impact Label Reversed]%s[/size][/font][/color]' %(time.strftime("%H:%M:%S\n%d/%m/%Y")),markup=True,pos_hint={'x':0.2,'y':-0.2})
        
        self.floatt.add_widget(self.namee)
        self.floatt.add_widget(self.Rid)
        self.floatt.add_widget(self.Rtime)
        self.floatt.add_widget(self.Rlocation)

        #fixed buttons at the bottom of the screen to navigate
        self.switchtomenu = Button(text='[size=50][font=yorkwhiteletter][color=000000]MENU[/font][/size][/color]',markup=True, size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToMenu)
        self.switchtoebot = Button(text='[size=50][font=yorkwhiteletter][color=000000]EBOTS[/font][/size][/color]', markup=True,size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToebots)
        self.switchtopersonal = Button(text='[size=50][font=yorkwhiteletter][color=000000]INDIVIDUAL[/font][/size][/color]', markup=True,size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.changeToPersonal)
        
        self.tryout.add_widget(self.switchtoebot)
        self.tryout.add_widget(self.switchtopersonal)
        self.tryout.add_widget(self.switchtomenu)

        # button to trigger gettinginformation 
        self.refresh=Button(text='[size=50][font=yorkwhiteletter][color=000000]REFRESH[/font][/size][/color]', markup = True, size_hint=(0.2,0.2),background_color=(1,1,1,0),on_press=self.gettinginformation)
        self.tryout.add_widget(self.refresh)

        #add layouts
        self.add_widget(self.tryout)
        self.add_widget(self.floatt)
示例#17
0
	def __init__(self, **kwargs):
		name = self.__class__.__name__
		self.name = name[:-6] if name.endswith('Screen') else name
		setattr(App.instance, name, lambda: App.instance.pushScreen(self.name))
		try:
			Logger.debug('NamedScreen: Loading %s.kv' % name)
			Builder.load_file(name + '.kv', rulesonly=True)
		except IOError:
			Logger.debug('NamedScreen: File %s.kv not found' % name)

		Screen.__init__(self, **kwargs)
 def __init__(self):
     Screen.__init__(self, name="main")
     li = LoginProvider.getLoginInformation()
     if li.SIS.use:
         LoginProvider.isSISLoginInfoValid(li.SIS, self.gotSIS, self.errorSIS)
     else:
         self.errorSIS(None)
     if li.LMS.use:
         LoginProvider.isLMSLoginInfoValid(li.LMS, self.gotLMS, self.errorLMS)
     else:
         self.errorLMS(None)
示例#19
0
文件: menu.py 项目: phiotr/DysDroid
    def __init__(self, *args, **kwargs):

        Builder.load_file("kv/menu.kv")
        Builder.load_file("kv/cards.kv")

        Screen.__init__(self, *args, **kwargs)

        self.prev_exercise_bt.bind(on_release=lambda bt: self.scroll_to_prev())
        self.next_exercise_bt.bind(on_release=lambda bt: self.scroll_to_next())

        self.goto_exercise_bt.bind(on_release=lambda bt: self.goto_exercise())
示例#20
0
 def __init__(self, screen_accept, screen_cancel, name):
     """Pantalla para cambiar el password actual"""
     self.scr_accept = screen_accept
     self.scr_cancel = screen_cancel
     self.data = {}
     self.data['fondo'] = controlador.get_images('fondo')
     self.data['aside'] = controlador.get_images('aside')
     self.data['footer'] = controlador.get_images('footer')
     self.cargar_datos()
     self.name = name
     Screen.__init__(self)
示例#21
0
    def __init__(self, list_of_track_images, **kwargs):
        Screen.__init__(self, **kwargs)
        self._read_images(list_of_track_images)

        self.looking_direction_x = 0
        self.looking_direction_y = 0
        self.eye_range_x = 120
        self.eye_range_y = 85
        self.eye_offset = 3

        self._display_texture()
示例#22
0
    def __init__(self,**kwargs):     
        Screen.__init__(self,**kwargs) 
        self.location = kwargs['location']
        self.name = kwargs['name']

        ttlLbl = ListScreenEntry()
        
        ttlLbl.addText('[size=24]'+str(self.name)+'[/size]')
        self.ids['entries'].add_widget(ttlLbl)
        
        
        '''testLbl = ListScreenEntry()
示例#23
0
    def __init__(self, achieved, **kwargs):
        Screen.__init__(self, **kwargs)

        deck = App.get_running_app().loaded_deck
        for achievement in achieved:
            if achievement.reward is None:
                ach = AchievementEarnedDisplay(achievement=achievement)
                self.ids.carousel.add_widget(ach)
                continue
            unlock = UnlockDisplay(achievement=achievement,
                                   reward=deck.get_special(achievement.reward))
            self.ids.carousel.add_widget(unlock)
 def __init__(self):
     LMS.reset()
     SIS.reset()
     Screen.__init__(self, name="login")
     li = LoginProvider.getLoginInformation()
     if li is not None:
         LoginProvider.deleteLoginInformation()
         self.ids.SIS_username.text = li.SIS.username
         self.ids.SIS_password.text = li.SIS.password
         self.ids.SIS_use.active = li.SIS.use
         self.ids.LMS_username.text = li.LMS.username
         self.ids.LMS_password.text = li.LMS.password
         self.ids.LMS_use.active = li.LMS.use
示例#25
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     self.carousel = Carousel(direction="right")
     standard = self.catalog["Lovers & Spies Deck"]
     self.carousel.add_widget(DeckDisplay(deck=standard, purchased=True))
     for deck in self.catalog:
         if deck == standard: continue
         purchased = self.catalog.purchased(deck) is not None
         self.carousel.add_widget(DeckDisplay(deck=deck, purchased=purchased))
                                  
     main = BoxLayout(orientation="vertical")
     main.add_widget(ActionBar())
     main.add_widget(self.carousel)
     self.add_widget(main)
示例#26
0
    def __init__(self, achievements, **kwargs):
        Screen.__init__(self, **kwargs)
        self.achievements = achievements

        layout = BoxLayout(orientation="vertical")
        layout.add_widget(ActionBar(size_hint=(1, .125)))
        scroller = ScrollView(do_scroll_x=False)
        self.main = main = GridLayout(cols=1, size_hint_y=None)
        main.bind(minimum_height=main.setter('height'))
        for achievement in achievements.available:
            main.add_widget(AchievementDisplay(achievement=achievement,
                                earned=(achievement in achievements.achieved)))
        scroller.add_widget(main)
        layout.add_widget(scroller)
        self.add_widget(layout)
示例#27
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        Window.clearcolor=(1,1,1,1) #Master background colour 
        self.layout=BoxLayout(orientation ='vertical', spacing = 10) #padding of 10 between the buttons

        # Welcome Screen Title
        self.title = Label(text='[size=60][font=Impact Label][color=000000]Welcome to[/color]\n[color=000000]R.I.O.T[/font] \n[font=yorkwhiteletter] RACCOON.INTERNET.OF.THINGS[/color][/size][/font]', halign='center', markup = True)
        self.layout.add_widget(self.title)
        
        #buttons
        #background_color is to remove the bg colour to make the button background transparent
        self.switchbutton = Button(text="[size=50][font=yorkwhiteletter][color=000000]ENTER[/color][/font][/size]", background_color=(1,1,1,0),size_hint = (0.2,0.2), pos_hint ={'x':0.4,'y': 0.0}, halign='center', markup = True ,on_press=self.changeToPersonal) #default change to the screen containing the personal information
        self.layout.add_widget(self.switchbutton)
        self.quitbutton = Button(text="[size=50][color=000000][font=yorkwhiteletter]QUIT[/font][/color][/size]" , background_color=(1,1,1,0),size_hint=[0.2,0.2], pos_hint=({'x':0.4,'y':0.0}), markup = True, on_press=self.quitApp)
        self.layout.add_widget(self.quitbutton)

        self.add_widget(self.layout)
示例#28
0
    def __init__(self, name="", custom_manager=None):
        Screen.__init__(self, name=name)

        self.layout = FloatLayout()

        self.led_manager = custom_manager

        self.anim1 = Button(text="Glow",
                            size_hint=(.5, .33),
                            pos_hint={'x': 0, 'y': .67},
                            font_size=32)

        self.anim2 = Button(text="Glimmer",
                            size_hint=(.5, .33),
                            pos_hint={'x': .5, 'y': .67},
                            font_size=32)

        self.anim3 = Button(text="Alternation",
                            size_hint=(.5, .33),
                            pos_hint={'x': 0, 'y': .34},
                            font_size=32)

        self.anim4 = Button(text="Bouncing Lazer",
                            size_hint=(.5, .33),
                            pos_hint={'x': .5, 'y': .34},
                            font_size=32)

        self.return_button = Button(text="Return",
                                    size_hint=(1, .34),
                                    pos_hint={'x': 0, 'y': 0},
                                    font_size=32)

        self.return_button.bind(on_press=self.go_back)

        self.anim1.bind(on_press=self.animation_callback)
        self.anim2.bind(on_press=self.animation_callback)
        self.anim3.bind(on_press=self.animation_callback)
        self.anim4.bind(on_press=self.animation_callback)

        self.layout.add_widget(self.anim1)
        self.layout.add_widget(self.anim2)
        self.layout.add_widget(self.anim3)
        self.layout.add_widget(self.anim4)
        self.layout.add_widget(self.return_button)

        self.add_widget(self.layout)
示例#29
0
 def __init__(self):
     Screen.__init__(self)
     self.name = "add"
     
     self.config = ConfigParser()
     self.config.add_section("add")
     self.config.set("add", "question", "Question")
     self.config.set("add", "answer", "Answer")
     self.config.set("add", "make", "action")
     self.config.add_callback(self.update_qa, section="add", key="question")
     self.config.add_callback(self.update_qa, section="add", key="answer")
     self.menu = SettingsWithNoMenu()
     
     
     self.menu.register_type("action", FlashcardAppManager.SettingDoAction)
     self.menu.add_json_panel("Add a card", self.config, os.path.join(os.path.dirname(__file__), 'add_menu.json'))
     
     self.add_widget(self.menu)
示例#30
0
    def __init__(self, level_number, rows, cols, cards_set, level_icon, table_name, Engine1=FlippCard, Engine2=FlippCard, notify_timeout=2, auto_play=False, allow_unselecting=False, n_and_w=False, custom_notify="", **kwargs):
        """
        Parametry:
            @rows - liczba wierszy
            @cols - liczba kolumn
            @cards_set - plik ze zbiorem kart do rozlosowania
            @level_icon - ikona trudności poziomu
            @CardEngine - pochodna klasy CardsWidget definiująca wygląd i zachowanie kart po kliknięciu
            @notify_timeout - czas widoczności dynku (w sekundach)
            @play - Czy zegar ma zostać uruchomiony zaraz po otwarciu okna
            @allow_unselecting - Zezwalanie na odznaczenie karty po ponownym naduszeniu
            @n_and_w - Jeśli ustawione na True, zostanie użyty pewien specjalny tryb losowania przykładów wyłącznie z pośród liczb, a nie z pliku jak w każdym innym przypadku
            @custom_confirm_msg - dodatkowy tekst wyswietlany w dymku po zaznaczeniu prawidlowej pary kart
        """

        Screen.__init__(self, **kwargs)

        self.level_number = level_number
        self.level_icon = level_icon
        self.table_name = table_name
        self.allow_unselecting = allow_unselecting

        # Ustawienia siatki kart
        self.card_grid_rows = rows
        self.card_grid_cols = cols

        # Określenie liczby par kart
        self.pairs_total = rows * cols // 2

        # Przygotowanie przykładów
        self._create_examples(self.pairs_total, cards_set, Engine1, Engine2, n_and_w)

        # Przygotowanie zegara
        self.timer.reset_clock()
        if auto_play:
            self.timer.start_clock()

        # Przygotowanie dymku z wiadomoscia
        self.notify_timeout = notify_timeout
        
        # Niestandardowa tresc dymku
        self.custom_notify = parse_word(custom_notify)
示例#31
0
 def __init__(self,  **kv):
     Screen.__init__(self,  **kv)
     self.main_app = kv['main_app'] 
示例#32
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
示例#33
0
 def __init__(self):
     Screen.__init__(self)
     self.game_layout = GameLayout()
     self.add_widget(self.game_layout)
     Window.size = (1200, 600)
示例#34
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     self.max = 30  # the number of recent messages to show
     self.reset()
示例#35
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        layout = FloatLayout(size=(10, 10))

        _90 = Button(text=" 90° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .35,
                         "center_y": .90
                     },
                     on_press=self.nine)
        layout.add_widget(_90)

        self.pic90 = Image(source='90.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.1,
                               "center_y": 0.90
                           })
        layout.add_widget(self.pic90)

        _80 = Button(text=" 80° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .35,
                         "center_y": .70
                     },
                     on_press=self.eight)
        layout.add_widget(_80)

        self.pic80 = Image(source='80.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.1,
                               "center_y": 0.70
                           })
        layout.add_widget(self.pic80)

        _70 = Button(text=" 70° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .35,
                         "center_y": .50
                     },
                     on_press=self.seven)
        layout.add_widget(_70)

        self.pic70 = Image(source='70.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.1,
                               "center_y": 0.50
                           })
        layout.add_widget(self.pic70)

        _60 = Button(text=" 60° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .35,
                         "center_y": .3
                     },
                     on_press=self.six)
        layout.add_widget(_60)

        self.pic60 = Image(source='60.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.1,
                               "center_y": 0.3
                           })
        layout.add_widget(self.pic60)

        _50 = Button(text=" 50° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .35,
                         "center_y": .1
                     },
                     on_press=self.five)
        layout.add_widget(_50)

        self.pic50 = Image(source='50.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.1,
                               "center_y": 0.1
                           })
        layout.add_widget(self.pic50)

        _40 = Button(text=" 40° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .9,
                         "center_y": .9
                     },
                     on_press=self.four)
        layout.add_widget(_40)

        self.pic40 = Image(source='40.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.65,
                               "center_y": 0.9
                           })
        layout.add_widget(self.pic40)

        _30 = Button(text=" 30° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .9,
                         "center_y": .7
                     },
                     on_press=self.three)
        layout.add_widget(_30)

        self.pic30 = Image(source='30.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.65,
                               "center_y": 0.7
                           })
        layout.add_widget(self.pic30)

        _20 = Button(text=" 20° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .9,
                         "center_y": .5
                     },
                     on_press=self.two)
        layout.add_widget(_20)

        self.pic20 = Image(source='20.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.65,
                               "center_y": 0.5
                           })
        layout.add_widget(self.pic20)

        _10 = Button(text=" 10° ",
                     font_size=24,
                     size_hint=(.2, .2),
                     pos_hint={
                         "center_x": .9,
                         "center_y": .3
                     },
                     on_press=self.one)
        layout.add_widget(_10)

        self.pic10 = Image(source='10.jpg',
                           size_hint=(.2, .2),
                           pos_hint={
                               "center_x": 0.65,
                               "center_y": 0.3
                           })
        layout.add_widget(self.pic10)

        _0 = Button(text=" 0° ",
                    font_size=24,
                    size_hint=(.2, .2),
                    pos_hint={
                        "center_x": .9,
                        "center_y": .1
                    },
                    on_press=self.zero)
        layout.add_widget(_0)

        self.pic0 = Image(source='0.jpg',
                          size_hint=(.2, .2),
                          pos_hint={
                              "center_x": 0.65,
                              "center_y": 0.1
                          })
        layout.add_widget(self.pic0)

        self.add_widget(layout)
示例#36
0
    def __init__(self, name="", custom_manager=None):
        Screen.__init__(self, name=name)

        self.current_page = 1

        self.obd_manager = custom_manager

        self.layout = FloatLayout()

        self.values = [
            Label(text="OBD",
                  size_hint=(.5, .30),
                  pos_hint={
                      'x': 0,
                      'y': .6
                  },
                  font_size=32),
            Label(text="OBD2",
                  size_hint=(.5, .30),
                  pos_hint={
                      'x': .5,
                      'y': .6
                  },
                  font_size=32),
            Label(text="OBD3",
                  size_hint=(.5, .30),
                  pos_hint={
                      'x': 0,
                      'y': .20
                  },
                  font_size=32),
            Label(text="OBD4",
                  size_hint=(.5, .30),
                  pos_hint={
                      'x': .5,
                      'y': .20
                  },
                  font_size=32)
        ]

        self.types = [
            Label(text="FILLER",
                  size_hint=(.5, .1),
                  pos_hint={
                      'x': 0,
                      'y': .9
                  },
                  font_size=32),
            Label(text="FILLER",
                  size_hint=(.5, .1),
                  pos_hint={
                      'x': .5,
                      'y': .9
                  },
                  font_size=32),
            Label(text="FILLER",
                  size_hint=(.5, .1),
                  pos_hint={
                      'x': 0,
                      'y': .5
                  },
                  font_size=32),
            Label(text="FILLER",
                  size_hint=(.5, .1),
                  pos_hint={
                      'x': .5,
                      'y': .5
                  },
                  font_size=32)
        ]

        self.change = Button(text="Change OBD",
                             size_hint=(.5, .20),
                             pos_hint={
                                 'x': 0,
                                 'y': 0
                             },
                             font_size=32)
        self.main = Button(text="Return",
                           size_hint=(.5, .20),
                           pos_hint={
                               'x': .5,
                               'y': 0
                           },
                           font_size=32)

        self.change.bind(on_press=self.switch_commands)
        self.main.bind(on_release=self.go_to_parent)

        for i in range(4):
            self.layout.add_widget(self.values[i])
            self.layout.add_widget(self.types[i])

        self.layout.add_widget(self.change)
        self.layout.add_widget(self.main)

        self.add_widget(self.layout)
示例#37
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        self.layout = FloatLayout()

        # Displaying User and Password for using to input
        self.passw_inp = TextInput(height=60,
                                   hint_text='password',
                                   pos_hint={
                                       'x': .2,
                                       'y': 0.3
                                   },
                                   size_hint=(0.6, 0.1),
                                   multiline=False,
                                   password=True)
        self.un_inp = TextInput(height=60,
                                hint_text='username',
                                pos_hint={
                                    'x': .2,
                                    'y': 0.425
                                },
                                size_hint=(0.6, 0.1),
                                multiline=False)
        confirm = Button(text='Log in',
                         pos_hint={
                             'x': .2,
                             'y': .15
                         },
                         size_hint=(0.6, 0.1))
        quitbutton = Button(text="Quit",
                            font_size=15,
                            pos_hint={
                                'x': 0.9,
                                'y': 0.9
                            },
                            size_hint=(0.1, 0.1),
                            background_normal='',
                            background_color=(1, 0, 0, 1))
        fake_forgot = Label(text='forgot password?',
                            pos_hint={
                                'x': .3,
                                'y': .07
                            },
                            size_hint=(0.4, 0.1))
        logo = Image(source='logo.jpg',
                     pos_hint={
                         'x': 0.1,
                         'y': .5
                     },
                     size_hint=(0.8, 0.5))

        # bind the keys to make it functional
        confirm.bind(on_press=self.validate_user)
        quitbutton.bind(on_press=self.quit_app)

        # add widget
        self.layout.add_widget(self.un_inp)
        self.layout.add_widget(self.passw_inp)
        self.layout.add_widget(confirm)
        self.layout.add_widget(quitbutton)
        self.layout.add_widget(fake_forgot)
        self.layout.add_widget(logo)
        self.add_widget(self.layout)
示例#38
0
文件: G_PAD.py 项目: Klajdigjeci/gpad
    def __init__(self, **args):
        Screen.__init__(self, **args)
        #declaring the goals and giving them values
        goal_one = self.open_goal('text_files/goal_one.txt')
        goal_two = self.open_goal('text_files/goal_two.txt')
        goal_three = self.open_goal('text_files/goal_three.txt')
        goal_four = self.open_goal('text_files/goal_four.txt')

        #adding the progressbar
        self.progressbar = ProgressBar(value=0,
                                       max=100,
                                       size_hint=(0.5, 0.1),
                                       pos_hint={
                                           "center_x": 0.5,
                                           "center_y": 0.85
                                       })
        self.add_widget(self.progressbar)
        #label set your goals
        self.label = Label(text="Set your Goals",
                           color=(1, 0, 0, 1),
                           font_size=(45),
                           size_hint=(0.1, 0.1),
                           pos_hint={
                               "center_x": 0.5,
                               "center_y": 0.95
                           })

        #goal input one
        self.text_input_one = TextInput(text=goal_one,
                                        pos_hint={
                                            "center_x": 0.4,
                                            "center_y": 0.7
                                        },
                                        size_hint=(0.7, 0.1))
        self.checkbox_one = CheckBox(
            pos_hint={
                "center_x": 0.9,
                "center_y": 0.7
            },
            size_hint=(0.1, 0.1),
            on_press=lambda x: self.goal_progress(self.checkbox_one))
        self.add_widget(self.text_input_one)
        self.add_widget(self.checkbox_one)

        #goal input two
        self.text_input_two = TextInput(text=goal_two,
                                        pos_hint={
                                            "center_x": 0.4,
                                            "center_y": 0.5
                                        },
                                        size_hint=(0.7, 0.1))
        self.checkbox_two = CheckBox(
            pos_hint={
                "center_x": 0.9,
                "center_y": 0.5
            },
            size_hint=(0.1, 0.1),
            on_press=lambda x: self.goal_progress(self.checkbox_two))
        self.add_widget(self.text_input_two)
        self.add_widget(self.checkbox_two)

        #goal input three
        self.text_input_three = TextInput(text=goal_three,
                                          pos_hint={
                                              "center_x": 0.4,
                                              "center_y": 0.3
                                          },
                                          size_hint=(0.7, 0.1))
        self.checkbox_three = CheckBox(
            pos_hint={
                "center_x": 0.9,
                "center_y": 0.3
            },
            size_hint=(0.1, 0.1),
            on_press=lambda x: self.goal_progress(self.checkbox_three))
        self.add_widget(self.text_input_three)
        self.add_widget(self.checkbox_three)

        #goal input four
        self.text_input_four = TextInput(text=goal_four,
                                         pos_hint={
                                             "center_x": 0.4,
                                             "center_y": 0.1
                                         },
                                         size_hint=(0.7, 0.1))
        self.checkbox_four = CheckBox(
            pos_hint={
                "center_x": 0.9,
                "center_y": 0.1
            },
            size_hint=(0.1, 0.1),
            on_press=lambda x: self.goal_progress(self.checkbox_four))
        self.add_widget(self.text_input_four)
        self.add_widget(self.checkbox_four)

        self.add_widget(self.label)

        #button to save all the goals
        self.button = Button(
            text="Save All",
            size_hint=(0.1, 0.1),
            pos_hint={
                "center_x": 0.9,
                "center_y": 0.88
            },
            on_press=lambda x: self.save_goals(
                self.text_input_one.text, self.text_input_two.text, self.
                text_input_three.text, self.text_input_four.text,
                'text_files/goal_one.txt', 'text_files/goal_two.txt',
                'text_files/goal_three.txt', 'text_files/goal_four.txt'))
        self.add_widget(self.button)
示例#39
0
文件: G_PAD.py 项目: Klajdigjeci/gpad
    def __init__(self, **args):
        Screen.__init__(self, **args)

        #basic label for learning notes
        self.label = Label(text="Learning Notes",
                           color=(1, 0, 0, 1),
                           font_size=(45),
                           size_hint=(0.1, 0.1),
                           pos_hint={
                               "center_x": 0.5,
                               "center_y": 0.95
                           })
        self.add_widget(self.label)

        #gets the value to the title and the learning notes from the files
        title_one = self.open_title('text_files/learning_notes_one.txt')
        title_two = self.open_title('text_files/learning_notes_two.txt')
        title_three = self.open_title('text_files/learning_notes_three.txt')

        explanation_one = self.open_learning_notes(
            'text_files/learning_notes_one.txt')
        explanation_two = self.open_learning_notes(
            'text_files/learning_notes_two.txt')
        explanation_three = self.open_learning_notes(
            'text_files/learning_notes_three.txt')

        #---first textbox (capital letters)
        self.text_input_one = TextInput(text=title_one,
                                        pos_hint={
                                            "center_x": 0.5,
                                            "center_y": 0.72
                                        },
                                        size_hint=(0.87, 0.08),
                                        font_size=16.5)
        self.add_widget(self.text_input_one)
        #-- First explanation textbox
        self.text_explanation_one = TextInput(text=explanation_one,
                                              pos_hint={
                                                  "center_x": 0.5,
                                                  "center_y": 0.60
                                              },
                                              size_hint=(0.87, 0.15))
        self.add_widget(self.text_explanation_one)
        #---second textbox (capital letters)
        self.text_input_two = TextInput(text=title_two,
                                        pos_hint={
                                            "center_x": 0.5,
                                            "center_y": 0.47
                                        },
                                        size_hint=(0.87, 0.08))
        self.add_widget(self.text_input_two)
        #-- second explanation textbox
        self.text_explanation_two = TextInput(text=explanation_two,
                                              pos_hint={
                                                  "center_x": 0.5,
                                                  "center_y": 0.35
                                              },
                                              size_hint=(0.87, 0.15))
        self.add_widget(self.text_explanation_two)
        #---third textbox (capital letters)
        self.text_input_three = TextInput(text=title_three,
                                          pos_hint={
                                              "center_x": 0.5,
                                              "center_y": 0.22
                                          },
                                          size_hint=(0.87, 0.08))
        self.add_widget(self.text_input_three)
        #-- third explanation textbox
        self.text_explanation_three = TextInput(text=explanation_three,
                                                pos_hint={
                                                    "center_x": 0.5,
                                                    "center_y": 0.1
                                                },
                                                size_hint=(0.87, 0.15))
        self.add_widget(self.text_explanation_three)
        # button to save all the info
        self.button = Button(
            text="Save All",
            size_hint=(0.1, 0.1),
            pos_hint={
                "center_x": 0.885,
                "center_y": 0.88
            },
            on_press=lambda x: self.save_learning_notes(
                self.text_input_one.text, self.text_input_two.text, self.
                text_input_three.text, self.text_explanation_one.text, self.
                text_explanation_two.text, self.text_explanation_three.text,
                'text_files/learning_notes_one.txt',
                'text_files/learning_notes_two.txt',
                'text_files/learning_notes_three.txt'))
        self.add_widget(self.button)
示例#40
0
 def __init__(self, *args, **kwargs):
     Screen.__init__(self, *args, **kwargs)
     self.display = True
     self.database = DataBase('dbase')
示例#41
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     self.manager = self.parent  # The screen manager
     self.layout = FloatLayout()  # The layout
     self.add_widget(self.layout)
     self.rows = 8  # The amount of rows in the board
     self.cols = 8  # The amount of columns in the board
     self.status = "Playing"  # Game status ("Playing"/"Win")
     self.win_text = Label(font_size="20sp", size_hint=(None, None))  # Label displayed at the end of the game
     self.reset = Button(text="Click to play again", width=Window.size[0]/5, size_hint=(None, None))  # Button displayed at the end of the game
     self.reset.bind(on_press=self.reset_board)
     self.menu = Button(text="Click to return to menu", width=Window.size[0]/5, size_hint=(None, None))  # Button displayed at the end of the game
     self.menu.bind(on_press=self.go_menu)
     self.quit = Button(text="Click to quit", width=Window.size[0]/5, size_hint=(None, None))  # Button displayed at the end of the game
     self.quit.bind(on_press=quit_game)
     self.depth = 2  # Minimax depth
     self.start_time = 0  # Used for measuring move calculation time
     self.offset = 0  # Used to lower minimax depth in real time
     self.tooLong = False  # If calculation time is longer than 10 seoncds
     self.rotatable = False  # If a board can rotated
     self.turn = 1  # Player turn (1/2)
     Window.bind(on_resize=self.resize)
     self.buttons = list()  # Buttons displayed on screen
     for i, y in enumerate(range(0, Window.size[1], int(Window.size[1]/self.rows))):
         # In case loop does one extra
         if i < self.rows:
             self.buttons.append(list())
         for j, x in enumerate(range(0, Window.size[0], int(Window.size[0]/self.cols))):
             # In case loop does one extra
             if j < self.cols:
                 # First button to be added
                 if i == 0 and j == 0:
                     self.buttons[i].append(Button(text="Menu", pos=(x, y), size=(Window.size[0] / 8, Window.size[1] / 8), size_hint=(None, None)))
                     self.buttons[i][j].mark = "menu"
                     self.buttons[i][j].bind(on_press=self.go_menu)
                 else:
                     self.buttons[i].append(WidgetButton((x, y), (Window.size[0] / self.cols, Window.size[1] / self.rows), i, j))
                     # If not out of bounds
                     if 0 < i < self.rows-1 and 0 < j < self.cols - 1:
                         self.buttons[i][j].bind(on_press=self.place)
                         self.buttons[i][j].mark = "empty"
                     # Arrows positions
                     elif i in [0, self.rows-1] and j in [1, self.cols-2] or i in [1, self.rows-2] and j in [0, self.cols-1]:
                         self.buttons[i][j].bind(on_press=self.rotate)
                     self.draw(self.buttons[i][j])
                 self.layout.add_widget(self.buttons[i][j])
     self.buttons[0][1].mark = "right"
     self.draw(self.buttons[0][1])
     self.buttons[0][1].start_row = self.buttons[1][0].start_row = 1
     self.buttons[0][1].start_col = self.buttons[1][0].start_col = 1
     self.buttons[0][1].cw = True
     self.buttons[1][0].mark = "up"
     self.draw(self.buttons[1][0])
     self.buttons[1][0].cw = False
     self.buttons[self.rows-2][0].mark = "down"
     self.draw(self.buttons[self.rows-2][0])
     self.buttons[self.rows-2][0].start_row = self.buttons[self.rows-1][1].start_row = int((self.rows-2)/2)+1
     self.buttons[self.rows-2][0].start_col = self.buttons[self.rows-1][1].start_col = 1
     self.buttons[self.rows-2][0].cw = True
     self.buttons[self.rows-1][1].mark = "right"
     self.draw(self.buttons[self.rows-1][1])
     self.buttons[self.rows-1][1].cw = False
     self.buttons[self.rows-1][self.cols-2].mark = "left"
     self.draw(self.buttons[self.rows-1][self.cols-2])
     self.buttons[self.rows-1][self.cols-2].start_row = self.buttons[self.rows-2][self.cols-1].start_row = int((self.rows-2)/2)+1
     self.buttons[self.rows-1][self.cols-2].start_col = self.buttons[self.rows-2][self.cols-1].start_col = int((self.cols-2)/2)+1
     self.buttons[self.rows-1][self.cols-2].cw = True
     self.buttons[self.rows-2][self.cols-1].mark = "down"
     self.draw(self.buttons[self.rows-2][self.cols-1])
     self.buttons[self.rows-2][self.cols-1].cw = False
     self.buttons[1][self.cols-1].mark = "up"
     self.draw(self.buttons[1][self.cols-1])
     self.buttons[1][self.cols-1].start_row = self.buttons[0][self.cols-2].start_row = 1
     self.buttons[1][self.cols-1].start_col = self.buttons[0][self.cols-2].start_col = int((self.cols-2)/2)+1
     self.buttons[1][self.cols-1].cw = True
     self.buttons[0][self.cols-2].mark = "left"
     self.draw(self.buttons[0][self.cols-2])
     self.buttons[0][self.cols-2].cw = False
示例#42
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)

        self.layout = FloatLayout(size=(600, 600))
        ''' Pause Button '''
示例#43
0
文件: G_PAD.py 项目: Klajdigjeci/gpad
    def __init__(self, **args):
        Screen.__init__(self, **args)

        #get the ideas from the files
        idea_one = self.open_idea('text_files/idea_one.txt')
        idea_two = self.open_idea('text_files/idea_two.txt')
        idea_three = self.open_idea('text_files/idea_three.txt')
        idea_four = self.open_idea('text_files/idea_four.txt')

        #labels that show the ideas
        self.textLabel = Label(text="New Ideas",
                               color=(1, 0, 0, 1),
                               font_size=(45),
                               size_hint=(0.1, 0.1),
                               pos_hint={
                                   "center_x": 0.5,
                                   "center_y": 0.95
                               })
        self.label_one = Label(text=str(idea_one),
                               text_size=(self.width * 5.5, None),
                               color=(1, 0, 0, 1),
                               font_size=(12),
                               size_hint=(0., 0.7),
                               pos_hint={
                                   "center_x": 0.4,
                                   "center_y": 0.7
                               })
        self.label_two = Label(text=str(idea_two),
                               text_size=(self.width * 5.5, None),
                               color=(0, 1, 0, 1),
                               font_size=(12),
                               size_hint=(0.8, 0.7),
                               pos_hint={
                                   "center_x": 0.4,
                                   "center_y": 0.5
                               })
        self.label_three = Label(text=str(idea_three),
                                 text_size=(self.width * 5.5, None),
                                 color=(1, 0, 1, 1),
                                 font_size=(12),
                                 size_hint=(0.8, 0.7),
                                 pos_hint={
                                     "center_x": 0.4,
                                     "center_y": 0.3
                                 })
        self.label_four = Label(text=str(idea_four),
                                text_size=(self.width * 5.5, None),
                                color=(1, 1, 0, 1),
                                font_size=(12),
                                size_hint=(0.9, 0.7),
                                pos_hint={
                                    "center_x": 0.4,
                                    "center_y": 0.1
                                })

        #textboxs
        self.text_input_one = TextInput(text=idea_one,
                                        pos_hint={
                                            "center_x": 0.4,
                                            "center_y": 0.7
                                        },
                                        size_hint=(0.7, 0.15))
        self.text_input_two = TextInput(text=idea_two,
                                        pos_hint={
                                            "center_x": 0.4,
                                            "center_y": 0.5
                                        },
                                        size_hint=(0.7, 0.15))
        self.text_input_three = TextInput(text=idea_three,
                                          pos_hint={
                                              "center_x": 0.4,
                                              "center_y": 0.3
                                          },
                                          size_hint=(0.7, 0.15))
        self.text_input_four = TextInput(text=idea_four,
                                         pos_hint={
                                             "center_x": 0.4,
                                             "center_y": 0.1
                                         },
                                         size_hint=(0.7, 0.15))
        #buttons
        self.save_one_button = Button(
            pos_hint={
                "center_x": 0.92,
                "center_y": 0.7
            },
            size_hint=(0.1, 0.1),
            text="Save",
            on_press=lambda x: self.save_idea(self.text_input_one.text, self.
                                              text_input_one, self.label_one,
                                              'text_files/idea_one.txt'))
        self.edit_one_button = Button(
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.7
            },
            size_hint=(0.1, 0.1),
            text="Edit",
            on_press=lambda x: self.edit_one(self.text_input_one))
        self.save_two_button = Button(
            pos_hint={
                "center_x": 0.92,
                "center_y": 0.5
            },
            size_hint=(0.1, 0.1),
            text="Save",
            on_press=lambda x: self.save_idea(self.text_input_two.text, self.
                                              text_input_two, self.label_two,
                                              'text_files/idea_two.txt'))
        self.edit_two_button = Button(
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.5
            },
            size_hint=(0.1, 0.1),
            text="Edit",
            on_press=lambda x: self.edit_two(self.text_input_two))
        self.save_three_button = Button(
            pos_hint={
                "center_x": 0.92,
                "center_y": 0.3
            },
            size_hint=(0.1, 0.1),
            text="Save",
            on_press=lambda x: self.save_idea(
                self.text_input_three.text, self.text_input_three, self.
                label_three, 'text_files/idea_three.txt'))
        self.edit_three_button = Button(
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.3
            },
            size_hint=(0.1, 0.1),
            text="Edit",
            on_press=lambda x: self.edit_three(self.text_input_three))
        self.save_four_button = Button(
            pos_hint={
                "center_x": 0.92,
                "center_y": 0.1
            },
            size_hint=(0.1, 0.1),
            text="Save",
            on_press=lambda x: self.save_idea(self.text_input_four.text, self.
                                              text_input_four, self.label_four,
                                              'text_files/idea_four.txt'))
        self.edit_four_button = Button(
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.1
            },
            size_hint=(0.1, 0.1),
            text="Edit",
            on_press=lambda x: self.edit_four(self.text_input_four))
        #adding the labels
        self.add_widget(self.textLabel)
        self.add_widget(self.label_one)
        self.add_widget(self.label_two)
        self.add_widget(self.label_three)
        self.add_widget(self.label_four)
        #adding the textboxes and the buttons
        self.add_widget(self.text_input_one)
        self.add_widget(self.save_one_button)
        self.add_widget(self.edit_one_button)

        self.add_widget(self.text_input_two)
        self.add_widget(self.save_two_button)
        self.add_widget(self.edit_two_button)

        self.add_widget(self.text_input_three)
        self.add_widget(self.save_three_button)
        self.add_widget(self.edit_three_button)

        self.add_widget(self.text_input_four)
        self.add_widget(self.save_four_button)
        self.add_widget(self.edit_four_button)
示例#44
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        self.layout = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[0, 50, 0, 50])

        # Setting the background of the menu screen
        with self.canvas.before:

            Rectangle(source='assets/startmenubg.png',
                      size=(Window.width, Window.height),
                      color=(255, 255, 255, 1))
            # Label(text = "Welcome to this game", pos_hint = {"center_x":0.5})

        # Title
        self.tit = Label(text="Last Stand",
                         font_name="Halo3",
                         font_size=100,
                         size_hint=(1, 1),
                         size=(600, 300),
                         pos_hint={"center_x": 0.5},
                         color=(1, 0, 0, 1))

        # Start Button
        self.btn_start = Button(background_normal='assets/startbutton2.png',
                                text='Start Game',
                                font_size=50,
                                on_release=self.change_to_start,
                                color=(1, 1, 1, 1),
                                size_hint=(None, None),
                                size=(600, 200),
                                pos_hint={"center_x": 0.5},
                                font_name="Halo3")

        # High Score Button
        self.btn_hs = Button(text='High Score',
                             background_normal='assets/startbutton2.png',
                             font_name="Halo3",
                             size=(600, 200),
                             size_hint=(None, None),
                             font_size=50,
                             on_release=self.open_hs,
                             pos_hint={
                                 "center_x": 0.5,
                                 "y": 0.3
                             })

        # Quit button
        self.btn_quit = Button(text='Quit Game',
                               background_normal='assets/startbutton2.png',
                               font_name="Halo3",
                               size=(600, 200),
                               font_size=50,
                               size_hint=(None, None),
                               on_release=self.quit_game,
                               pos_hint={
                                   "center_x": 0.5,
                                   "y": 0.3
                               })

        self.layout.add_widget(self.tit)
        self.layout.add_widget(self.btn_start)
        self.layout.add_widget(self.btn_hs)

        self.layout.add_widget(self.btn_quit)
        # self.layout.add_widget(self.tit)

        self.add_widget(self.layout)
示例#45
0
    def __init__(self, **kwargs):
        Screen.__init__(self, **kwargs)
        self.layout = BoxLayout(orientation='vertical')
        menubar = GridLayout(cols=3, rows=1, size_hint_y=None, spacing=5)
        content = GridLayout(cols=2, size_hint=(1, 1), spacing=0.2)
        # Core menu layouts
        home_button = Label(text='Home', font_size=24, size_hint_x=.3)
        anal_button = Button(text='Analytics',
                             on_press=self.change_to_analytics,
                             font_size=24,
                             size_hint_x=.3)
        log_button = Button(text='Log',
                            on_press=self.change_to_log,
                            font_size=24,
                            size_hint_x=.3)
        quit_button = Button(text="X",
                             font_size=24,
                             pos_hint={
                                 'x': 0.9,
                                 'y': 0.9
                             },
                             size_hint=(0.1, 0.1),
                             background_normal='',
                             background_color=(1, 0, 0, 1))

        menubar.add_widget(home_button)
        menubar.add_widget(anal_button)
        menubar.add_widget(log_button)

        # creating welcome label
        accy = App.get_running_app().actual_name
        welcome_label = Label(text="Welcome back, {}! ".format(accy),
                              font_name='Lobster-Regular',
                              size_hint=(1, None),
                              font_size=60)

        # setting up of bluetooth, intrusion, universal unlocking and sms setup, linking them to firebase
        # instantiate widgets
        bluetooth_label1 = Label(
            text="Registered Devices :",
            font_size=24,
            halign='right',
        )
        bluetooth_label2 = Label(text=" {}".format(self.bluetooth_display()),
                                 font_size=24)

        intrusion_label = Label(text="Last Intrusion:",
                                font_size=24,
                                halign='right')
        intrusion_status = Label(text="{}".format(self.check_intrusion()),
                                 font_size=24,
                                 halign='right')

        uni_unlock_label = Label(text="Lock :", font_size=24, halign='right')
        switch_button = Switch(active=self.check_status()[0])

        sms_setup = Label(text="Alert mode status :",
                          font_size=24,
                          halign='right')
        sms_switch = Switch(active=self.check_status()[1])

        # add widgets
        content.add_widget(bluetooth_label1)
        content.add_widget(bluetooth_label2)
        content.add_widget(intrusion_label)
        content.add_widget(intrusion_status)
        content.add_widget(uni_unlock_label)
        content.add_widget(switch_button)
        content.add_widget(sms_setup)
        content.add_widget(sms_switch)

        # bind buttons to functions
        anal_button.bind(on_press=self.change_to_analytics)
        log_button.bind(on_press=self.change_to_log)
        quit_button.bind(on_press=self.quit_app)
        switch_button.bind(active=self.uni_unlock)
        sms_switch.bind(active=self.change_notif)

        # add widgets
        self.layout.add_widget(welcome_label)
        self.layout.add_widget(content)
        self.layout.add_widget(menubar)

        # quit app
        self.add_widget(quit_button)
        self.add_widget(self.layout)
示例#46
0
文件: G_PAD.py 项目: Klajdigjeci/gpad
    def __init__(self, **args):
        Screen.__init__(self, **args)

        #giving all the reminder and the dates values
        reminder_one = self.open_reminder('text_files/reminder_one.txt')
        reminder_two = self.open_reminder('text_files/reminder_two.txt')
        reminder_three = self.open_reminder('text_files/reminder_three.txt')
        reminder_four = self.open_reminder('text_files/reminder_four.txt')

        date_one = self.open_date('text_files/date_one.txt')
        date_two = self.open_date('text_files/date_two.txt')
        date_three = self.open_date('text_files/date_three.txt')
        date_four = self.open_date('text_files/date_four.txt')

        #Set reminder label
        self.label = Label(text="Set Reminders",
                           color=(1, 0, 0, 1),
                           font_size=(45),
                           size_hint=(0.1, 0.1),
                           pos_hint={
                               "center_x": 0.5,
                               "center_y": 0.95
                           })

        #adding all elements for the first reminder
        self.text_input_one = TextInput(text=reminder_one,
                                        pos_hint={
                                            "center_x": 0.37,
                                            "center_y": 0.7
                                        },
                                        size_hint=(0.6, 0.1))
        self.date_input_one = TextInput(pos_hint={
            "center_x": 0.75,
            "center_y": 0.7
        },
                                        size_hint=(0.1, 0.1))
        self.date_label_one = Label(text=date_one,
                                    pos_hint={
                                        "center_x": 0.92,
                                        "center_y": 0.7
                                    },
                                    size_hint=(0.1, 0.1))
        self.add_widget(self.date_input_one)
        self.add_widget(self.date_label_one)
        self.add_widget(self.text_input_one)
        self.set_date_one = Button(
            text="set",
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.7
            },
            size_hint=(0.05, 0.1),
            on_press=lambda x: self.add_date(self.date_input_one, self.
                                             date_label_one,
                                             'text_files/date_one.txt'))
        self.add_widget(self.set_date_one)

        #adding all elements for the second reminder
        self.text_input_two = TextInput(text=reminder_two,
                                        pos_hint={
                                            "center_x": 0.37,
                                            "center_y": 0.5
                                        },
                                        size_hint=(0.6, 0.1))
        self.date_input_two = TextInput(pos_hint={
            "center_x": 0.75,
            "center_y": 0.5
        },
                                        size_hint=(0.1, 0.1))
        self.date_label_two = Label(text=date_two,
                                    pos_hint={
                                        "center_x": 0.92,
                                        "center_y": 0.5
                                    },
                                    size_hint=(0.1, 0.1))
        self.add_widget(self.date_input_two)
        self.add_widget(self.date_label_two)
        self.add_widget(self.text_input_two)
        self.set_date_two = Button(
            text="set",
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.5
            },
            size_hint=(0.05, 0.1),
            on_press=lambda x: self.add_date(self.date_input_two, self.
                                             date_label_two,
                                             'text_files/date_two.txt'))
        self.add_widget(self.set_date_two)

        #adding all elements for the third reminder
        self.text_input_three = TextInput(text=reminder_three,
                                          pos_hint={
                                              "center_x": 0.37,
                                              "center_y": 0.3
                                          },
                                          size_hint=(0.6, 0.1))
        self.date_input_three = TextInput(pos_hint={
            "center_x": 0.75,
            "center_y": 0.3
        },
                                          size_hint=(0.1, 0.1))
        self.date_label_three = Label(text=date_three,
                                      pos_hint={
                                          "center_x": 0.92,
                                          "center_y": 0.3
                                      },
                                      size_hint=(0.1, 0.1))
        self.add_widget(self.date_input_three)
        self.add_widget(self.date_label_three)
        self.add_widget(self.text_input_three)
        self.set_date_three = Button(
            text="set",
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.3
            },
            size_hint=(0.05, 0.1),
            on_press=lambda x: self.add_date(self.date_input_three, self.
                                             date_label_three,
                                             'text_files/date_three.txt'))
        self.add_widget(self.set_date_three)

        #adding all elements for the forth reminder
        self.text_input_four = TextInput(text=reminder_four,
                                         pos_hint={
                                             "center_x": 0.37,
                                             "center_y": 0.1
                                         },
                                         size_hint=(0.6, 0.1))
        self.date_input_four = TextInput(pos_hint={
            "center_x": 0.75,
            "center_y": 0.1
        },
                                         size_hint=(0.1, 0.1))
        self.date_label_four = Label(text=date_four,
                                     pos_hint={
                                         "center_x": 0.92,
                                         "center_y": 0.1
                                     },
                                     size_hint=(0.1, 0.1))
        self.add_widget(self.date_input_four)
        self.add_widget(self.date_label_four)
        self.add_widget(self.text_input_four)
        self.set_date_four = Button(
            text="set",
            pos_hint={
                "center_x": 0.82,
                "center_y": 0.1
            },
            size_hint=(0.05, 0.1),
            on_press=lambda x: self.add_date(self.date_input_four, self.
                                             date_label_four,
                                             'text_files/date_four.txt'))
        self.add_widget(self.set_date_four)

        #adding the save all button
        self.button = Button(
            text="Save All",
            size_hint=(0.1, 0.1),
            pos_hint={
                "center_x": 0.9,
                "center_y": 0.88
            },
            on_press=lambda x: self.save_reminders(
                self.text_input_one.text, self.text_input_two.text, self.
                text_input_three.text, self.text_input_four.text,
                'text_files/reminder_one.txt', 'text_files/reminder_two.txt',
                'text_files/reminder_three.txt', 'text_files/reminder_four.txt'
            ))
        self.add_widget(self.button)
        self.add_widget(self.label)
 def __init__(self, root_app=None):
     Screen.__init__(self, name=self.screen_name)
     self.root_widget = Builder.load_file(
         os.path.join(FILE_DIR, self.view_kv_filepath))
     self.root_widget.link_to_app(root_app)
     self.add_widget(self.root_widget)
示例#48
0
 def __init__(self, **kwargs):
     Screen.__init__(self, **kwargs)
     self._course = None
     self._category_layouts = dict()
     self._org_categories = None
示例#49
0
 def __init__(self, *args, **kwargs):
     """constructor of the detail screen """
     Screen.__init__(self, *args, **kwargs)
     self.database = DataBase('dbase')