class ButtonInRotabox(Rotabox):
    def __init__(self, **kwargs):
        super(ButtonInRotabox, self).__init__(**kwargs)
        self.btn = Button(text='A Button in Rotabox', on_press=self.rotate)
        self.add_widget(self.btn)
        # self.draw_bounds = True

    def on_touch_down(self, touch):
        if self.collide_point(*touch.pos):
            self.btn.dispatch('on_press')
            self.btn._do_press()

    def on_touch_up(self, touch):
        if self.collide_point(*touch.pos):
            self.btn._do_release()

    def rotate(self, *args):
        self.angle -= 5
Beispiel #2
0
class Login(BoxLayout):
    def __init__(self, **kwargs):
        
        super(Login, self).__init__(size_hint=(None,None), spacing=10, size=(400,300), orientation='vertical', **kwargs)
        self.center = Window.center
        
        self.lb_superiormenu = Label(text='Tour    |    [ref=signup]Sign up[/ref]    |    Contact', markup=True)
        
        
        self.lb_netget = Label(text='Netget', font_size=36)
        
        self.txt_username = TextBox(text='Username', size_hint_y=None, height=40)
        self.txt_password = TextBox(text='Password', size_hint_y=None, height=40, password=True, multiline=False)
        
        
        self.cbx_remmemberme = LabelItem(caption='Remmember me', 
                                            texthalign='left',
                                            itemtype=CheckBox, 
                                            widgetposition='left', 
                                            item_kwargs={'size_hint_x':None, 'width':30, 'active':True})
        
        self.btn_submit = Button(text='Login')
        
        self.message = Label(markup=True)
        
        self.add_widget(self.lb_superiormenu)
        self.add_widget(self.lb_netget)
        self.add_widget(self.txt_username)
        self.add_widget(self.txt_password)
        self.add_widget(self.btn_submit)
        self.add_widget(self.message)
        self.add_widget(self.cbx_remmemberme)
        
        
        self.txt_password.bind(on_text_validate=self.enterpassword)
        
    def enterpassword(self, w):
        print 'Loging from password enter'
        self.btn_submit.dispatch('on_press')