Ejemplo n.º 1
0
 def check_caller(self, scr_name):
     if scr_name == "Admin Login":
         self.opacity = 0.6
         self.ids.scr.transition = SwapTransition()
         self.ids.scr.current = "reset"
     elif scr_name == "User Login":
         self.opacity = 0.6
         self.ids.scr.transition = SwapTransition()
         self.ids.scr.current = "reset_user"
Ejemplo n.º 2
0
def alterarTelaAtual(tela, direcao, efeito=False):
    if efeito:
        sm.transition = SwapTransition(duration=TempoTransicao)
    else:
        sm.transition = SlideTransition()
    sm.transition.direction = direcao
    sm.current = tela
Ejemplo n.º 3
0
    def build(self):
        self.title = "Encomendas - J & N Artefatos de Cimento"

        # Session to use in all functionalities of the app.
        self.session = get_session()

        # Add an easy reference on the app to all main screens except menu to
        # later use.
        self.new_order = NewOrder(name='new_order')
        self.consult = Consult(name="consult")
        self.payments = Payments(name="payments")
        self.orders = Orders(name="orders")
        self.prices = Prices(name="prices")

        # Create the main screen manager and add an easy reference on the app.
        self.sm = ScreenManager(transition=SwapTransition())

        # Add all the screens to the manager
        self.sm.add_widget(Menu(name="menu"))
        self.sm.add_widget(self.new_order)
        self.sm.add_widget(self.consult)
        self.sm.add_widget(self.payments)
        self.sm.add_widget(self.orders)
        self.sm.add_widget(self.prices)

        # Return the root widget.
        return self.sm
Ejemplo n.º 4
0
    def __init__(self, params, values, **kwargs):
        super(CustomizeMapView, self).__init__(**kwargs)
        self.values = values
        self.register_event_type('on_customized')
        self.register_event_type('on_close')

        screen_manager = self.ids.screens
        screen_manager.transition = SwapTransition()

        customize_heatmap_view = CustomizeHeatmapView(name='heat',
                                                      params=params,
                                                      values=values)
        customize_heatmap_view.bind(on_modified=self.on_modified)

        customize_track_view = CustomizeTrackView(name='track',
                                                  params=params,
                                                  values=values)
        customize_track_view.bind(on_modified=self.on_modified)

        self.customize_heatmap_view = customize_heatmap_view
        self.customize_track_view = customize_track_view

        screen_manager.add_widget(customize_heatmap_view)
        screen_manager.add_widget(customize_track_view)

        heatmap_option = HeatmapButton()
        heatmap_option.bind(on_press=lambda x: self.on_option('heat'))
        self.ids.options.add_widget(heatmap_option)

        trackmap_option = TrackmapButton()
        self.ids.options.add_widget(trackmap_option)
        trackmap_option.bind(on_press=lambda x: self.on_option('track'))
Ejemplo n.º 5
0
 def __init__(self, **kwargs):
     """Initializion method."""
     super().__init__(**kwargs)
     self.sm = ScreenManager(transition=SwapTransition())
     self.sm.add_widget(OrderList(name="list"))
     self.sm.add_widget(EditOrder(name="edit"))
     self.add_widget(self.sm)
Ejemplo n.º 6
0
    def do_recruit(self, *args):
        if Refs.gc.get_varenth() < 25000:
            tt = 'Not enough varenth!'
            dt = 'You need to gain more varenth!'
            ct = 'Return'
            Refs.gp.display_popup(self,
                                  'tm_confirm',
                                  show_warning=False,
                                  title_text=tt,
                                  description_text=dt,
                                  confirm_text=ct)
        else:
            Refs.gc.update_varenth(-25000)

            characters = Refs.gc.get_characters()
            obtained_characters = Refs.gc.get_all_obtained_character_indexes()

            if len(obtained_characters) == len(characters):
                Refs.gp.display_popup(self, 'tm_no_recruit')
            else:
                unobtained_characters = [
                    char for char in characters
                    if char.get_index() not in obtained_characters
                ]
                index = random.randint(0, len(unobtained_characters) - 1)
                viewed_characters = [unobtained_characters[index]]
                Refs.gs.transition = SwapTransition(duration=2)
                self.sound.play()
                Refs.gs.display_screen(
                    'recruit_' + unobtained_characters[index].get_id(), True,
                    True, unobtained_characters[index], viewed_characters)
Ejemplo n.º 7
0
    def __init__(self, app, screens, *args, **kwargs):
        '''
        params:-
            app : Visualliser : The parent of this
            screens : (Screen, ...) : Screens to be added onto the UI
        '''
        super().__init__(*args, **kwargs)

        self.app = app

        self.cols = 1
        self.rows = 2

        self.screen_manager = ScreenManager()
        self.screen_manager.transition = SwapTransition()

        # Add screens to the screen manager
        for screen in screens:
            self.screen_manager.add_widget(screen)

        self.add_widget(self.screen_manager)

        # Add the UI buttons
        ui = GridLayout(rows=1, size_hint_y=None, height=20)

        ui.add_widget(Button(on_press=lambda a: self.switch_screen( str(int(self.screen_manager.current) - 1)) ))
        ui.add_widget(Button(on_press=lambda a: self.switch_screen( str(int(self.screen_manager.current) + 1)) ))

        self.add_widget(ui)
Ejemplo n.º 8
0
 def start_timer(self):
     timeStart = datetime.datetime.now()
     dateStart = timeStart.strftime("%d/%m/%Y")
     timeStart = timeStart.strftime("%H:%M:%S")
     activityDict = {"name":self.ids.TF_Name.text,"project":self.ids.TF_ProjectName.text,"type":self.ids.TF_WorkType.text,"timeSpent" : "","timeStart":str(timeStart), "date": str(dateStart)}
     print("Start" + str(activityDict))
     self.parent.switch_to(screens[2],transition=SwapTransition(),direction="right")
     self.avalible_screens[2].Start_Timer(activityDict)
Ejemplo n.º 9
0
 def __init__(self, **kwargs):
     """Initializion method."""
     super().__init__(**kwargs)
     # Create its own screen manager and add screens.
     self.sm = ScreenManager(transition=SwapTransition())
     self.sm.add_widget(PaymentsSelectClient(name='select'))
     self.sm.add_widget(PaymentsInfo(name='info'))
     self.add_widget(self.sm)
Ejemplo n.º 10
0
 def __init__(self, values, **kwargs):
     super(OptionsView, self).__init__(**kwargs)
     self.register_event_type('on_customized')
     self.register_event_type('on_close')
     screen_manager = self.ids.screens
     screen_manager.transition = SwapTransition()
     self.values = values
     self.buttons = {}
Ejemplo n.º 11
0
 def got_success_login_json(self, req, result):
     if result:
         if result.get('UserId'):
             self.manager.transition = SwapTransition(
             )  #SlideTransition(direction="left")
             self.manager.current = 'mainscreen'
     else:
         popup = TracoPopup()
         popup.open()
Ejemplo n.º 12
0
 def __init__(self, **kwargs):
     """Initializion method creating screen manager and adding all the
     screens to it.
     """
     super().__init__(**kwargs)
     self.sm = ScreenManager(transition=SwapTransition())
     self.sm.add_widget(ConsultSelectClient(name='select'))
     self.sm.add_widget(ClientInfo(name='info'))
     self.sm.add_widget(OrderDetails(name='details'))
     self.add_widget(self.sm)
Ejemplo n.º 13
0
 def __init__(self, **kwargs):
     """Initializion method creating screen manager and adding all the
     screens to it.
     """
     super().__init__(**kwargs)
     self.sm = ScreenManager(transition=SwapTransition())
     self.sm.add_widget(NewOrderItens(name="itens"))
     self.sm.add_widget(NewOrderClient(name="client"))
     self.sm.add_widget(NewOrderLast(name="last"))
     self.add_widget(self.sm)
 def build(self):
     self.sm = ScreenManager(transition=SwapTransition())
     self.menu = MenuScreen(name='menu')
     self.generate = GenerateQR(name='generate')
     self.read = ReadQR(name='read')
     self.dataread = DataScreen(name='datascreen')
     self.sm.add_widget(self.menu)
     self.sm.add_widget(self.generate)
     self.sm.add_widget(self.read)
     self.sm.add_widget(self.dataread)
     return self.sm
Ejemplo n.º 15
0
    def build(self):
        sm = ScreenManager(transition=SwapTransition())
        self.fecha_evento = datetime.strptime('1-1-1970', "%d-%m-%Y")
        startup = Startup(name='startup')
        sm.add_widget(startup)
        home = Home(name='home')
        sm.add_widget(home)
        evento = Evento(name='evento')
        sm.add_widget(evento)

        return sm
Ejemplo n.º 16
0
class jMathApp(App):
    operatore = None
    sm = ScreenManager(transition=SwapTransition())

    def build(self):
        # metodo specifico di Kivy
        self.sm.add_widget(ScreenInizio(name='inizio'))
        self.sm.add_widget(ScreenImpostazioni(name='impostazioni'))
        self.sm.add_widget(ScreenGioco(name='gioco'))
        self.sm.add_widget(ScreenStatistiche(name='statistiche'))
        return self.sm
Ejemplo n.º 17
0
 def init(self):
     self.username = ''
     self.password = ''
     self.crypt_file_path = ''
     self.screenmanager = ScreenManager(transition=SwapTransition())
     self.loginscreen = LoginScreen(name='screen-login')
     self.loginscreen.bind(on_login=self.login)
     self.ideascreen = IdeaScreen(name='screen-idea')
     self.ideascreen.bind(on_quit_app=self.quit)
     self.screenmanager.add_widget(self.loginscreen)
     self.screenmanager.add_widget(self.ideascreen)
     self.screenmanager.current = 'screen-login'
Ejemplo n.º 18
0
 def build(self):
     self.main_widget = Builder.load_string(main_widget_kv)
     self.main_widget.ids.scr_mngr.transition = SwapTransition()
     self.main_widget.ids.scr_mngr.add_widget(home_screen())
     self.main_widget.ids.scr_mngr.add_widget(first_intro.kar())
     self.main_widget.ids.scr_mngr.add_widget(events.event())
     self.main_widget.ids.scr_mngr.add_widget(prof.profser())
     self.main_widget.ids.scr_mngr.add_widget(events.sponsers())
     self.main_widget.ids.scr_mngr.add_widget(feed.fed())
     self.main_widget.ids.scr_mngr.add_widget(Example())
     self.main_widget.ids.scr_mngr.add_widget(exmple())
     return self.main_widget
Ejemplo n.º 19
0
 def build(self):
     root = Rootwidget()
     sm = ScreenManagement(transition=SwapTransition())
     sm.add_widget(Activity(name='active'))
     sm.add_widget(Publicstatus(name='public_status'))
     sm.add_widget(Chats(name='chats'))
     sm.add_widget(Notifications(name='notifications'))
     sm.add_widget(Calls(name='call'))
     sm.add_widget(Myaccount())
     sm.add_widget(Mydocs())
     sm.add_widget(Mysecrets())
     return root
     Factory.register('videofiles', cls=videofiles)
     Factory.register('myprofile', cls=Myprofile)
Ejemplo n.º 20
0
    def build(self):

        background_image = Image(source='cool-background.jpeg',
                                 allow_stretch=True,
                                 keep_ratio=False)

        self.sm = ScreenManager(transition=SwapTransition())
        self.sm.add_widget(HibernateScreen(self.sm, name='Hibernate'))

        app = FloatLayout()
        app.add_widget(background_image)
        app.add_widget(self.sm)

        return app
Ejemplo n.º 21
0
 def build(self):
     root = ScreenManager()
     root.transition = SwapTransition()
     root.add_widget(MainMenu())
     root.add_widget(
         bm.BracketMethods(screenManager=root, name='bracket_methods'))
     root.add_widget(om.OpenMethods(screenManager=root,
                                    name='open_methods'))
     root.add_widget(
         soe.SystemOfEquations(screenManager=root, name='system_equations'))
     root.add_widget(
         ip.Interpolation(screenManager=root, name='interpolation'))
     root.add_widget(rg.Regression(screenManager=root, name='regression'))
     return root
Ejemplo n.º 22
0
    def build(self):
        sm = ScreenManager(transition=SwapTransition())
        orderScreen = OrderNumClass(False)
        kitchenScreen = OrderNumClass(True)

        sm.add_widget(orderScreen.widget_main)
        sm.add_widget(kitchenScreen.widget_main)

        createButtons.append(orderScreen)
        createButtons.append(kitchenScreen)

        Window.bind(on_key_up=self.switch)
        self.sm = sm

        return sm
    def change_screen(self, screen_name, transition):
        screen_manager = self.root.ids['screen_manager']

        # Transition
        if transition == "wipe":
            screen_manager.transition = WipeTransition()
        elif transition == "swap":
            screen_manager.transition = SwapTransition()
        elif transition == "slide":
            screen_manager.transition = SlideTransition()
        elif transition == "none":
            screen_manager.transition = NoTransition()
        elif transition == "card":
            screen_manager.transition = CardTransition()

        screen_manager.current = screen_name
Ejemplo n.º 24
0
    def build(self):
        random.seed()

        self.resources = ResourcesLoader()
        self.resources.load_textures()
        self.resources.load_sounds()

        menu_screen = MenuScreen(self.resources, name='MenuScreen')
        snake_game_screen = SnakeGameScreen(self.resources,
                                            name='SnakeGameScreen')

        sm = ScreenManager(transition=SwapTransition())
        sm.add_widget(menu_screen)
        sm.add_widget(snake_game_screen)

        return sm
Ejemplo n.º 25
0
 def do_roll_again(self, *args):
     char_list = Refs.gc.get_characters()
     obtained_chars = Refs.gc.get_all_obtained_character_indexes()
     if len(char_list) == len(obtained_chars) + len(self.viewed_characters):
         Refs.gp.display_popup(self, 'tm_no_recruit')
     else:
         Refs.gs.transition = SwapTransition(duration=2)
         unobtained_characters = [
             char for char in char_list if char.index not in obtained_chars
             and char not in self.viewed_characters
         ]
         index = random.randint(0, len(unobtained_characters) - 1)
         self.viewed_characters.append(unobtained_characters[index])
         self.sound.play()
         Refs.gs.display_screen(
             'recruit_' + unobtained_characters[index].get_id(), True,
             False, unobtained_characters[index], self.viewed_characters)
Ejemplo n.º 26
0
 def init(self):
     self.screenmanager = ScreenManager(transition=SwapTransition())
     global scrmgr
     scrmgr = self.screenmanager
     # print("from build " + str(scrmgr))
     self.loginscreen = LoginScreen(name='screen-login')
     self.loginscreen.bind(on_login=self.login)
     self.homescreen = HomeScreen(name='screen-home')
     self.homescreen.user_name_auth = 'ex'
     self.homescreen.bind(on_newuser=self.newuser_redirect)
     self.homescreen.bind(on_logout=self.logout_redirect)
     self.screenmanager.add_widget(self.loginscreen)
     self.screenmanager.add_widget(self.homescreen)
     self.registerscreen = RegisterScreen(name='screen-register')
     self.screenmanager.add_widget(self.registerscreen)
     scrmgr = self.screenmanager
     # self.screenmanager.current = 'screen-home'
     print(scrmgr)
     inspector.create_inspector(Window, Button)
Ejemplo n.º 27
0
    def SetPageEffect(self,*,uEffect:str) -> bool:
        """ Sets the page effect for showing a page """
        self.uCurrentEffect = uEffect
        try:
            if uEffect==u'':
                return True
            uType=ToUnicode(type(self.oRootSM.transition))
            if uEffect==u'no':
                self.oRootSM.transition = NoTransition()
            if uEffect==u'fade':
                if uType.endswith(u'FadeTransition\'>'):
                    return True
                self.oRootSM.transition = FadeTransition()
            elif uEffect==u'slide':
                if uType.endswith(u'SlideTransition\'>'):
                    return True
                self.oRootSM.transition = SlideTransition()
            elif uEffect==u'wipe':
                if uType.endswith(u'WipeTransition\'>'):
                    return True
                self.oRootSM.transition = WipeTransition()
            elif uEffect==u'swap':
                if uType.endswith(u'SwapTransition\'>'):
                    return True
                self.oRootSM.transition = SwapTransition()
            elif uEffect==u'fallout':
                if uType.endswith(u'FallOutTransition\'>'):
                    return True
                self.oRootSM.transition = FallOutTransition()
            elif uEffect==u'risein':
                if uType.endswith(u'RiseInTransition\'>'):
                    return True
                self.oRootSM.transition = RiseInTransition()

            # noinspection PyArgumentList
            self.oRootSM.transition.bind(on_complete=self.On_Transition_Complete)
            # noinspection PyArgumentList
            self.oRootSM.transition.bind(on_progress=self.On_Transition_Started)
            return True

        except Exception as e:
            ShowErrorPopUp(uMessage=LogError(uMsg=u'TheScreen: Can not set page effect:' + uEffect,oException=e))
            return False
    def __init__(self, **kwargs):
        super(CustomizeChannelsView, self).__init__(**kwargs)
        self.register_event_type('on_channels_customized')
        self.datastore = kwargs.get('datastore')
        channels = kwargs.get('current_channels')

        screen_manager = self.ids.screens
        screen_manager.transition = SwapTransition()
        add_channels_view = AddChannelsView(name='add')
        current_channels_view = CurrentChannelsView(name='current')
        current_channels_view.bind(on_confirm_customize=self.confirm_customize)
        current_channels_view.bind(on_add_channels=self.add_channels)
        current_channels_view.channels = channels
        add_channels_view.bind(on_go_back=self.add_channels_complete)

        self.current_channels_view = current_channels_view
        self.add_channels_view = add_channels_view

        screen_manager.add_widget(current_channels_view)
        screen_manager.add_widget(add_channels_view)
        if not len(channels):
            self.add_channels()
Ejemplo n.º 29
0
            return second


class WindowManager(ScreenManager):
    pass


#this loads the kivy code file with the GUI customizations
loading = Builder.load_file("my.kv")
screens = [
    OpeningScreen(name="opening"),
    MainWindow(name="main"),
    RecordingWindow(name="recording"),
    HostPlayersChoiceWindow(name="playeramountchoice"),
    TeamChoiceWindow(name='teamchoice')
]

kv = ScreenManager(transition=SwapTransition())

#sets first screen to open
kv.switch_to(screens[0])


#complies app
class MyMainApp(App):
    def build(self):
        return kv


if __name__ == "__main__":
    MyMainApp().run()
Ejemplo n.º 30
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.level = 0
        self.transition = SwapTransition()