Ejemplo n.º 1
0
        def __init__(self, x, y, parent_window, show=True):

            ckit.TextWindow.__init__(
                self,
                x=x,
                y=y,
                width=29,
                height=2,
                origin=ORIGIN_X_CENTER | ORIGIN_Y_CENTER,
                parent_window=parent_window,
                show=show,
                bg_color=ckit.getColor("bg"),
                cursor0_color=ckit.getColor("cursor0"),
                cursor1_color=ckit.getColor("cursor1"),
                resizable=False,
                title="ホットキー",
                minimizebox=False,
                maximizebox=False,
                cursor=True,
                close_handler=self.onClose,
                keydown_handler=self.onKeyDown,
            )

            self.setCursorPos(-1, -1)

            self.result = RESULT_CANCEL

            activate_vk = clnch_ini.getint("HOTKEY", "activate_vk", 0)
            activate_mod = clnch_ini.getint("HOTKEY", "activate_mod", 0)

            self.activate_hotkey = ckit.HotKeyWidget(self, 0, 0, self.width(),
                                                     1, activate_vk,
                                                     activate_mod)

            self.plane_statusbar = ckit.ThemePlane3x3(self, 'bar.png', 2)
            client_rect = self.getClientRect()
            tmp, statusbar_top = self.charToClient(0, self.height() - 1)
            self.plane_statusbar.setPosSize(0, statusbar_top,
                                            client_rect[2] - 0,
                                            client_rect[3] - statusbar_top)
            self.status_bar = clnch_statusbar.StatusBar()
            self.status_bar_layer = clnch_statusbar.SimpleStatusBarLayer()
            self.status_bar.registerLayer(self.status_bar_layer)

            self.updateStatusBar()

            self.paint()
Ejemplo n.º 2
0
    def load( self, section ):
        for i in range(100):
            try:
                item =ckit.normPath( clnch_ini.get( section, "playlist_%d"%(i,) ) )
                self.items.append(item)
            except:
                break
        
        self.cursor = clnch_ini.getint( section, "track", 0 )
        self.position = clnch_ini.getint( section, "position", 0 )

        self.cursor = min( self.cursor, len(self.items) )
        self.song_name = self.items[self.cursor]
        self.play()
        self.seek(self.position)
        self.pause()
        self.main_window.paint()
Ejemplo n.º 3
0
    def load(self, section):
        for i in range(100):
            try:
                item = ckit.normPath(
                    clnch_ini.get(section, "playlist_%d" % (i, )))
                self.items.append(item)
            except:
                break

        self.cursor = clnch_ini.getint(section, "track", 0)
        self.position = clnch_ini.getint(section, "position", 0)

        self.cursor = min(self.cursor, len(self.items))
        self.song_name = self.items[self.cursor]
        self.play()
        self.seek(self.position)
        self.pause()
        self.main_window.paint()
Ejemplo n.º 4
0
        def __init__(self, x, y, parent_window, show=True):

            ckit.Window.__init__(
                self,
                x=x,
                y=y,
                width=29,
                height=2,
                origin=ORIGIN_X_CENTER | ORIGIN_Y_CENTER,
                parent_window=parent_window,
                show=show,
                bg_color=ckit.getColor("bg"),
                cursor0_color=ckit.getColor("cursor0"),
                cursor1_color=ckit.getColor("cursor1"),
                resizable=False,
                title="ホットキー",
                minimizebox=False,
                maximizebox=False,
                cursor=True,
                close_handler=self.onClose,
                keydown_handler=self.onKeyDown,
            )

            self.setCursorPos(-1, -1)

            self.result = RESULT_CANCEL

            activate_vk = clnch_ini.getint("HOTKEY", "activate_vk", 0)
            activate_mod = clnch_ini.getint("HOTKEY", "activate_mod", 0)

            self.activate_hotkey = ckit.HotKeyWidget(self, 0, 0, self.width(), 1, activate_vk, activate_mod)

            self.plane_statusbar = ckit.ThemePlane3x3(self, "bar.png", 2)
            client_rect = self.getClientRect()
            tmp, statusbar_top = self.charToClient(0, self.height() - 1)
            self.plane_statusbar.setPosSize(0, statusbar_top, client_rect[2] - 0, client_rect[3] - statusbar_top)
            self.status_bar = clnch_statusbar.StatusBar()
            self.status_bar_layer = clnch_statusbar.SimpleStatusBarLayer()
            self.status_bar.registerLayer(self.status_bar_layer)

            self.updateStatusBar()

            self.paint()
Ejemplo n.º 5
0
def _configMinWidth(main_window):

    width_list = range(12, 81)

    min_width = clnch_ini.getint("GEOMETRY", "min_width", 18)

    try:
        initial_select = width_list.index(min_width)
    except:
        initial_select = 0

    width_list = list(map(str, width_list))

    result = clnch_listwindow.popMenu(main_window, 40, 16, "最小のウインドウサイズ",
                                      width_list, initial_select)
    if result < 0: return

    clnch_ini.set("GEOMETRY", "min_width", width_list[result])
Ejemplo n.º 6
0
def _configMinWidth(main_window):

    width_list = range(12, 81)

    min_width = clnch_ini.getint("GEOMETRY", "min_width", 18)

    try:
        initial_select = width_list.index(min_width)
    except:
        initial_select = 0

    width_list = list(map(str, width_list))

    result = clnch_listwindow.popMenu(main_window, 40, 16, "最小のウインドウサイズ", width_list, initial_select)
    if result < 0:
        return

    clnch_ini.set("GEOMETRY", "min_width", width_list[result])
Ejemplo n.º 7
0
def _configFontSize(main_window):

    size_list = range(6, 33)

    current_font_size = clnch_ini.getint("FONT", "size", 12)

    try:
        initial_select = size_list.index(current_font_size)
    except:
        initial_select = 0

    size_list = list(map(str, size_list))

    result = clnch_listwindow.popMenu(main_window, 40, 16, "フォントサイズ",
                                      size_list, initial_select)
    if result < 0: return

    clnch_ini.set("FONT", "size", size_list[result])

    main_window.updateFont()
Ejemplo n.º 8
0
def _configFontSize(main_window):

    size_list = range(6, 33)

    current_font_size = clnch_ini.getint("FONT", "size", 12)

    try:
        initial_select = size_list.index(current_font_size)
    except:
        initial_select = 0

    size_list = list(map(str, size_list))

    result = clnch_listwindow.popMenu(main_window, 40, 16, "フォントサイズ", size_list, initial_select)
    if result < 0:
        return

    clnch_ini.set("FONT", "size", size_list[result])

    main_window.updateFont()
Ejemplo n.º 9
0
 def loadState(self):
     self.window_normal_x = clnch_ini.getint( "CONSOLE", "x", 0 )
     self.window_normal_y = clnch_ini.getint( "CONSOLE", "y", 0 )
     self.window_normal_width = clnch_ini.getint( "CONSOLE", "width", 80 )
     self.window_normal_height = clnch_ini.getint( "CONSOLE", "height", 32 )
Ejemplo n.º 10
0
 def updateFont(self):
     fontname = clnch_ini.get( "FONT", "name", "" )
     self.setFont( fontname, clnch_ini.getint( "FONT", "size", 12 ) )
     window_rect = self.getWindowRect()
     self.setPosSize( window_rect[0], window_rect[1], self.width(), self.height(), 0 )
Ejemplo n.º 11
0
 def loadState(self):
     self.window_normal_x = clnch_ini.getint("CONSOLE", "x", 0)
     self.window_normal_y = clnch_ini.getint("CONSOLE", "y", 0)
     self.window_normal_width = clnch_ini.getint("CONSOLE", "width", 80)
     self.window_normal_height = clnch_ini.getint("CONSOLE", "height", 32)