コード例 #1
0
    def __init__(self):
        super(self.__class__, self).__init__()

        self.shutdown_btn = ui.Button(ui.col_rect_mini(2, 1, 4, 2), 'Shutdown')
        self.shutdown_btn.on_clicked.connect(self.shutdown_btn_click)
        self.add_child(self.shutdown_btn)

        self.reboot_btn = ui.Button(ui.col_rect_mini(2, 3, 4, 2), 'Reboot')
        self.reboot_btn.on_clicked.connect(self.reboot_btn_click)
        self.add_child(self.reboot_btn)
コード例 #2
0
    def __init__(self):
        ui.Scene.__init__(self)

        scroll_rect = ui.col_rect_mini(0, 1, 8, 4)
        # self.ap_listview = ui.StringListView(pygame.Rect(0, 0, scroll_rect.w, scroll_rect.h), ["hoge1", "hoge2"], row_num=0)
        #
        # self.scroll_view = ui.ScrollView(scroll_rect, self.ap_listview)
        # self.ap_listview.minimize = self.scroll_view.content_frame.rect.size
        self.scroll_view = ui.ScrollStringListView(scroll_rect,
                                                   ["hoge1", "hoge2"])
        self.scroll_view.on_selected.connect(self.hoge)
        self.add_child(self.scroll_view)

        btn = ui.Button(ui.col_rect_mini(7, 0, 1, 1), 'X')
        btn.on_clicked.connect(self.back)
        self.add_child(btn)
コード例 #3
0
 def __init__(self):
     super(self.__class__, self).__init__()
     
     scan_btn = ui.Button(ui.col_rect_mini(1, 5, 6, 1), 'Scan')
     scan_btn.on_clicked.connect(self.scan)
     self.add_child(scan_btn)
     
     scan_label = ui.Label(ui.col_rect_mini(1, 0, 6, 1), 'Select WiFi network...')
     self.add_child(scan_label)
     
     # self.ap_listview = ui.StringListView(ui.col_rect_mini(0, 1, 8, 4), [], row_num=4)
     self.ap_listview = ui.ScrollStringListView(ui.col_rect_mini(0, 1, 8, 4), [],)
     # self.ap_listview.items_font = pygame.font.SysFont('Courier New', 20, bold=True)
     self.ap_listview.on_selected.connect(self.ap_selected)
     self.add_child(self.ap_listview)
     
     self.pifi = pifi.PiFi()
コード例 #4
0
    def __init__(self):
        ui.Scene.__init__(self)

        btn = ui.Button(ui.col_rect_mini(7, 0, 1, 1, padding=3), 'X')
        btn.on_clicked.connect(self.back)
        self.add_child(btn)
コード例 #5
0
    def __init__(self):
        super(self.__class__, self).__init__()

        scriptdir = os.path.dirname(os.path.abspath(__file__))
        print scriptdir
        images_folder = "images"

        self.network_image = pygame.image.load(
            os.path.join(scriptdir, images_folder,
                         "appbar.network.png")).convert_alpha()
        self.network_imageview = ui.ImageView(
            ui.col_rect_mini(0, 0, 1, 1, padding=1), self.network_image)
        self.add_child(self.network_imageview)
        self.ip_label = ui.Label(ui.col_rect_mini(1, 0, 3, 1, padding=1), '')
        self.ip_label.font = pygame.font.Font(
            ui.resource.get_font_path("VL-PGothic-Regular"), 14)
        self.add_child(self.ip_label)

        self.wifi_image = pygame.image.load(
            os.path.join(scriptdir, images_folder,
                         "appbar.wifi.png")).convert_alpha()
        self.wifi_imageview = ui.ImageView(
            ui.col_rect_mini(4, 0, 1, 1, padding=1), self.wifi_image)
        self.add_child(self.wifi_imageview)
        self.wifi_ip_label = ui.Label(ui.col_rect_mini(5, 0, 3, 1, padding=1),
                                      '')
        self.wifi_ip_label.font = pygame.font.Font(
            ui.resource.get_font_path("VL-PGothic-Regular"), 14)
        self.add_child(self.wifi_ip_label)

        self.date_label = ui.Label(ui.col_rect_mini(0, 1, 5, 1, padding=2),
                                   '',
                                   halign=ui.LEFT)
        self.date_label.font = pygame.font.Font(
            ui.resource.get_font_path("VL-PGothic-Regular"), 20)
        self.add_child(self.date_label)

        self.time_label = ui.Label(ui.col_rect_mini(0, 2, 5, 2),
                                   '',
                                   halign=ui.LEFT)
        self.time_label.font = pygame.font.Font(
            ui.resource.get_font_path("VL-PGothic-Regular"), 48)
        self.add_child(self.time_label)

        self.obj_r = ui.Button(ui.col_rect_mini(5, 3, 3, 1), 'Proc')
        self.obj_r.on_clicked.connect(self.hoge)
        self.add_child(self.obj_r)

        self.obj_r2 = ui.Button(ui.col_rect_mini(5, 4, 3, 1), 'vkey')
        self.obj_r2.on_clicked.connect(self.hoge2)
        self.add_child(self.obj_r2)

        self.wifi_btn = ui.Button(ui.col_rect_mini(5, 1, 3, 2), 'WiFi')
        self.wifi_btn.on_clicked.connect(self.wifi_button_click)
        self.add_child(self.wifi_btn)

        # self.reboot_btn = ui.Button(ui.col_rect_mini(0, 4, 3, 2), 'Reboot')
        # self.reboot_btn.on_clicked.connect(self.reboot_button_click)
        # self.add_child(self.reboot_btn)

        # self.shutdown_btn = ui.Button(ui.col_rect_mini(5, 4, 3, 2), 'Shutdown')
        # self.shutdown_btn.on_clicked.connect(self.shutdown_button_click)
        # self.add_child(self.shutdown_btn)

        self.stop_flag = False

        self.power_image = pygame.image.load(
            os.path.join(scriptdir, images_folder,
                         "appbar.power.png")).convert_alpha()
        self.shutdown_img_btn = ui.ImageButton(
            ui.col_rect_mini(7, 5, 1, 1, margin=1, padding=1),
            self.power_image)
        self.shutdown_img_btn.on_clicked.connect(self.power_button_click)
        self.add_child(self.shutdown_img_btn)

        self.refresh_image = pygame.image.load(
            os.path.join(scriptdir, images_folder,
                         "appbar.refresh.png")).convert_alpha()
        self.change_lxde_img_btn = ui.ImageButton(
            ui.col_rect_mini(0, 5, 1, 1, margin=1, padding=1),
            self.refresh_image)
        self.change_lxde_img_btn.on_clicked.connect(self.change_lxde_btn_click)
        self.add_child(self.change_lxde_img_btn)