def _create_control(self, parent): # Get the splash screen image. image = self.image.create_image() splash_screen = adv.SplashScreen( # The bitmap to display on the splash screen. image.ConvertToBitmap(), # Splash Style. adv.SPLASH_NO_TIMEOUT | adv.SPLASH_CENTRE_ON_SCREEN, # Timeout in milliseconds (we don't currently timeout!). 0, # The parent of the splash screen. parent, # wx Id. -1, # Window style. style=wx.SIMPLE_BORDER | wx.FRAME_NO_TASKBAR) # By default we create a font slightly bigger and slightly more italic # than the normal system font ;^) The font is used inside the event # handler for 'EVT_PAINT'. self._wx_default_text_font = new_font_like( wx.NORMAL_FONT, point_size=wx.NORMAL_FONT.GetPointSize() + 1, style=wx.ITALIC) # This allows us to write status text on the splash screen. splash_screen.Bind(wx.EVT_PAINT, self._on_paint) return splash_screen
def OnInit(self): """ Initialize all available image handlers :return: True """ if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() # create splash screen introImagePath = os.path.join(globalvar.IMGDIR, "splash_screen.png") introImage = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG) introBmp = introImage.ConvertToBitmap() if SC and sys.platform != 'darwin': # AdvancedSplash is buggy on the Mac as of 2.8.12.1 # and raises annoying (though seemingly harmless) errors everytime # the GUI is started splash = SC.AdvancedSplash(bitmap=introBmp, timeout=2000, parent=None, id=wx.ID_ANY) splash.SetText(_('Starting GRASS GUI...')) splash.SetTextColour(wx.Colour(45, 52, 27)) splash.SetTextFont( wx.Font(pointSize=15, family=wx.DEFAULT, style=wx.NORMAL, weight=wx.BOLD)) splash.SetTextPosition((150, 430)) else: if globalvar.wxPythonPhoenix: import wx.adv as wxadv wxadv.SplashScreen(bitmap=introBmp, splashStyle=wxadv.SPLASH_CENTRE_ON_SCREEN | wxadv.SPLASH_TIMEOUT, milliseconds=2000, parent=None, id=wx.ID_ANY) else: wx.SplashScreen(bitmap=introBmp, splashStyle=wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, milliseconds=2000, parent=None, id=wx.ID_ANY) wx.Yield() # create and show main frame from lmgr.frame import GMFrame mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile) mainframe.Show() self.SetTopWindow(mainframe) return True
def OnInit(self): bmp = wx.Image("splash.png").ConvertToBitmap() adv.SplashScreen(bmp, adv.SPLASH_CENTRE_ON_SCREEN | adv.SPLASH_NO_TIMEOUT, 1000, None, -1) wx.Yield() frame = MyForm(classifier(16), detector()) frame.Show() self.SetTopWindow(frame) return True
def ShowSplashScreen(): bitmap = wx.Bitmap( os.path.join(Utils.getImageFolder(), 'SeriesMgrSplash.png'), wx.BITMAP_TYPE_PNG ) # Write in the version number into the bitmap. w, h = bitmap.GetSize() dc = wx.MemoryDC() dc.SelectObject( bitmap ) dc.SetFont( wx.Font( (0,h//10), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL ) ) dc.DrawText( Version.AppVerName.replace('SeriesMgr','Version'), w // 20, int(h * 0.4) ) dc.SelectObject( wx.NullBitmap ) showSeconds = 2.5 frame = adv.SplashScreen(bitmap, wx.adv.SPLASH_CENTRE_ON_SCREEN|wx.adv.SPLASH_TIMEOUT, int(showSeconds*1000), None)
def OnInit(self): """Initialize all available image handlers :return: True """ # Internal and display name of the app (if supported by/on platform) self.SetAppName("GRASS GIS") self.SetVendorName("The GRASS Development Team") # create splash screen introImagePath = os.path.join(globalvar.IMGDIR, "splash_screen.png") introImage = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG) introBmp = introImage.ConvertToBitmap() if SC and sys.platform != "darwin": # AdvancedSplash is buggy on the Mac as of 2.8.12.1 # and raises annoying (though seemingly harmless) errors everytime # the GUI is started splash = SC.AdvancedSplash(bitmap=introBmp, timeout=2000, parent=None, id=wx.ID_ANY) splash.SetText(_("Starting GRASS GUI...")) splash.SetTextColour(wx.Colour(45, 52, 27)) splash.SetTextFont( wx.Font(pointSize=15, family=wx.DEFAULT, style=wx.NORMAL, weight=wx.BOLD)) splash.SetTextPosition((150, 430)) else: if globalvar.wxPythonPhoenix: import wx.adv as wxadv wxadv.SplashScreen( bitmap=introBmp, splashStyle=wxadv.SPLASH_CENTRE_ON_SCREEN | wxadv.SPLASH_TIMEOUT, milliseconds=2000, parent=None, id=wx.ID_ANY, ) else: wx.SplashScreen( bitmap=introBmp, splashStyle=wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, milliseconds=2000, parent=None, id=wx.ID_ANY, ) wx.GetApp().Yield() # create and show main frame from lmgr.frame import GMFrame mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile) # testing purposes # from main_window.frame import GMFrame # mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile) mainframe.Show() self.SetTopWindow(mainframe) return True
def splash(self): bmp = EmbedImg(SPLASH_PIC).GetBitmap() adv.SplashScreen(bmp, adv.SPLASH_CENTER_ON_SCREEN | adv.SPLASH_TIMEOUT, 1000, None, -1) wx.Yield()