示例#1
0
    def __init__( self, debug=False ):
    
        self.initialized = False
        
        self.loadState()

        ckit.TextWindow.__init__(
            self,
            x = self.window_normal_x,
            y = self.window_normal_y,
            width = self.window_normal_width,
            height = self.window_normal_height,
            font_size = 12,
            bg_color = ckit.getColor("bg"),
            border_size = 2,
            title_bar = True,
            title = "Keyhac",
            show = keyhac_ini.getint( "CONSOLE", "visible", 1 ),
            sysmenu=True,
            activate_handler = self._onActivate,
            close_handler = self._onClose,
            move_handler = self._onMove,
            size_handler = self._onSize,
            keydown_handler = self._onKeyDown,
            #char_handler = self._onChar,

            lbuttondown_handler = self._onLeftButtonDown,
            lbuttonup_handler = self._onLeftButtonUp,
            mbuttondown_handler = self._onMiddleButtonDown,
            mbuttonup_handler = self._onMiddleButtonUp,
            rbuttondown_handler = self._onRightButtonDown,
            rbuttonup_handler = self._onRightButtonUp,
            lbuttondoubleclick_handler = self._onLeftButtonDoubleClick,
            mousemove_handler = self._onMouseMove,
            mousewheel_handler= self._onMouseWheel,
            )

        self.theme_enabled = False
        try:
            self.createThemePlane()
        except:
            traceback.print_exc()

        self.debug = debug

        self.log = Log()
        self.scroll_info = ckit.ScrollInfo()
        
        self.mouse_click_info = None
        self.selection = [ [ 0, 0 ], [ 0, 0 ] ]

        self.initialized = True
    
        self.paint()
示例#2
0
    def __init__(self, debug=False):

        self.initialized = False

        self.loadState()

        ckit.TextWindow.__init__(
            self,
            x=self.window_normal_x,
            y=self.window_normal_y,
            width=self.window_normal_width,
            height=self.window_normal_height,
            font_size=12,
            bg_color=ckit.getColor("bg"),
            border_size=2,
            title_bar=True,
            title="Keyhac",
            show=keyhac_ini.getint("CONSOLE", "visible", 1),
            sysmenu=True,
            activate_handler=self._onActivate,
            close_handler=self._onClose,
            move_handler=self._onMove,
            size_handler=self._onSize,
            keydown_handler=self._onKeyDown,
            #char_handler = self._onChar,
            lbuttondown_handler=self._onLeftButtonDown,
            lbuttonup_handler=self._onLeftButtonUp,
            mbuttondown_handler=self._onMiddleButtonDown,
            mbuttonup_handler=self._onMiddleButtonUp,
            rbuttondown_handler=self._onRightButtonDown,
            rbuttonup_handler=self._onRightButtonUp,
            lbuttondoubleclick_handler=self._onLeftButtonDoubleClick,
            mousemove_handler=self._onMouseMove,
            mousewheel_handler=self._onMouseWheel,
        )

        self.theme_enabled = False
        try:
            self.createThemePlane()
        except:
            traceback.print_exc()

        self.debug = debug

        self.log = Log()
        self.scroll_info = ckit.ScrollInfo()

        self.mouse_click_info = None
        self.selection = [[0, 0], [0, 0]]

        self.initialized = True

        self.paint()
示例#3
0
 def loadState(self):
     self.window_normal_x = keyhac_ini.getint("CONSOLE", "x", 0)
     self.window_normal_y = keyhac_ini.getint("CONSOLE", "y", 0)
     self.window_normal_width = keyhac_ini.getint("CONSOLE", "width", 80)
     self.window_normal_height = keyhac_ini.getint("CONSOLE", "height", 32)
示例#4
0
 def loadState(self):
     self.window_normal_x = keyhac_ini.getint( "CONSOLE", "x", 0 )
     self.window_normal_y = keyhac_ini.getint( "CONSOLE", "y", 0 )
     self.window_normal_width = keyhac_ini.getint( "CONSOLE", "width", 80 )
     self.window_normal_height = keyhac_ini.getint( "CONSOLE", "height", 32 )
示例#5
0
    def __init__( self, debug=False ):
    
        self.initialized = False
        
        self.loadState()
        
        self.font_name = "MS Gothic"
        self.font_size = 12

        # ウインドウの左上位置のDPIによってをフォントサイズ決定する
        dpi_scale = ckit.TextWindow.getDisplayScalingFromPosition( self.window_normal_x, self.window_normal_y )
        scaled_font_size = round( self.font_size * dpi_scale )
        
        ckit.TextWindow.__init__(
            self,
            x = self.window_normal_x,
            y = self.window_normal_y,
            width = self.window_normal_width,
            height = self.window_normal_height,
            font_name = self.font_name,
            font_size = scaled_font_size,
            bg_color = ckit.getColor("bg"),
            border_size = 2,
            title_bar = True,
            title = "Keyhac",
            show = keyhac_ini.getint( "CONSOLE", "visible", 1 ),
            sysmenu=True,
            activate_handler = self._onActivate,
            close_handler = self._onClose,
            move_handler = self._onMove,
            size_handler = self._onSize,
            dpi_handler = self._onDpi,
            keydown_handler = self._onKeyDown,

            lbuttondown_handler = self._onLeftButtonDown,
            lbuttonup_handler = self._onLeftButtonUp,
            mbuttondown_handler = self._onMiddleButtonDown,
            mbuttonup_handler = self._onMiddleButtonUp,
            rbuttondown_handler = self._onRightButtonDown,
            rbuttonup_handler = self._onRightButtonUp,
            lbuttondoubleclick_handler = self._onLeftButtonDoubleClick,
            mousemove_handler = self._onMouseMove,
            mousewheel_handler= self._onMouseWheel,
            )

        # モニター境界付近でウインドウが作成された場合を考慮して、DPIを再確認する
        dpi_scale2 = self.getDisplayScaling()
        if dpi_scale2 != dpi_scale:
            self._updateFont( x_center = True )

        self.theme_enabled = False
        try:
            self.createThemePlane()
        except:
            traceback.print_exc()

        self.debug = debug

        self.log = Log()
        self.scroll_info = ckit.ScrollInfo()
        
        self.mouse_click_info = None
        self.selection = [ [ 0, 0 ], [ 0, 0 ] ]

        self.initialized = True
    
        self.paint()