Exemplo n.º 1
0
    def build(self):
        self.icon = ICON
        Window.minimum_width, Window.minimum_height = Window.size
        root = FloatLayout()
        navdrawer = NavigationDrawer()
        navdrawer.toggle_state()
        navdrawer.anim_type = "slide_above_anim"

        self.chisel = chisel = Chisel()
        self.chisel_on_touch_down = chisel.on_touch_down
        self.chisel_on_touch_move = chisel.on_touch_move

        options_panel = OptionsPanel(chisel)
        navdrawer.add_widget(options_panel)

        burger = BurgerButton()
        burger.bind(on_release=navdrawer.toggle_state)

        rel_layout = RelativeLayout()
        rel_layout.add_widget(chisel)  # To push it when side panel is opened.
        navdrawer.add_widget(rel_layout)
        options_panel.build()
        options_panel.bind_to_burger(burger)
        navdrawer.bind(_anim_progress=self._set_side_panel_opacity)
        navdrawer.bind(_anim_progress=self.disable_chisel)

        root.add_widget(navdrawer)
        root.add_widget(burger)
        Window.add_widget(CURSOR, canvas="after")
        return root
Exemplo n.º 2
0
    def build(self):
        Window.size = (1200, 1600)

        # Setup Navigation Drawer UI and relationships
        drawer = NavigationDrawer()
        sidebar = Sidebar()
        drawer.anim_type = 'slide_above_anim'    
        drawer.add_widget(sidebar)
        nurture =Nurture(drawer, sidebar)
        drawer.bind(state=nurture.save)
        drawer.add_widget(nurture)

        return drawer
Exemplo n.º 3
0
    def build(self):
        self.icon = ICON
        cursor = Cursor()
        Window.minimum_width, Window.minimum_height = Window.size
        root = FloatLayout()
        navdrawer = NavigationDrawer()
        navdrawer.toggle_state()
        navdrawer.anim_type = "slide_above_anim"

        chisel = Chisel()

        options_panel = OptionsPanel(chisel)
        navdrawer.add_widget(options_panel)

        burger = BurgerButton()
        burger.bind(on_release=navdrawer.toggle_state)

        rel_layout = RelativeLayout(
        )  # This layout allows navdrawer to push contained widgets.
        rel_layout.add_widget(chisel)

        tools = (ToolButton(*args, chisel, cursor)
                 for args in zip(range(3), TOOLS_NORMAL, TOOLS_SELECTED))

        for tool in tools:
            tool.pos_hint = {"x": tool._id * .1 + .35, "y": .01}
            if tool._id == 0:  # First tool button is selected.
                tool.state = "down"
            rel_layout.add_widget(tool)

        navdrawer.add_widget(rel_layout)
        options_panel.build()
        options_panel.bind_to_burger(burger)

        def on_anim(instance, value):
            instance.side_panel.opacity = chisel.disabled = 1 if instance._anim_progress else 0

        navdrawer.bind(_anim_progress=on_anim)

        root.add_widget(navdrawer)
        root.add_widget(burger)

        Window.add_widget(cursor, canvas="after")
        return root
Exemplo n.º 4
0
    def __init__(self, **kwargs):

        super(TabDrawer, self).__init__(**kwargs)

        self.navdraw = NavigationDrawer()
        self.side_panel = BoxLayout(orientation='vertical')
        self.side_panel.tabbed_panel = self
        self.navdraw.add_widget(self.side_panel)
        self.add_widget(self.navdraw)

        self.add_widget(ConnectionLayout())

        pad_Layout = TabDrawerItem(text='control')
        pad_Layout.add_widget(Pad())
        self.add_widget(pad_Layout)

        for item in self.Data:
            self.add_widget(PidLayout(item))

        self.add_widget(LogLayout())
Exemplo n.º 5
0
    def build(self):
        navigationdrawer = NavigationDrawer()

        side_panel = BoxLayout(orientation='vertical')
        side_panel.add_widget(Label(text='Panel label'))
        side_panel.add_widget(Button(text='A button'))
        side_panel.add_widget(Button(text='Another button'))
        navigationdrawer.add_widget(side_panel)

        label_head = (
            '[b]Example label filling main panel[/b]\n\n[color=ff0000](p'
            'ull from left to right!)[/color]\n\nIn this example, the le'
            'ft panel is a simple boxlayout menu, and this main panel is'
            ' a BoxLayout with a label and example image.\n\nSeveral pre'
            'set layouts are available (see buttons below), but users ma'
            'y edit every parameter for much more customisation.')
        main_panel = BoxLayout(orientation='vertical')
        label_bl = BoxLayout(orientation='horizontal')
        label = Label(text=label_head,
                      font_size='15sp',
                      markup=True,
                      valign='top')
        label_bl.add_widget(Widget(size_hint_x=None, width=dp(10)))
        label_bl.add_widget(label)
        label_bl.add_widget(Widget(size_hint_x=None, width=dp(10)))
        main_panel.add_widget(Widget(size_hint_y=None, height=dp(10)))
        main_panel.add_widget(label_bl)
        main_panel.add_widget(Widget(size_hint_y=None, height=dp(10)))
        main_panel.add_widget(
            Image(source='red_pixel.png',
                  allow_stretch=True,
                  keep_ratio=False,
                  size_hint_y=0.2))
        navigationdrawer.add_widget(main_panel)
        label.bind(size=label.setter('text_size'))

        def set_anim_type(name):
            navigationdrawer.anim_type = name

        modes_layout = BoxLayout(orientation='horizontal')
        modes_layout.add_widget(Label(text='preset\nanims:'))
        slide_an = Button(text='slide_\nabove_\nanim')
        slide_an.bind(on_press=lambda j: set_anim_type('slide_above_anim'))
        slide_sim = Button(text='slide_\nabove_\nsimple')
        slide_sim.bind(on_press=lambda j: set_anim_type('slide_above_simple'))
        fade_in_button = Button(text='fade_in')
        fade_in_button.bind(on_press=lambda j: set_anim_type('fade_in'))
        reveal_button = Button(text='reveal_\nbelow_\nanim')
        reveal_button.bind(
            on_press=lambda j: set_anim_type('reveal_below_anim'))
        slide_button = Button(text='reveal_\nbelow_\nsimple')
        slide_button.bind(
            on_press=lambda j: set_anim_type('reveal_below_simple'))
        modes_layout.add_widget(slide_an)
        modes_layout.add_widget(slide_sim)
        modes_layout.add_widget(fade_in_button)
        modes_layout.add_widget(reveal_button)
        modes_layout.add_widget(slide_button)
        main_panel.add_widget(modes_layout)

        button = Button(text='toggle NavigationDrawer state (animate)',
                        size_hint_y=0.2)
        button.bind(on_press=lambda j: navigationdrawer.toggle_state())
        button2 = Button(text='toggle NavigationDrawer state (jump)',
                         size_hint_y=0.2)
        button2.bind(on_press=lambda j: navigationdrawer.toggle_state(False))
        button3 = Button(text='toggle _main_above', size_hint_y=0.2)
        button3.bind(on_press=navigationdrawer.toggle_main_above)
        main_panel.add_widget(button)
        main_panel.add_widget(button2)
        main_panel.add_widget(button3)

        return navigationdrawer
Exemplo n.º 6
0
	def __init__(self):
		#rate of intrest
		self.roi=0
		#declaring dates
		self.date_today=time.strftime('%d-%m-%Y')
		self.name='1st'
		super(first_screen,self).__init__()
		#main gird consists of all the 14 horizental layouts
		self.main_grid=GridLayout(rows=16,padding=10,spacing=10)

		#adding company name--Garuda.inc to the app
		self.Title=Label(text='~  [b]Garuda.inc[/b]',size_hint=[1,0.25],font_name='Montez-Regular',markup=True)
		self.main_grid.add_widget(self.Title)
		
		#adding selection of toggle buttons for intrest selection
		intrest_box=BoxLayout()
		self.gold=ToggleButton(text='Gold',state='down',group='intrest',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.intrest_action(1))
		self.silver=ToggleButton(text='Silver',group='intrest',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.intrest_action(2))
		self.other=ToggleButton(text='Other',group='intrest',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.intrest_action(3))
		intrest_box.add_widget(self.gold)
		intrest_box.add_widget(self.silver)
		intrest_box.add_widget(self.other)
		self.main_grid.add_widget(intrest_box)

		#adding selection of months for intrest calculation
		month_box=BoxLayout()
		self.month_minus=ToggleButton(text='0',group='months',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.month_action(1))
		self.month_plus=ToggleButton(text='1',state='down',group='months',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.month_action(2))
		self.month=ToggleButton(text='exjact',group='months',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.month_action(3))
		month_box.add_widget(self.month_minus)
		month_box.add_widget(self.month_plus)
		month_box.add_widget(self.month)
		self.main_grid.add_widget(month_box)

		#adding label to enter money
		entry_money=Label(text='[b]enter amount [/b]',markup=True)
		self.main_grid.add_widget(entry_money)

		#taking input amount from user
		self.amount=TextInput(text='',input_type='number',multiline=False)
		self.main_grid.add_widget(self.amount)

		#adding label to take date and changing date button 
		date_panel=BoxLayout()
		enter_date=Label(text='[b]Enter Date[/b]',markup=True)
		self.change_date=Button(text=self.date_today,markup=True,size_hint=[0.5,1],background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.date_popup())
		date_panel.add_widget(enter_date)
		date_panel.add_widget(self.change_date)
		self.main_grid.add_widget(date_panel)

		#adding a inputs to take date
		date_box=BoxLayout(spacing=10,padding=10)
		self.datei=TextInput(multiline=False,input_type='number',text='')
		self.monthi=TextInput(multiline=False,input_type='number',text='')
		self.yeari=TextInput(multiline=False,input_type='number',text='',size_hint=[1.7,1])
		date_box.add_widget(self.datei)
		date_box.add_widget(self.monthi)
		date_box.add_widget(self.yeari)
		self.main_grid.add_widget(date_box)

		#select the condition
		self.main_grid.add_widget(BoxLayout(size_hint=[1,0.1]))
		sixm=BoxLayout(size_hint=(1,0.5))
		self.sixc1=CheckBox(group='term',size_hint=[0.1,1],state='down',on_press=lambda a:self.term_action(1))
		sixt=Label(text='[b] with compond  intrest \'6\' month                      [/b]',markup=True)
		sixm.add_widget(self.sixc1)
		sixm.add_widget(sixt)
		simm=BoxLayout(size_hint=(1,0.5))
		self.simc2=CheckBox(group='term',size_hint=[0.1,1],on_press=lambda a:self.term_action(2))
		simt=Label(text='[b]only simple intrest every month                    [/b]',markup=True)
		simm.add_widget(self.simc2)
		simm.add_widget(simt)
		self.main_grid.add_widget(sixm)
		self.main_grid.add_widget(simm)
		self.main_grid.add_widget(BoxLayout(size_hint=[1,0.1]))

		#ok button
		ok=Button(text='ok',background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.intrest_cal())
		self.main_grid.add_widget(ok)

		#displaying the date
		see_date=Label(text='[b]the total number of days is[/b]',markup=True)
		self.dateo=TextInput(text='',font_name='fff',hint_text_color=[0,1,0.5,1],readonly=True,markup=True,foreground_color=[1,0,0,1])
		self.main_grid.add_widget(see_date)
		self.main_grid.add_widget(self.dateo)

		#displaying the amount
		see_amount=BoxLayout()
		amountt=Label(text='[b]the total amount is[/b]',markup=True)
		details=Button(text='full',size_hint=[0.4,1],background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:popu2().open())
		see_amount.add_widget(amountt)
		see_amount.add_widget(details)
		self.main_grid.add_widget(see_amount)
		self.amounto=TextInput(text='',font_name='fff',hint_text_color=[0,1,0.5,1],readonly=True,markup=True,foreground_color=[1,0,0,1])
		self.main_grid.add_widget(self.amounto)

       	
        
		#side-hidden panel
		#to add this all to have to add main panel and the side panel to navigationdrawer
		navigationdrawer = NavigationDrawer()                
		navigationdrawer.anim_type = 'fade_in'    
		self.side_panel=BoxLayout(orientation='vertical')        
		value=['vijayawada','guntur','hyderabad','rajahmundry','nellore','visakhapatnam','kakinada','warangal','proddatur','bangalore','delhi','chennai','mumbai','kolkata']        
		
		s1=Spinner(text='vijayawada',values=value,size_hint_y=None,sync_height = True,background_normal='button-on.jpeg',background_down='button-down.jpeg')     
		tex1=Label(text='gold price in the city is')        
		self.rateo1=TextInput(readonly=True,font_name='fff',markup=True,foreground_color=[1,0,0,1])
		ok1=Button(text='ok',size_hint=[0.4,1],readonly=True,background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.dis(s1.text,1))
		box1=BoxLayout()
		box1.add_widget(self.rateo1)
		box1.add_widget(ok1)
        
		s2=Spinner(text='guntur',values=value,size_hint_y=None,sync_height = True,background_normal='button-on.jpeg',background_down='button-down.jpeg')        
		tex2=Label(text='gold price in the city is')        
		self.rateo2=TextInput(readonly=True,font_name='fff',markup=True,foreground_color=[1,0,0,1])
		ok2=Button(text='ok',size_hint=[0.4,1],readonly=True,background_normal='button-on.jpeg',background_down='button-down.jpeg',on_press=lambda a:self.dis(s2.text,2))
		box2=BoxLayout()
		box2.add_widget(self.rateo2)
		box2.add_widget(ok2)
        
		tex3=Label(text='silver price in India(1KG)')        
		rateo3=TextInput(readonly=True,font_name='fff',markup=True,foreground_color=[1,0,0,1])
       
		but1=Button(text='about',background_normal='button-on.jpeg',background_down='button-down.jpeg')        
		self.side_panel.add_widget(s1)        
		self.side_panel.add_widget(tex1)        
		self.side_panel.add_widget(box1)        
		self.side_panel.add_widget(BoxLayout())        
		self.side_panel.add_widget(s2)        
		self.side_panel.add_widget(tex2)        
		self.side_panel.add_widget(box2)        
		self.side_panel.add_widget(BoxLayout())        
		self.side_panel.add_widget(tex3)        
		self.side_panel.add_widget(rateo3)        
		self.side_panel.add_widget(but1)
       
		navigationdrawer.add_widget(self.side_panel)
		navigationdrawer.add_widget(self.main_grid)

		#adding the complete grid to screen
		
		self.add_widget(navigationdrawer)
Exemplo n.º 7
0
    def build(self):
        self.store = JsonStore('scripts.json')

        self.appview = NavigationDrawer()
        self.appview.anim_type = 'reveal_below_anim'

        side_panel = BoxLayout(orientation='vertical')

        title = Label(text='Pycalc')
        title.size = self.appview.width, 30
        title.size_hint_y = None
        side_panel.add_widget(title)

        new_btn = Button(text='New Script')
        new_btn.size = self.appview.width, 50
        new_btn.size_hint_y = None
        new_btn.bind(on_press=lambda _: self.new_script())
        side_panel.add_widget(new_btn)

        s_in = TextInput()
        s_in.multiline = False
        s_in.size = self.appview.width, 50
        s_in.size_hint_y = None

        def show_s_in():
            s_in.height, s_in.opacity, s_in.disabled = 50, 1, False
            save_btn.height, save_btn.opacity, save_btn.disabled = 0, 0, True

            def focus():
                s_in.focus = True

            Clock.schedule_once(lambda dt: focus(), 0.1)

        def hide_s_in(x=False):
            if x:
                return
            s_in.height, s_in.opacity, s_in.disabled = 0, 0, True
            save_btn.height, save_btn.opacity, save_btn.disabled = 50, 1, False

        save_btn = Button(text='Save Script')
        save_btn.size = self.appview.width, 50
        save_btn.size_hint_y = None
        save_btn.bind(on_press=lambda _: show_s_in())
        side_panel.add_widget(save_btn)

        s_in.bind(on_text_validate=lambda instance: self.save_script(
            instance.text.strip()))
        s_in.bind(focused=lambda _, x: hide_s_in(x))
        hide_s_in()

        side_panel.add_widget(s_in)

        load_btn = Button(text='Load Script')
        load_btn.size = self.appview.width, 50
        load_btn.size_hint_y = None
        load_btn.bind(on_press=lambda _: self.load_script())
        side_panel.add_widget(load_btn)

        self.appview.add_widget(side_panel)

        self.main_panel = ScrollableText()
        self.appview.add_widget(self.main_panel)

        return self.appview