Exemplo n.º 1
0
 def action(self, show=None):
     if show is None:
         super().action()
     else:
         self.checked = show
     win32gui.ShowWindow(self.hconsole, self.checked)
     if self.checked:
         try:
             win32gui.SetForegroundWindow(self.hconsole)
         except Exception as exc:
             logger.debug(exc, exc_info=True)
Exemplo n.º 2
0
class MainWindow():
    """ The main application window class """
    def __init__(self):
        # initial projector pixel values
        pixels = [[513, 959], [488, 1129], [531, 1148], [570,
                                                         1117], [595, 1049],
                  [605, 960], [597, 871], [573, 802], [535, 771], [491, 789],
                  [507, 1335], [602, 1355], [673, 1278], [715,
                                                          1136], [730, 961],
                  [719, 787], [679, 644], [610, 565], [514, 583], [619, 1604],
                  [761, 1584], [848, 1439], [895, 1220], [912, 963],
                  [901, 707], [858, 486], [773, 339], [632, 317], [745, 1760],
                  [892, 1698], [974, 1513], [1016, 1256], [1032, 964],
                  [1022, 673], [985, 415], [907, 228], [761, 164]]
        points = [[p[1], p[0]] for p in pixels]
        # convert (u,v) to (row, column)
        self._pixels = [[int(p[1]) + 0.5, int(p[0]) + 0.5] for p in points]
        # initialize the increment for each pixel in the image
        self._increment = 10
        # initialize the pixel selected for moving
        self._selected_pixel = 0
        # setup the window
        self._name = "MainWindow"
        self._title = "Dome Calibration"
        self._width = PROJECTOR_PIXEL_WIDTH
        self._height = PROJECTOR_PIXEL_HEIGHT
        self._style = window_styles["regular"]
        self._fullscreen = False
        win32gui.InitCommonControls()
        self._hinstance = win32gui.dllhandle
        wc = win32gui.WNDCLASS()
        wc.lpszClassName = self._name
        wc.style = win32con.CS_GLOBALCLASS | win32con.CS_VREDRAW | win32con.CS_HREDRAW
        wc.hCursor = win32gui.LoadCursor(0, win32con.IDC_ARROW)
        wc.lpfnWndProc = self.window_process
        try:
            classAtom = win32gui.RegisterClass(wc)
        except win32gui.error, err_info:
            if err_info.winerror != winerror.ERROR_CLASS_ALREADY_EXISTS:
                raise
        self._onscreen_display = (0, 0, self._width, 30)
        self._hwnd = win32gui.CreateWindow(self._name, self._title,
                                           self._style, win32con.CW_USEDEFAULT,
                                           win32con.CW_USEDEFAULT, self._width,
                                           self._height, None, None,
                                           self._hinstance, None)
        win32gui.ShowWindow(self._hwnd, win32con.SW_SHOW)
        win32gui.UpdateWindow(self._hwnd)
        # This is used to stop autorepeat which is annoying for our purposes
        self._first_keydown = True
        self._display_string = ""
        self._show_help = False
Exemplo n.º 3
0
 def show(self):
     win32gui.ShowWindow(self.hwnd, win32con.SW_NORMAL)
Exemplo n.º 4
0
 def hide(self):
     print("hide")
     win32gui.ShowWindow(self.hwnd, win32con.SW_HIDE)
     self.hidden = True
Exemplo n.º 5
0
 def show(self):
     # print("show")
     if self.hwnd:
         win32gui.ShowWindow(self.hwnd, win32con.SW_NORMAL)
         self.hidden = False
         self.clear_script()
Exemplo n.º 6
0
 def ShowWindow(self, mode):
     win32gui.ShowWindow(self.hwnd, mode)