當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.STAY_ON_TOP屬性代碼示例

本文整理匯總了Python中wx.STAY_ON_TOP屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.STAY_ON_TOP屬性的具體用法?Python wx.STAY_ON_TOP怎麽用?Python wx.STAY_ON_TOP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.STAY_ON_TOP屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: pin_design_window

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def pin_design_window(self):
        common.pin_design_window = not common.pin_design_window
        if common.pin_design_window != self._t_pin_design_window.IsToggled():
            self._t_pin_design_window.Toggle()
            self.toolbar.Realize()
        self._m_pin_design_window.Check(common.pin_design_window)

        toplevel = self._get_toplevel()
        if not toplevel or not toplevel.widget: return
        frame = toplevel.widget.GetTopLevelParent()
        if not isinstance(frame, wx.Frame): return
        style = frame.GetWindowStyle()
        if common.pin_design_window:
            frame.SetWindowStyle( style | wx.STAY_ON_TOP)
        elif style & wx.STAY_ON_TOP:
            frame.ToggleWindowStyle(wx.STAY_ON_TOP)
            if wx.Platform=='__WXMSW__':
                frame.Iconize(True)
                frame.Iconize(False)
            else:
                toplevel.widget.Raise() 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:23,代碼來源:main.py

示例2: create_widget

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def create_widget(self):
        if self.parent:
            parent = self.parent.widget
        else:
            parent = common.main

        # we set always a default style because this is the best one for editing the dialog
        # (for example, a dialog without a caption would be hard to move, etc.)
        default_style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        if common.pin_design_window: default_style |= wx.STAY_ON_TOP

        # change 2002-10-09: now we create a wxFrame instead of a wxDialog,
        # because the latter gives troubles I wasn't able to solve when using wxPython 2.3.3.1 :-/
        self.widget = wx.Frame(parent, self.id, "", style=default_style)
        self.widget.SetBackgroundColour(compat.wx_SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE))
        self._set_widget_icon() 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:18,代碼來源:dialog.py

示例3: create_widget

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def create_widget(self):
        if self.widget:
            # re-creating -> use old frame
            win = self.widget.GetTopLevelParent()
        else:
            style = wx.DEFAULT_FRAME_STYLE
            if common.pin_design_window: style |= wx.STAY_ON_TOP
            win = wx.Frame( common.main, -1, misc.design_title(self.name), size=(400, 300), style=style )
            import os, compat
            icon = compat.wx_EmptyIcon()
            xpm = os.path.join(config.icons_path, 'panel.xpm')
            icon.CopyFromBitmap(misc.get_xpm_bitmap(xpm))
            win.SetIcon(icon)
            win.Bind(wx.EVT_CLOSE, self.hide_widget)  # CLOSE event of the frame, not the panel
            if wx.Platform == '__WXMSW__':
                win.CentreOnScreen()

        if self.scrollable:
            self.widget = wx.ScrolledWindow(win, self.id, style=0)
        else:
            self.widget = wx.Panel(win, self.id, style=0)
        self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
        self.widget.GetBestSize = self.get_widget_best_size
        #self.widget.SetSize = win.SetSize 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:26,代碼來源:panel.py

示例4: CheckAddOnFiles

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def CheckAddOnFiles(self):
        neededFiles = self.GetNeededFiles()
        if len(neededFiles) == 0:
            return True
        if not eg.CallWait(self.ShowDownloadMessage):
            return False
        stopEvent = threading.Event()
        wx.CallAfter(eg.TransferDialog, None, neededFiles, stopEvent)
        stopEvent.wait()
        neededFiles = self.GetNeededFiles()
        if neededFiles:
            eg.CallWait(
                wx.MessageBox,
                Text.downloadFailedMsg,
                caption=Text.dialogCaption % self.plugin.name,
                style=wx.OK | wx.ICON_EXCLAMATION | wx.STAY_ON_TOP,
                parent=eg.document.frame
            )
            return False
        return True 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:22,代碼來源:WinUsb.py

示例5: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def __init__(self, parent):
        wx.Frame.__init__(
            self,
            parent,
            -1,
            "OSD Window",
            size=(0, 0),
            style=(
                wx.FRAME_SHAPED |
                wx.NO_BORDER |
                wx.FRAME_NO_TASKBAR |
                wx.STAY_ON_TOP
            )
        )
        self.hwnd = self.GetHandle()
        self.bitmap = wx.EmptyBitmap(0, 0)
        # we need a timer to possibly cancel it
        self.timer = threading.Timer(0.0, eg.DummyFunc)
        self.Bind(wx.EVT_PAINT, self.OnPaint)
        self.Bind(wx.EVT_CLOSE, self.OnClose) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:22,代碼來源:ShowOSD.py

示例6: ShowHidMessage

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def ShowHidMessage(self, disableHid):
        """
        Informs the user, that the system needs to restart the system to let
        the HID registry changes take effect.
        """
        try:
            self.SetHidState(disableHid)
        except WindowsError:
            dialog = wx.MessageDialog(
                None,
                self.text.hidErrorMessage,
                self.text.hidDialogCaption,
                wx.OK|wx.ICON_ERROR|wx.STAY_ON_TOP
            )
        else:
            dialog = wx.MessageDialog(
                None,
                self.text.hidDialogMessage,
                self.text.hidDialogCaption,
                wx.OK|wx.ICON_INFORMATION|wx.STAY_ON_TOP
            )
        dialog.ShowModal()
        dialog.Destroy() 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:25,代碼來源:__init__.py

示例7: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def __init__(self, size=(-1, -1), pic_path=None, display=0):
        wx.Frame.__init__(
            self,
            None,
            -1,
            "ShowPictureFrame",
            style=wx.NO_BORDER | wx.FRAME_NO_TASKBAR  #| wx.STAY_ON_TOP
        )
        self.SetBackgroundColour(wx.Colour(0, 0, 0))
        self.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        bitmap = wx.EmptyBitmap(1, 1)
        self.staticBitmap = wx.StaticBitmap(self, -1, bitmap)
        self.staticBitmap.Bind(wx.EVT_LEFT_DCLICK, self.LeftDblClick)
        self.staticBitmap.Bind(wx.EVT_MOTION, self.ShowCursor)
        self.timer = Timer(2.0, self.HideCursor) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:18,代碼來源:__init__.py

示例8: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def __init__(self, *args, **kwds):
        # begin wxGlade: Terminal.__init__
        kwds["style"] = kwds.get("style",
                                 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_NO_TASKBAR | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((915, 424))
        self.text_main = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_BESTWRAP | wx.TE_MULTILINE | wx.TE_READONLY)
        self.text_entry = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT_ENTER, self.on_entry, self.text_entry)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.pipe = None 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:19,代碼來源:UsbConnect.py

示例9: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def __init__(self, *args, **kwds):
        # begin wxGlade: JobSpooler.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((661, 402))
        self.list_job_spool = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.on_list_drag, self.list_job_spool)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_item_rightclick, self.list_job_spool)
        # end wxGlade
        self.dirty = False
        self.update_buffer_size = False
        self.update_spooler_state = False
        self.update_spooler = False

        self.elements_progress = 0
        self.elements_progress_total = 0
        self.command_index = 0
        self.listener_list = None
        self.list_lookup = {}
        self.Bind(wx.EVT_CLOSE, self.on_close, self) 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:27,代碼來源:JobSpooler.py

示例10: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def __init__(self, *args, **kwds):
        # begin wxGlade: Keymap.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((500, 530))
        self.list_keymap = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES)
        self.button_add = wx.Button(self, wx.ID_ANY, _("Add Hotkey"))
        self.text_key_name = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_command_name = wx.TextCtrl(self, wx.ID_ANY, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.on_button_add_hotkey, self.button_add)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.text_key_name.Bind(wx.EVT_KEY_DOWN, self.on_key_press)
        self.SetFocus() 
開發者ID:meerk40t,項目名稱:meerk40t,代碼行數:21,代碼來源:Keymap.py

示例11: Always_on_top

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def Always_on_top(self, e):
            if self.menu_view_t.IsChecked():
                self.SetWindowStyle(self.GetWindowStyle() | wx.STAY_ON_TOP)
                for i in self.children:
                    i.SetWindowStyle(i.GetWindowStyle() | wx.STAY_ON_TOP)
            else:
                self.SetWindowStyle(self.GetWindowStyle() & ~wx.STAY_ON_TOP)
                for i in self.children:
                    i.SetWindowStyle(i.GetWindowStyle() & ~wx.STAY_ON_TOP) 
開發者ID:hvqzao,項目名稱:report-ng,代碼行數:11,代碼來源:gui.py

示例12: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def __init__(self, parent=None, title='', content=None, size=(800, 600,), *args, **kwargs):
            YamledWindow.__init__(self, parent, title=title, content=content, size=size, *args, **kwargs)
            if parent is not None:
                parent.children += [self]
                if parent.menu_view_t.IsChecked():
                    self.SetWindowStyle(self.GetWindowStyle() | wx.STAY_ON_TOP)
            #self.Bind(wx.EVT_CLOSE, lambda x: self.Destroy()) 
開發者ID:hvqzao,項目名稱:report-ng,代碼行數:9,代碼來源:gui.py

示例13: on_error

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def on_error(self, errmsg, exit = False):
        if self.bgapp is None:
            title = 'Error'
        else:
            title = self.bgapp.appname + ' Error'
        dlg = wx.MessageDialog(None, errmsg, title, wx.OK | wx.ICON_ERROR | wx.STAY_ON_TOP)
        result = dlg.ShowModal()
        dlg.Destroy()
        if exit:
            self.ExitMainLoop() 
開發者ID:alesnav,項目名稱:p2ptv-pi,代碼行數:12,代碼來源:EngineWx.py

示例14: always_on_top

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def always_on_top(self, event):
        """Toggle the always on top setting."""
        current_value = settings.CONFIG['DEFAULT']['Always On Top']
        style = self.main_dialog.GetWindowStyle()
        self.main_dialog.SetWindowStyle(style ^ wx.STAY_ON_TOP)
        settings.CONFIG['DEFAULT']['Always On Top'] = str(not current_value) 
開發者ID:RMPR,項目名稱:atbswp,代碼行數:8,代碼來源:control.py

示例15: disable_stay_on_top

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import STAY_ON_TOP [as 別名]
def disable_stay_on_top(widget):
        # used like 'with parent and parent.frozen() or dummy_contextmanager()
        restore = False
        tl = get_toplevel_parent(widget)
        if isinstance(tl, wx.Frame) and tl.GetWindowStyle() & wx.STAY_ON_TOP:
            tl.ToggleWindowStyle(wx.STAY_ON_TOP)
            restore = True
        yield
        if restore:
            tl.ToggleWindowStyle(wx.STAY_ON_TOP) 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:12,代碼來源:misc.py


注:本文中的wx.STAY_ON_TOP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。