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


Python Window.focused_window方法代码示例

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


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

示例1: cmd_print_focused_window_classname

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def cmd_print_focused_window_classname(self):

        win32clipboard.OpenClipboard()
        win32clipboard.EmptyClipboard()
        win32clipboard.SetClipboardText(Window.focused_window().classname)
        win32clipboard.CloseClipboard()

        print(Window.focused_window().classname)
开发者ID:Tzbob,项目名称:python-windows-tiler,代码行数:10,代码来源:controller.py

示例2: shift_focused_window_down

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def shift_focused_window_down(self):
        """
        Switches the window to the next position
        """
        
        #get focused window
        window = Window.focused_window()

        #only grab and move the window if it is in the self
        if window in self.windows:

            i = self.windows.index(window)

            #if the foreground window is the last window, shift everything and place it first
            if i == len(self.windows) - 1:

                self.windows[0], self.windows[1:] = self.windows[i], self.windows[:i]

            #else shift it with the following window
            else:

                self.windows[i], self.windows[i+1] = self.windows[i+1], self.windows[i]

            self.tile_windows()

            if not window.focus():

                self.remove_window(window)
开发者ID:flying-circus,项目名称:python-windows-tiler,代码行数:30,代码来源:tiler.py

示例3: cmd_toggle_tiled_floating

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
 def cmd_toggle_tiled_floating(self):
     win = Window.focused_window(self.windows)
     if(win != None):
         if(win.floating):
             win.tile()
         else:
             win.float()
开发者ID:mm318,项目名称:python-windows-tiler,代码行数:9,代码来源:controller.py

示例4: shift_focused_window_up

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def shift_focused_window_up(self):
        """
        Switches the window to the previous position
        """

        window = Window.focused_window()

        #only grab and move the window if it is in the self
        if window in self.windows:

            i = self.windows.index(window)

            #if the foreground window is first, shift everything and place it last
            if i == 0:

                j = len(self.windows) - 1
                self.windows[j], self.windows[:j] = self.windows[0], self.windows[1:]

            #else shift it with the trailing window
            else:

                j = i - 1
                self.windows[i], self.windows[j] = self.windows[j], self.windows[i]

            self.tile_windows()

            if not window.focus():

                self.remove_window(window)
开发者ID:flying-circus,项目名称:python-windows-tiler,代码行数:31,代码来源:tiler.py

示例5: next_layout

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def next_layout(self):
        """
        Switch to the next layout
        """
        
        nextLayout = Utility.next_item(self.layouts, self.currentLayout) 

        if nextLayout: 

            self.currentLayout = nextLayout

        self.masterarea = self.currentLayout.maxSize // 2

        self.tile_windows()

        if not Window.focused_window().center_cursor():

            self.remove_window(Window.focused_window())
开发者ID:flying-circus,项目名称:python-windows-tiler,代码行数:20,代码来源:tiler.py

示例6: cmd_send_to_group_9

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def cmd_send_to_group_9(self):

        if self.group != 8:

            window = Window.focused_window() 

            if window:

                self.send_window_to_tiler(window, 8)
开发者ID:Tzbob,项目名称:python-windows-tiler,代码行数:11,代码来源:controller.py

示例7: cmd_move_to_next_monitor

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
 def cmd_move_to_next_monitor(self):
     window = Window.focused_window(self.windows)
     # if(window.validate()):
     monitor = Monitor.monitor_from_window_in_list(self.monitors, window)
     nextMonitor = Utility.next_item(self.monitors, monitor)
     if(monitor != nextMonitor):
         tiler = monitor.tilers[self.group]
         nextTiler = nextMonitor.tilers[self.group]
         tiler.remove_window(window)
         nextTiler.add_window(window)
         window.focus()
开发者ID:mm318,项目名称:python-windows-tiler,代码行数:13,代码来源:controller.py

示例8: cmd_move_to_previous_monitor

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
 def cmd_move_to_previous_monitor(self):
     window = Window.focused_window(self.windows)
     # if(window.validate()):
     monitor = Monitor.monitor_from_window_in_list(self.monitors, window)
     previousMonitor = Utility.previous_item(self.monitors, monitor)
     if(monitor != previousMonitor):
         tiler = monitor.tilers[self.group]
         previousTiler = previousMonitor.tilers[self.group]
         tiler.remove_window(window)
         previousTiler.add_window(window)
         window.focus()
开发者ID:mm318,项目名称:python-windows-tiler,代码行数:13,代码来源:controller.py

示例9: focus_next

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def focus_next(self):
        """
        Sets focus on the next window
        """

        window = Utility.next_item(self.windows, Window.focused_window())

        if window:            
            
            if not window.focus():

                self.remove_window(window)

        else:

            self.focus_primary()
开发者ID:flying-circus,项目名称:python-windows-tiler,代码行数:18,代码来源:tiler.py

示例10: focus_previous

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def focus_previous(self):
        """
        Sets focus on the previous window
        """

        #get focused window
        window = Utility.previous_item(self.windows, Window.focused_window())

        if window: 

            if not window.focus():

                self.remove_window(window)

        else:

            self.focus_primary()
开发者ID:flying-circus,项目名称:python-windows-tiler,代码行数:19,代码来源:tiler.py

示例11: make_focused_primary

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def make_focused_primary(self):
        """
        Moves the focused window to the first place in the masterarea
        """

        window = Window.focused_window()

        #only move the focused window if it is in the tiler
        if window in self.windows:

            i = self.windows.index(window)

            windowrest = self.windows[:i]
            windowrest.extend(self.windows[i+1:])

            #shift window location
            self.windows[0], self.windows[1:] = self.windows[i], windowrest 
            self.tile_windows()

            if not window.focus():

                self.remove_window(window)
开发者ID:flying-circus,项目名称:python-windows-tiler,代码行数:24,代码来源:tiler.py

示例12: cmd_shift_to_previous_monitor

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def cmd_shift_to_previous_monitor(self):

        window = Window.focused_window()

        if window.validate():

            monitor = Monitor.monitor_from_window_in_list(self.monitors, window) 
            previousMonitor = Utility.previous_item(self.monitors, monitor)

            if previousMonitor:
                
                tiler = monitor.tilers[self.group]
                previousTiler = previousMonitor.tilers[self.group]

                if window in tiler.windows:

                    tiler.remove_window(window)

                if window not in previousTiler.windows:

                    previousTiler.add_window(window)

                window.focus()
开发者ID:Tzbob,项目名称:python-windows-tiler,代码行数:25,代码来源:controller.py

示例13: cmd_shift_to_next_monitor

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def cmd_shift_to_next_monitor(self):

        window = Window.focused_window()

        if window.validate():

            monitor = Monitor.monitor_from_window_in_list(self.monitors, window) 
            nextMonitor = Utility.next_item(self.monitors, monitor)

            if nextMonitor:
                
                tiler = monitor.tilers[self.group]
                nextTiler = nextMonitor.tilers[self.group]

                if window in tiler.windows:

                    tiler.remove_window(window)

                if window not in nextTiler.windows:

                    nextTiler.add_window(window)

                window.focus()
开发者ID:Tzbob,项目名称:python-windows-tiler,代码行数:25,代码来源:controller.py

示例14: cmd_tile_focused_window

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
    def cmd_tile_focused_window(self):

        self.current_tiler.tile_window(Window.focused_window())
开发者ID:Tzbob,项目名称:python-windows-tiler,代码行数:5,代码来源:controller.py

示例15: cmd_toggle_stacked_column

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
 def cmd_toggle_stacked_column(self):
     win = Window.focused_window(self.windows)
     if(win != None and win.container.toggle_stacking()):
         win.container.container.container.tile_windows()
开发者ID:mm318,项目名称:python-windows-tiler,代码行数:6,代码来源:controller.py


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