Exemple #1
0
 def OnInit(self):
     '''
     Provides the additional initalisation needed for the application.
     '''
     self.SetupTanslation()
     self.checker = wx.SingleInstanceChecker(".Geocacher_" + wx.GetUserId())
     if self.checker.IsAnotherRunning():
         dlg = wx.MessageDialog(
             None,
             message=
             _("Geocacher is already running, please switch to that instance."
               ),
             caption=_("Geocacher Already Running"),
             style=wx.CANCEL | wx.ICON_HAND)
         dlg.ShowModal()
         return False
     else:
         from geocacher.widgets.mainWindow import MainWindow
         dirName = os.path.dirname(os.path.abspath(__file__))
         imageName = os.path.join(dirName, 'gfx', 'splash.png')
         image = wx.Image(imageName, wx.BITMAP_TYPE_PNG)
         bmp = image.ConvertToBitmap()
         wx.SplashScreen(bmp,
                         wx.SPLASH_CENTER_ON_SCREEN | wx.SPLASH_TIMEOUT,
                         5000, None, wx.ID_ANY)
         wx.Yield()
         frame = MainWindow(None, -1)
         self.SetTopWindow(frame)
         frame.Show(True)
         return True
Exemple #2
0
    def OnInit(self):
        # The wx.StandardPaths aren't available until this is set.
        self.SetAppName('CellProfiler2.0')

        wx.InitAllImageHandlers()

        if self.show_splashbox:
            # If the splash image has alpha, it shows up transparently on
            # windows, so we blend it into a white background.
            splashbitmap = wx.EmptyBitmapRGBA(CellProfilerSplash.GetWidth(),
                                              CellProfilerSplash.GetHeight(),
                                              255, 255, 255, 255)
            dc = wx.MemoryDC()
            dc.SelectObject(splashbitmap)
            dc.DrawBitmap(wx.BitmapFromImage(CellProfilerSplash), 0, 0)
            dc.SelectObject(wx.NullBitmap)
            dc.Destroy()  # necessary to avoid a crash in splashscreen
            self.splash = wx.SplashScreen(
                splashbitmap,
                wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_NO_TIMEOUT, 2000, None,
                -1)
            self.splash_timer = wx.Timer()
            self.splash_timer.Bind(wx.EVT_TIMER, self.destroy_splash_screen)
            self.splash_timer.Start(milliseconds=2000, oneShot=True)
        else:
            self.splash = None

        if self.check_for_new_version:
            self.new_version_check()

        from cellprofiler.gui.cpframe import CPFrame
        self.frame = CPFrame(None, -1, "Cell Profiler")
        self.destroy_splash_screen()
        self.frame.start(self.workspace_path, self.pipeline_path)
        if self.abort_initialization:
            return 0

        # set up error dialog for uncaught exceptions
        def show_errordialog(type, exc, tb):
            def doit():
                cpp.cancel_progress()
                display_error_dialog(
                    self.frame,
                    exc,
                    None,
                    tb=tb,
                    continue_only=True,
                    message="Exception in CellProfiler core processing")
                # continue is really the only choice

            wx.CallAfter(doit)

        # replace default hook with error dialog
        self.orig_excepthook = sys.excepthook
        sys.excepthook = show_errordialog
        self.SetTopWindow(self.frame)
        self.frame.Show()
        if self.frame.startup_blurb_frame.IsShownOnScreen():
            self.frame.startup_blurb_frame.Raise()
        return 1
Exemple #3
0
    def display_splash_screen(self, img_name=None, pos=None, size=(320, 240)):
        """Displays a splash screen and the specified position and size."""
        # Prepare the picture.
        w, h = size
        image = wx.Image(img_name, wx.BITMAP_TYPE_JPEG)
        image.Rescale(w, h, wx.IMAGE_QUALITY_HIGH)
        bm = image.ConvertToBitmap()

        # Create and show the splash screen.  It will disappear only when the
        # program has entered the event loop AND either the timeout has expired
        # or the user has left clicked on the screen.  Thus any processing
        # performed by the calling routine (including doing imports) will
        # prevent the splash screen from disappearing.
        splash = wx.SplashScreen(
            bitmap=bm,
            splashStyle=(wx.SPLASH_TIMEOUT | wx.SPLASH_CENTRE_ON_SCREEN),
            style=(wx.SIMPLE_BORDER | wx.FRAME_NO_TASKBAR | wx.STAY_ON_TOP),
            milliseconds=SPLASH_TIMEOUT,
            parent=None,
            id=wx.ID_ANY)
        splash.Bind(wx.EVT_CLOSE, self.OnCloseSplashScreen)

        # Repositon if center of screen placement is overridden by caller.
        if pos is not None:
            splash.SetPosition(pos)
        splash.Show()
Exemple #4
0
def My_Main_Application(My_Form, config_file=None, Splash=None):
    # we need an extra import here
    import wx
    app = wx.App()

    if Splash:
        bmp = Get_Image_Resize(Splash, 96)
        wx.SplashScreen(bmp,
                        wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                        1000,
                        None,
                        style=wx.NO_BORDER | wx.SIMPLE_BORDER | wx.STAY_ON_TOP)
        wx.Yield()

    if config_file:
        ini = inifile(config_file)
    else:
        #v3print ( 'gfdsawer', sys._getframe().f_code.co_filename, sys._getframe(1).f_code.co_filename )
        #ini = inifile ( Change_FileExt ( sys.argv[0], '_Test.cfg' ) )
        ini = inifile(
            Change_FileExt(sys._getframe(1).f_code.co_filename, '_Test.cfg'))

    frame = My_Form(ini=ini)
    frame.Show(True)

    if Application.WX_Inspect_Mode:
        import wx.lib.inspection
        wx.lib.inspection.InspectionTool().Show()

    app.MainLoop()
    ini.Close()
Exemple #5
0
    def _create_control(self, parent):
        # Get the splash screen image.
        image = self.image.create_image()

        splash_screen = wx.SplashScreen(
            # The bitmap to display on the splash screen.
            image.ConvertToBitmap(),
            # Splash Style.
            wx.SPLASH_NO_TIMEOUT | wx.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.
        wx.EVT_PAINT(splash_screen, self._on_paint)

        return splash_screen
Exemple #6
0
 def Login(self, loginValid):
     try:
         if loginValid == "ok":
             self.Destroy()
             #添加启动图片
             wx.SplashScreen(StartImg.GetBitmap(),
                             wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                             1000, None, -1)
             wx.Yield()
             #创建框架
             frame = MainFrame(parent=None,
                               id=wx.NewId(),
                               title=u'微博备份神器[爬盟版]',
                               framesize=(800, 450))
             frame.SetIcon(AppIcon.GetIcon())
             frame.Center()
             frame.Show(True)
         elif loginValid == "versionError":
             self.ShowMessage(
                 u"采集器版本过低,请到爬萌资源网站下载最新的采集器!<www.cnpameng.com>",
                 wx.ICON_ERROR)
         else:
             self.ShowMessage(u"登录失败:%s" % loginValid, wx.ICON_ERROR)
     except Exception:
         s = sys.exc_info()
         msg = (u"Login Error %s happened on line %d" %
                (s[1], s[2].tb_lineno))
         wx.MessageBox(msg)
Exemple #7
0
    def OnInit(self):

        # Throw up splash screen
        splash = wx.SplashScreen(icons.getSplashBMPBitmap(),\
         wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, 3000, None, -1,\
         wx.DefaultPosition, wx.DefaultSize,\
         wx.NO_BORDER | wx.FRAME_NO_TASKBAR | wx.STAY_ON_TOP)

        # Get executable's path
        self._twirlpath = dirname(
            unicode(sys.executable, sys.getfilesystemencoding()))
        print 'twirlpath is ' + self._twirlpath

        # Start config
        self._config = ConfigOps()
        self._config.Load(self._twirlpath)

        # Start timer
        self.timethread = TimerOps(self, self._config, self._twirlpath)
        self.timethread.start()

        # Start GUI
        self.frameops = frameops.create(None, self._config, self._twirlpath)
        self.frameops.Hide()
        self.SetTopWindow(self.frameops)
        self.taskbarops =\
         taskbarops.TaskbarOps(self, self._config, self._twirlpath)
        self.msgpops = msgpops.MsgPops(None)
        self.msgpops.Hide()
        return True
Exemple #8
0
 def OnInit(self):
     bmp = wx.Image("splash.jpg").ConvertToBitmap()  
     wx.SplashScreen(bmp,wx.SPLASH_CENTER_ON_SCREEN | wx.SPLASH_TIMEOUT,3,None,-1)  
     wx.Yield() 
     frame = PaintFrame(None)
     frame.Show(True)
     return True
 def OnInit(self):
     bmp = wx.Image("splash.png").ConvertToBitmap()
     wx.SplashScreen(bmp,wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,             5000,None,-1)
     wx.Yield()
     frame = SketchFrame(None)
     frame.Show(True)
     self.SetTopWindow(frame)
     return True
Exemple #10
0
    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 show_splash(self):
        bitmap = wx.Image("images/bull_n_bear1.jpg").ConvertToBitmap()

        splash = wx.SplashScreen(
            bitmap, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_NO_TIMEOUT, 0, None,
            -1, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE)
        splash.Show()
        wx.Yield()
        return splash
Exemple #12
0
 def OnInit(self):
     image = wx.Image("splash.jpg", wx.BITMAP_TYPE_JPEG)
     bmp = image.ConvertToBitmap()
     wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                     1000, None, -1)
     wx.Yield()
     frame = SketchFrame(None)
     frame.Show(True)
     self.SetTopWindow(frame)
     return True
def splash():
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    SPLASH_SCREEN_TIMEOUT = 10000
    splash_image = wx.Bitmap('Splash.bmp', wx.BITMAP_TYPE_BMP)
    wx.SplashScreen(splash_image,
                    wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                    SPLASH_SCREEN_TIMEOUT, None, -1)
    app.MainLoop()
    print 'End Splash Screen'
Exemple #14
0
    def __init__(self, parent=None):
        image = wx.Image(
            'tempDisplay/media/startUpSplash.png').ConvertToBitmap()
        splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
        splashDuration = 10000  #miliseconds

        wx.SplashScreen(image, splashStyle, splashDuration, parent)
        #(self, image, splashStyle, splashDuration, parent)
        #self.Bind(wx.EVT_CLOSE, self.OnExit)

        wx.Yield()
Exemple #15
0
    def OnInit(self):
        image = wx.Image("splash.png", wx.BITMAP_TYPE_PNG)
        png = image.ConvertToBitmap()
        wx.SplashScreen(png, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                        1200, None, -1)
        wx.Yield()

        #(None) and (True) when you have sub classes to the frame
        frame = SketchFrame(None)
        frame.Show(True)
        self.SetTopWindow(frame)
        return True
 def OnInit(self):
     image = wx.Image(util.resource_path('resources/splash.bmp'),
                      wx.BITMAP_TYPE_BMP)
     bmp = image.ConvertToBitmap()
     wx.SplashScreen(bmp, wx.SPLASH_CENTER_ON_SCREEN | wx.SPLASH_TIMEOUT,
                     1000, None, -1)
     wx.Yield()
     import time
     time.sleep(1)
     frame = SketchFrame(None)
     frame.Show()
     self.SetTopWindow(frame)
     return True
Exemple #17
0
 def OnInit(self):
     if showsplash:
         import wxRemSplash
         bmp = wxRemSplash.getBitmap()
         splash = wx.SplashScreen(bmp,
                                  wx.SPLASH_NO_CENTRE | wx.SPLASH_TIMEOUT,
                                  showsplash * 1000, None, -1)
         splash.Show()
         wx.Yield()
     self.frame = MyFrame()
     self.frame.Show()
     self.SetTopWindow(self.frame)
     return True
Exemple #18
0
    def show_splash(self):
        """Build and show the splash screen."""

        # The image.
        bmp = wx.Bitmap(IMAGE_PATH + 'relaxGUI_splash.png', wx.BITMAP_TYPE_ANY)

        # The timeout (ms).
        timeout = 2500

        # The splash screen.
        screen = wx.SplashScreen(
            bmp, wx.SPLASH_CENTRE_ON_PARENT | wx.SPLASH_TIMEOUT, timeout, None,
            -1)
Exemple #19
0
    def doSplash(self):
        """Show the Splash screen and 
        call the method which handles the welcome dialog

        returns true

        """
        bmp = wx.Image(self.skinGraphics() + "/splash.png").ConvertToBitmap()
        bmpStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
        wx.SplashScreen(bmp, bmpStyle, 1000, None, -1)
        wx.Yield()
        self.doWelcome()
        return True
Exemple #20
0
 def OnInit(self):
     
     bmp = wx.Image("welcome.jpg").ConvertToBitmap()
     wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
             1000, None, -1)
     wx.Yield()
     #启动画面时间
     time.sleep(2)
     
     self.frame = MyFrame(None) 
     self.frame.Show()
     self.SetTopWindow(self.frame)
     return True
Exemple #21
0
 def OnInit(self):
     # Splash screen.
     image = wx.Image(os.path.join(resourcePath, "gui/splash.png"),
                      wx.BITMAP_TYPE_PNG)
     bmp = image.ConvertToBitmap()
     wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                     2000, None, -1)
     wx.Yield()
     # Main window.
     self.frame = MainFrame()
     self.frame.Show()
     self.SetTopWindow(self.frame)
     return True
Exemple #22
0
    def OnInit(self):
        '''Initialize CPA
        '''
        '''List of tables created by the user during this session'''
        self.user_tables = []

        # splashscreen
        splashimage = icons.cpa_splash.ConvertToBitmap()
        # If the splash image has alpha, it shows up transparently on
        # windows, so we blend it into a white background.
        splashbitmap = wx.EmptyBitmapRGBA(splashimage.GetWidth(),
                                          splashimage.GetHeight(), 255, 255,
                                          255, 255)
        dc = wx.MemoryDC()
        dc.SelectObject(splashbitmap)
        dc.DrawBitmap(splashimage, 0, 0)
        dc.Destroy()  # necessary to avoid a crash in splashscreen
        splash = wx.SplashScreen(
            splashbitmap, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, 2000,
            None, -1)
        self.splash = splash

        p = Properties.getInstance()
        if not p.is_initialized():
            from guiutils import show_load_dialog
            splash.Destroy()
            if not show_load_dialog():
                logging.error(
                    'CellProfiler Analyst requires a properties file. Exiting.'
                )
                return False
        self.frame = MainGUI(p, None, size=(860, -1))
        self.frame.Show(True)
        db = dbconnect.DBConnect.getInstance()
        db.register_gui_parent(self.frame)

        try:
            if __version__ != -1:
                import cellprofiler.utilities.check_for_updates as cfu
                cfu.check_for_updates('http://cellprofiler.org/CPAupdate.html',
                                      max(__version__,
                                          cpaprefs.get_skip_version()),
                                      new_version_cb,
                                      user_agent='CPAnalyst/2.0.%d' %
                                      (__version__))
        except ImportError:
            logging.warn(
                "CPA was unable to check for updates. Could not import cellprofiler.utilities.check_for_updates."
            )

        return True
Exemple #23
0
    def OnInit(self):

        # Show a splash screen
        png = os.path.join(getHome(), "Icons", "splash.png")
        bmp = wx.Image(png).ConvertToBitmap()
        wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                        5000, None, -1)

        self.frame = Frame(None)
        self.frame.Show(True)
        self.frame.Center()
        self.frame.Raise()
        self.SetTopWindow(self.frame)
        return True
Exemple #24
0
    def ShowSplashScreen(self):
        if not config.show_splashscreen():
            self.splash = None
            return

        picture = 'splashscreen.png'
        bitmap = wx.BitmapFromImage(wx.Image(config.graphics_path + picture))
        self.splash = wx.SplashScreen(
            bitmap,
            wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_NO_TIMEOUT,
            0,
            None,
            style=wx.FRAME_NO_TASKBAR | wx.BORDER_NONE)
        self.splash.Show()
        self.splash.Raise()
Exemple #25
0
    def __init__(self, parent):
        gui.MainFrame.__init__(self, parent)
        #SPLSH
        img = wx.Bitmap("splash.png", wx.BITMAP_TYPE_PNG)
        wx.SplashScreen(img, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                        5000, None, -1)
        # Icon
        try:
            self.SetIcon(wx.Icon("logo.ico", wx.BITMAP_TYPE_ICO))
        finally:
            pass

        self.main_panel()
        self.draw_figure1()
        self.draw_figure2()
        self.draw_figure3()
Exemple #26
0
    def OnInit(self):
        # The wx.StandardPaths aren't available until this is set.
        self.SetAppName('CellProfiler2.0')

        wx.InitAllImageHandlers()

        if self.show_splashbox:
            # If the splash image has alpha, it shows up transparently on
            # windows, so we blend it into a white background.
            splashbitmap = wx.EmptyBitmapRGBA(CellProfilerSplash.GetWidth(),
                                              CellProfilerSplash.GetHeight(),
                                              255, 255, 255, 255)
            dc = wx.MemoryDC()
            dc.SelectObject(splashbitmap)
            dc.DrawBitmap(wx.BitmapFromImage(CellProfilerSplash), 0, 0)
            dc.Destroy()  # necessary to avoid a crash in splashscreen
            self.splash = wx.SplashScreen(
                splashbitmap, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                2000, None, -1)

        if self.check_for_new_version:
            self.new_version_check()

        from cellprofiler.gui.cpframe import CPFrame
        self.frame = CPFrame(None, -1, "Cell Profiler")

        # set up error dialog for uncaught exceptions
        def show_errordialog(type, exc, tb):
            def doit():
                display_error_dialog(
                    self.frame,
                    exc,
                    None,
                    tb=tb,
                    continue_only=True,
                    message="Exception in CellProfiler core processing")
                # continue is really the only choice

            wx.CallAfter(doit)

        # replace default hook with error dialog
        self.orig_excepthook = sys.excepthook
        sys.excepthook = show_errordialog

        self.SetTopWindow(self.frame)
        self.frame.Show()
        return 1
Exemple #27
0
    def OnInit(self):

        wx.InitAllImageHandlers()

        F = wx.SplashScreen(wx.Bitmap("../icons/splash.bmp"),
                            wx.SPLASH_TIMEOUT | wx.SPLASH_CENTER_ON_SCREEN,
                            2000, None, -1)

        frame_EcranPrincipal = MainFrame(None,
                                         title=u"Usine à GASE",
                                         droits=1)
        self.SetTopWindow(frame_EcranPrincipal)
        frame_EcranPrincipal.Show()

        try:
            database = SqliteDatabase('usineagase.sqlite', **{})
            tables_base = database.get_tables()
        except:
            msg = u"Erreur de connection à la base de données"
            dlg = wx.MessageDialog(None, msg, "ERREUR",
                                   wx.OK | wx.ICON_EXCLAMATION)
            dlg.ShowModal()
            dlg.Destroy()
            return 0

        tables_obligatoires = [
            u"achats", u"adherents", u"adhesion_types", u"adhesions",
            u"cotisations", u"categories", u"credits", u"commandes",
            u"exercices", u"fournisseurs", u"lignes_achat", u"lignes_commande",
            u"parametres", u"produits", u"referents", u"tvas"
        ]

        if set(tables_obligatoires) - set(tables_base):
            msg = u"Erreur : la base de données n'est pas accessible ou n'est pas conforme."
            dlg = wx.MessageDialog(None, msg, "ERREUR",
                                   wx.OK | wx.ICON_EXCLAMATION)
            dlg.ShowModal()
            dlg.Destroy()
            return 0
        else:
            #query = session.query(model.Exercice).filter(model.Exercice.DateDebut<datetime.today()).filter(model.Exercice.DateFin>datetime.today())
            #Exercice.select().where(date_debut<datetime.today())

            #if query.count() == 1:
            #    EXERCICE_EN_COURS = query.first()

            return 1
Exemple #28
0
    def __init__(self):
        wx.Frame.__init__(self,
                          None,
                          title="GraphCalc",
                          size=(1108, 631),
                          style=(wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION
                                 | wx.CLOSE_BOX | wx.CLIP_CHILDREN))

        self.MainPanel = MainPanel(self)
        self.Centre()

        if SPLASH:
            # -------------------SPLASH-SCREEN-------------------------------------------
            convertedToBitmap = wx.Image(name="splash.png").ConvertToBitmap()
            splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
            splashDuration = 4000  # milliseconds
            terryTheBear = wx.SplashScreen(convertedToBitmap, splashStyle,
                                           splashDuration, None)
            # We have to also tell python to wait or else it will load MainPanel before
            # splash has finished displaying
            time.sleep(splashDuration / 1000)
            # --------------------END-----------------------------------------------------
        # self.Show() must be after splash screen
        self.Show()

        # --------STATUS-BAR-------------------------
        self.CreateStatusBar()
        self.SetStatusText("")

        # -------------MENU--------------------------------------------------------
        menubar = wx.MenuBar()
        fileMenu = wx.Menu()
        file_settings = fileMenu.Append(wx.ID_ANY, 'Settings',
                                        'Settings, have it your way!')
        file_quit = fileMenu.Append(wx.ID_EXIT, 'Quit', 'Quit application')
        menubar.Append(fileMenu, '&File')

        helpMenu = wx.Menu()
        hitem = helpMenu.Append(wx.ID_HELP, 'About', 'About this program')
        menubar.Append(helpMenu, '&Help')

        self.SetMenuBar(menubar)

        self.Bind(wx.EVT_MENU, self.onQuit, file_quit)
        self.Bind(wx.EVT_MENU, self.onSettings, file_settings)
        self.Bind(wx.EVT_MENU, self.onAbout, hitem)
        icon(self)
Exemple #29
0
def SplashScreen():
    """
    Display a splashscreen
    """
    try:
        if not os.path.exists(pr("resources/splash.png")):
            print "Could not find splash.png"
            return
        image = wx.Image(pr("resources/splash.png"), wx.BITMAP_TYPE_ANY)
        image = image.ConvertToBitmap()
        splashstyle = wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_NO_TIMEOUT
        style = wx.SIMPLE_BORDER#|wx.STAY_ON_TOP
        SplashWindow = wx.SplashScreen(image, splashstyle, -1, parent=None)
        return SplashWindow
    except Exception, error:
        print "Could not create splash screen.'"
        print error
Exemple #30
0
 def __init__(self, name, logfunc):
     gui.App.__init__(self, logfunc=logfunc, name=name)
     #        gui.App.__init__(self,name=name)
     print '<browser starting>'
     imageName = resource.find_release_resource('app_browser2',
                                                'browser_splash.png')
     if imageName:
         image = wx.Image(imageName, wx.BITMAP_TYPE_PNG)
         bmp = image.ConvertToBitmap()
         wx.SplashScreen(bmp,
                         wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                         2000, None, -1)
         wx.Yield()
     print 'browser starting 2'
     self.agent = ViewManager(name)
     print 'browser starting 3'
     piw.tsd_server(name, self.agent)
     print 'browser starting 4'
     self.agent.advertise('<main>')
     print 'browser starting 5'