def send_picture(self, instance): self.reset_gui(self.GUI_widget, instance) try: self.cameraObject.play = False self.GUI_widget.remove_widget(self.cameraObject) except: print("Failed To Remove CameraObject from GUI!") #Load Appropriate number of images, then bind them to event #Load Keyboard, and once the binded event (click of selfie) #send email if the email parameter is filled self.selected_selfie_source = None emailAddr_label = Label(text='Type Your Email Below:', pos=(850,275), font_size=30) self.GUI_widget.add_widget(emailAddr_label) emailAddr_query_input = TextInput(pos=(700,200), font_size=16) emailAddr_query_input.size = (400,100) send_email_button = Button(text='Send Email',pos=(700,100), font_size=30) self.sendEmailInput = emailAddr_query_input send_email_button.size = (400,100) self.GUI_widget.add_widget(emailAddr_query_input) self.GUI_widget.add_widget(send_email_button) keyboard = VKeyboard(pos=(0,0)) self.GUI_widget.add_widget(keyboard) #print("keyboard dimensions are: ", keyboard.height, keyboard.width) keyboard.size = (700,400) keyboard_press = partial(self.keyboard_press_email, self.GUI_widget, instance, self.sendEmailInput) keyboard.bind(on_key_up=keyboard_press) #load_tshirt_arg = partial(self.load_tshirt_buttons, self.searchShirtInput) send_email_button.bind(on_release=self.prepare_selfie_email) self.load_selfies() return
def update_gui(self, widget, instance): #All buttons call this function #Based on the instance name, #we will redirect to other appropriate functions #print("Button Instance Pressed", instance.text) if(instance.text == "Search Shirts"): self.reset_gui(self.GUI_widget, instance) shirtQuery_label = Label(text='Type T-Shirt Query Below:', pos=(850,275), font_size=30) self.GUI_widget.add_widget(shirtQuery_label) tshirt_query_input = TextInput(pos=(700,200), font_size=16) tshirt_query_input.size = (400,100) search_tshirt_button = Button(text='Search',pos=(700,100), font_size=30) self.searchShirtInput = tshirt_query_input search_tshirt_button.size = (400,100) widget.add_widget(tshirt_query_input) widget.add_widget(search_tshirt_button) keyboard = VKeyboard(pos=(0,0)) widget.add_widget(keyboard) #print("keyboard dimensions are: ", keyboard.height, keyboard.width) keyboard.size = (700,400) keyboard_press = partial(self.keyboard_press, widget, instance, self.searchShirtInput) keyboard.bind(on_key_up=keyboard_press) #load_tshirt_arg = partial(self.load_tshirt_buttons, self.searchShirtInput) search_tshirt_button.bind(on_release=self.load_tshirt_buttons) #Clock.schedule_once(self.add_webcam(),5) if(instance.text == "Overlay Pic"): self.overlay_picture(instance) if(instance.text == "Send Pic"): self.send_picture(instance) if(instance.text == "Take Pic"): self.prep_photoshoot(instance) if(instance.text == "Exit"): self.close_app(instance) return
def _add_keyboards(self): """ Add a buttons for each available keyboard layout. When clicked, the buttons will change the keyboard layout to the one selected. """ layouts = VKeyboard().available_layouts.keys() layouts.append("numeric.json") # Add the file in our app directory # Note the .json extension is required for key in layouts: self.kbContainer.add_widget( Button(text=key, on_release=partial(self.set_layout, key)))
def _add_keyboards(self): """ Add a buttons for each available keyboard layout. When clicked, the buttons will change the keyboard layout to the one selected. """ layouts = VKeyboard().available_layouts.keys() layouts.append("numeric.json") # Add the file in our app directory # Note the .json extension is required for key in layouts: self.kbContainer.add_widget( Button( text=key, on_release=partial(self.set_layout, key)))
def __init__(self, **kwargs): # 父类构造方法 super().__init__(**kwargs) # 自定义键盘 vk = VKeyboard() # 键盘信号与槽 vk.bind(on_key_up=self.key_up) # 加组件(键盘) self.add_widget(vk)
def build(self): self.Pencere = BoxLayout(orientation="vertical") self.bos = BoxLayout(orientation="vertical") self.ekran_box = FloatLayout() self.ekran = TextInput(size_hint=(1, .2), pos=(100, 200)) self.ekran_box.add_widget(self.ekran) self.klavye_box = AnchorLayout(anchor_x="right", anchor_y="bottom") self.klavye = VKeyboard() self.klavye_box.add_widget(self.klavye) self.Pencere.add_widget(self.bos) self.Pencere.add_widget(self.ekran_box) self.Pencere.add_widget(self.klavye_box) return self.Pencere
def showKeyboard(): keyboard = VKeyboard() return keyboard
def on_press(self): vk = VKeyboard() vk.layout = 'keyboards/keyboard.json' self.parent.add_widget(vk)
def __init__(self): """ Build a list of available keyboard layouts.""" super(KeyboardListener, self).__init__() self.layouts = [key for key in VKeyboard().available_layouts.keys()]