本文整理匯總了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()
示例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
示例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
示例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