def init(): if operating_system.isWindows() and wx.DisplayDepth() >= 32: wx.SystemOptions_SetOption("msw.remap", "0") # pragma: no cover try: wx.ArtProvider_PushProvider(ArtProvider()) # pylint: disable=E1101 except AttributeError: wx.ArtProvider.Push(ArtProvider())
def init(): if ('__WXMSW__' in wx.PlatformInfo) and (wx.DisplayDepth() >= 32): wx.SystemOptions_SetOption("msw.remap", "0") # pragma: no cover try: wx.ArtProvider_PushProvider(ArtProvider()) # pylint: disable-msg=E1101 except AttributeError: wx.ArtProvider.Push(ArtProvider())
def __init__(self, parent, log): wx.Frame.__init__(self, parent, size=(700, -1), style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE) self.SetIcon(images.Mondrian.GetIcon()) wx.SystemOptions_SetOption("msw.remap", "0") self.SetTitle("FlatMenu wxPython Demo ;-D") if _hasAUI: self._mgr = AuiManager() self._mgr.SetManagedWindow(self) self._popUpMenu = None mainSizer = wx.BoxSizer(wx.VERTICAL) # Create a main panel and place some controls on it mainPanel = wx.Panel(self, wx.ID_ANY) panelSizer = wx.BoxSizer(wx.VERTICAL) mainPanel.SetSizer(panelSizer) # Create minibar Preview Panel minibarPanel = wx.Panel(self, wx.ID_ANY) self.CreateMinibar(minibarPanel) miniSizer = wx.BoxSizer(wx.VERTICAL) miniSizer.Add(self._mtb, 0, wx.EXPAND) minibarPanel.SetSizer(miniSizer) # Add log window self.log = log hs = wx.BoxSizer(wx.HORIZONTAL) btn = wx.Button(mainPanel, wx.ID_ANY, "Press me for pop up menu!") hs.Add(btn, 0, wx.ALL, 5) # Connect a button btn.Bind(wx.EVT_BUTTON, self.OnButtonClicked) btn = wx.Button(mainPanel, wx.ID_ANY, "Press me for a long menu!") hs.Add(btn, 0, wx.ALL, 5) panelSizer.Add(hs, 0, wx.ALL, 5) # Connect a button btn.Bind(wx.EVT_BUTTON, self.OnLongButtonClicked) statusbar = self.CreateStatusBar(2, wx.ST_SIZEGRIP) statusbar.SetStatusWidths([-2, -1]) # statusbar fields statusbar_fields = [ ("FlatMenu wxPython Demo, Andrea Gavana @ 01 Nov 2006"), ("Welcome To wxPython!") ] for i in range(len(statusbar_fields)): statusbar.SetStatusText(statusbar_fields[i], i) self.CreateMenu() self.ConnectEvents() mainSizer.Add(self._mb, 0, wx.EXPAND) mainSizer.Add(mainPanel, 1, wx.EXPAND) self.SetSizer(mainSizer) mainSizer.Layout() if _hasAUI: # AUI support self._mgr.AddPane(mainPanel, AuiPaneInfo().Name("main_panel").CenterPane()) self._mgr.AddPane( minibarPanel, AuiPaneInfo().Name("minibar_panel").Caption( "Minibar Preview").Right().MinSize(wx.Size(150, 200))) self._mb.PositionAUI(self._mgr) self._mgr.Update() ArtManager.Get().SetMBVerticalGradient(True) ArtManager.Get().SetRaiseToolbar(False) self._mb.Refresh() self._mtb.Refresh() self.CenterOnScreen()