Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #4
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)