当前位置: 首页>>代码示例>>Python>>正文


Python win32con.SW_MAXIMIZE属性代码示例

本文整理汇总了Python中win32con.SW_MAXIMIZE属性的典型用法代码示例。如果您正苦于以下问题:Python win32con.SW_MAXIMIZE属性的具体用法?Python win32con.SW_MAXIMIZE怎么用?Python win32con.SW_MAXIMIZE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在win32con的用法示例。


在下文中一共展示了win32con.SW_MAXIMIZE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: maximizeMax

# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_MAXIMIZE [as 别名]
def maximizeMax(self):
		"""
			Maximize max to ensure that the Time Configuration button is on the monitor and clickable, and to 
			ensure that the dialogs will be on screen.
		"""
		self.restoreMaxWindow = False
		maxHwnd = GetWindowHandle()
		if GetWindowPlacement(maxHwnd)[1] == win32con.SW_SHOWNORMAL:
			ShowWindow( maxHwnd, win32con.SW_MAXIMIZE )
			self.restoreMaxWindow = True
			QTimer.singleShot(self.timerDelay, self.mouseToTimeButton)
			return
		self.mouseToTimeButton() 
开发者ID:blurstudio,项目名称:cross3d,代码行数:15,代码来源:rescaletime.py

示例2: get_state

# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_MAXIMIZE [as 别名]
def get_state(self):
        """Return wheter the window is maximized or not, or minimized or full screen."""
        flags, state, ptMin, ptMax, rect = win32gui.GetWindowPlacement(self.base_handler_id)
        if DEBUG_WM:
            print "state", state
        if state == win32con.SW_MAXIMIZE:
            return MAXIMIZED
        elif state == win32con.SW_MINIMIZE:
            return MINIMIZED
        return NORMAL 
开发者ID:mcgreentn,项目名称:GDMC,代码行数:12,代码来源:mcplatform.py

示例3: set_state

# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_MAXIMIZE [as 别名]
def set_state(self, state=NORMAL, size=(-1, -1), pos=(-1, -1), update=True):
        """Set wheter the window is maximized or not, or minimized or full screen.
        If no argument is given, assume the state will be windowed and not maximized.
        If arguments are given, only the first is relevant. The other ones are ignored.

        ** Only maximized and normal states are implemented for now. **

        :state: valid arguments:
        'minimized', MINIMIZED, 0.
        'normal', NORMAL, 1: windowed, not maximized.
        'maximized', MAXIMIZED, 2.
        'fullscreen, FULLSCREEN, 3.

        :size: list, tuple: the new size; if (-1, -1) self.get_size() is used.
               If one element is -1 it is replaced by the corresponding valur from self.get_size().
        :pos: list, tuple: the new position; if (-1, -1), self.get_position is used.
              If one element is -1 it is replaced by the corresponding valur from self.get_position().
        :update: bool: whether to call the internal flush method."""
        if state not in (0, MINIMIZED, 'minimized', 1, NORMAL, 'normal', 2, MAXIMIZED, 'maximized', 3, FULLSCREEN, 'fullscreen'):
            # Raise a value error.
            raise ValueError, "Invalid state argument: %s is not a correct value" % state
        if type(size) not in (list, tuple):
            raise TypeError, "Invalid size argument: %s is not a list or a tuple."
        if type(pos) not in (list, tuple):
            raise TypeError, "Invalid pos argument: %s is not a list or a tuple."

        if state in (1, NORMAL, 'normal'):
            size = list(size)
            sz = self.get_size()
            if size[0] == -1:
                size[0] = sz[0]
            if size[1] == -1:
                size[1] = sz[1]
            pos = list(pos)
            ps = self.get_position()
            if pos[0] == -1:
                pos[0] = ps[0]
            if pos[1] == -1:
                pos[1] = ps[1]
            self.set_mode(size, self.mode)
            self.set_position(pos)
        elif state in (0, MINIMIZED, 'minimized'):
            pass
        elif state in (2, MAXIMIZED, 'maximized'):
            win32gui.ShowWindow(self.base_handler_id, win32con.SW_MAXIMIZE)
        elif state in (3, FULLSCREEN, 'fullscreen'):
            pass 
开发者ID:mcgreentn,项目名称:GDMC,代码行数:49,代码来源:mcplatform.py

示例4: set_state

# 需要导入模块: import win32con [as 别名]
# 或者: from win32con import SW_MAXIMIZE [as 别名]
def set_state(self, state=NORMAL, size=(-1, -1), pos=(-1, -1), update=True):
        """Set wheter the window is maximized or not, or minimized or full screen.
        If no argument is given, assume the state will be windowed and not maximized.
        If arguments are given, only the first is relevant. The other ones are ignored.

        ** Only maximized and normal states are implemented for now. **

        :state: valid arguments:
        'minimized', MINIMIZED, 0.
        'normal', NORMAL, 1: windowed, not maximized.
        'maximized', MAXIMIZED, 2.
        'fullscreen, FULLSCREEN, 3.

        :size: list, tuple: the new size; if (-1, -1) self.get_size() is used.
               If one element is -1 it is replaced by the corresponding valur from self.get_size().
        :pos: list, tuple: the new position; if (-1, -1), self.get_position is used.
              If one element is -1 it is replaced by the corresponding valur from self.get_position().
        :update: bool: whether to call the internal flush method."""
        if state not in (0, MINIMIZED, 'minimized', 1, NORMAL, 'normal', 2, MAXIMIZED, 'maximized', 3, FULLSCREEN, 'fullscreen'):
            # Raise a value error.
            raise ValueError("Invalid state argument: %s is not a correct value" % state)
        if not isinstance(size, (list, tuple)):
            raise TypeError("Invalid size argument: %s is not a list or a tuple.")
        if not isinstance(pos, (list, tuple)):
            raise TypeError("Invalid pos argument: %s is not a list or a tuple.")

        if state in (1, NORMAL, 'normal'):
            size = list(size)
            sz = self.get_size()
            if size[0] == -1:
                size[0] = sz[0]
            if size[1] == -1:
                size[1] = sz[1]
            pos = list(pos)
            ps = self.get_position()
            if pos[0] == -1:
                pos[0] = ps[0]
            if pos[1] == -1:
                pos[1] = ps[1]
            self.set_mode(size, self.mode)
            self.set_position(pos)
        elif state in (0, MINIMIZED, 'minimized'):
            pass
        elif state in (2, MAXIMIZED, 'maximized'):
            win32gui.ShowWindow(self.base_handler_id, win32con.SW_MAXIMIZE)
        elif state in (3, FULLSCREEN, 'fullscreen'):
            pass 
开发者ID:Podshot,项目名称:MCEdit-Unified,代码行数:49,代码来源:mcplatform.py


注:本文中的win32con.SW_MAXIMIZE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。