示例#1
0
def start():
    from skimage.data import camera, astronaut
    import wx.lib.agw.advancedsplash as AS

    app = wx.App(False)

    bitmap = wx.Bitmap('data/logolong.png', wx.BITMAP_TYPE_PNG)
    shadow = wx.Colour(255, 255, 255)

    asp = AS.AdvancedSplash(None,
                            bitmap=bitmap,
                            timeout=1000,
                            agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT
                            | AS.AS_SHADOW_BITMAP,
                            shadowcolour=shadow)
    asp.Update()

    uistyle = Source.manager('config').get('uistyle') or 'imagepy'
    frame = ImageJ(None) if uistyle == 'imagej' else ImagePy(None)
    frame.load_menu(extend_plgs(loader.build_plugins('menus')))
    frame.load_tool(extend_tols(loader.build_tools('tools')), 'Transform')
    frame.load_widget(extend_wgts(loader.build_widgets('widgets')))
    frame.Fit()
    #frame.show_img([camera()], 'camera')
    #frame.show_img([astronaut()], 'astronaut')
    frame.Show()
    app.MainLoop()
 def test_lib_agw_advancedsplashCtor(self):
     splash = AS.AdvancedSplash(self.frame,
                                -1,
                                bitmap=wx.Bitmap(pngFile),
                                agwStyle=AS.AS_TIMEOUT
                                | AS.AS_CENTER_ON_SCREEN,
                                timeout=250)
     self.waitFor(300)
示例#3
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
示例#4
0
def splash_screen():
    import wx.lib.agw.advancedsplash as AS
    image_path = "ardublockly/img/ardublockly_splash.png"
    bitmap = wx.Bitmap(image_path, wx.BITMAP_TYPE_PNG)
    shadow = wx.WHITE
    splash = AS.AdvancedSplash(None,
                               bitmap=bitmap,
                               timeout=5000,
                               shadowcolour=shadow,
                               agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT
                               | AS.AS_SHADOW_BITMAP)
示例#5
0
def splash_show():
    app = wx.App(False)
    # Show the splash screen as early as possible
    img = wx.Image(findfile('logo.png'))
    img.ConvertAlphaToMask()
    bitmap = wx.BitmapFromImage(img)
    frame = wx.Frame(None, -1, "AdvancedSplash Test")
    AS.AdvancedSplash(frame,
                      bitmap=bitmap,
                      agwStyle=AS.AS_NOTIMEOUT | AS.AS_CENTER_ON_SCREEN)
    app.MainLoop()
示例#6
0
def splash_show():
    # bypass "iCCP: known incorrect sRGB profile":
    wx.Log.SetLogLevel(0)
    # setup splash app
    app = wx.App(False)
    # Show the splash screen as early as possible
    img = wx.Image(findfile('zm_logo_small.png'))
    # alpha mask is only binary - don't use it, looks ugly.
    #img.ConvertAlphaToMask()
    bitmap = wx.BitmapFromImage(img)
    frame = wx.Frame(None, -1, "AdvancedSplash Test")
    AS.AdvancedSplash(frame,
                      bitmap=bitmap,
                      agwStyle=AS.AS_NOTIMEOUT | AS.AS_CENTER_ON_SCREEN)
    app.MainLoop()
示例#7
0
def show(ui=True):
    app = wx.App(False)

    bitmap = wx.Bitmap('data/logolong.png', wx.BITMAP_TYPE_PNG)
    shadow = wx.Colour(255, 255, 255)
    # SplashScreen(bitmap, wx.adv.SPLASH_CENTRE_ON_SCREEN | wx.adv.SPLASH_TIMEOUT, 3000, None, -1)

    asp = AS.AdvancedSplash(None,
                            bitmap=bitmap,
                            timeout=1000,
                            agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT
                            | AS.AS_SHADOW_BITMAP,
                            shadowcolour=shadow)

    ImagePy(None).Show()
    app.MainLoop()
示例#8
0
def splash_show():
    # bypass "iCCP: known incorrect sRGB profile":
    wx.Log.SetLogLevel(0)
    # setup splash app
    app = wx.App(False)
    # Show the splash screen as early as possible
    imdir = pkg_resources.resource_filename("shapeout", "img")
    img = wx.Image(join(imdir, 'zm_logo_small_bgwhite.png'))
    # alpha mask is only binary - don't use it, looks ugly.
    #img.ConvertAlphaToMask()
    bitmap = wx.BitmapFromImage(img)
    frame = wx.Frame(None, -1, "ShapeOut Splash Screen")
    AS.AdvancedSplash(frame, bitmap=bitmap, 
                      agwStyle=AS.AS_NOTIMEOUT|AS.AS_CENTER_ON_SCREEN
                      )
    app.MainLoop()
示例#9
0
 def on_stop_fit(self, event):
     """
     A la fin du fit permet d'afficher le pop image soit l'icone du prog
     soit morpheus_matrix de manière aléatoire
     """
     b = Fitting4Radmax()
     l_numb = [2, 24, 56, 89]
     if self.random_thread_image in l_numb:
         bmp = stop_thread_morpheus.GetBitmap()
     else:
         bmp = stop_thread.GetBitmap()
     shadow = wx.WHITE
     AS.AdvancedSplash(None,
                       bitmap=bmp,
                       timeout=2000,
                       agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT,
                       shadowcolour=shadow)
     b.on_stop_fit()
示例#10
0
def start():
    from . import ImagePy, ImageJ
    import wx.lib.agw.advancedsplash as AS
    app = wx.App(False)
    bitmap = wx.Bitmap(root_dir + '/data/logolong.png', wx.BITMAP_TYPE_PNG)
    shadow = wx.Colour(255, 255, 255)
    asp = AS.AdvancedSplash(None,
                            bitmap=bitmap,
                            timeout=1000,
                            agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT
                            | AS.AS_SHADOW_BITMAP,
                            shadowcolour=shadow)
    asp.Update()
    load_document()
    load_dictionary()
    uistyle = ConfigManager.get('uistyle') or 'imagepy'
    frame = ImageJ(None) if uistyle == 'imagej' else ImagePy(None)
    frame.Show()
    app.MainLoop()
示例#11
0
    def __init__(self,
                 parent,
                 gdb,
                 id=-1,
                 title="",
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER
                 | wx.CLIP_CHILDREN):

        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self.ID_Serial = wx.NewId()
        self.ID_ConfigureConnection = wx.NewId()
        self.ID_Connect = wx.NewId()
        self.ID_Reconnect = wx.NewId()
        self.ID_Open = wx.NewId()
        self.ID_Save = wx.NewId()
        self.ID_Download = wx.NewId()
        self.ID_Upload = wx.NewId()
        self.ID_SaveRunningConfig = wx.NewId()

        self.ID_ReadReg = wx.NewId()
        self.ID_ReadMem = wx.NewId()
        self.ID_ReadHeap = wx.NewId()
        self.ID_MemMap = wx.NewId()
        self.ID_Processes = wx.NewId()
        self.ID_RunningConfig = wx.NewId()
        self.ID_Registry = wx.NewId()
        self.ID_Disassemble = wx.NewId()
        self.ID_ListBookmarks = wx.NewId()
        self.ID_Search = wx.NewId()

        self.ID_WriteReg = wx.NewId()
        self.ID_WriteMem = wx.NewId()
        self.ID_SetBreakpoints = wx.NewId()
        self.ID_DelBreakpoints = wx.NewId()
        self.ID_Comment = wx.NewId()

        self.ID_StepInto = wx.NewId()
        self.ID_StepOver = wx.NewId()
        self.ID_Jump = wx.NewId()
        self.ID_Continue = wx.NewId()

        self.ID_About = wx.NewId()

        self.ID_toolConnect = wx.NewId()
        self.ID_toolReconnect = wx.NewId()
        self.ID_toolConfigureConnection = wx.NewId()

        self.ID_toolOpen = wx.NewId()
        self.ID_toolSave = wx.NewId()
        self.ID_toolUpload = wx.NewId()
        self.ID_toolDownload = wx.NewId()

        self.ID_toolDisLabel = wx.NewId()
        self.ID_toolDisback = wx.NewId()
        self.ID_toolDisforward = wx.NewId()

        self.ID_toolDebugLabel = wx.NewId()
        self.ID_toolStep = wx.NewId()
        self.ID_toolStepover = wx.NewId()
        self.ID_toolContinue = wx.NewId()

        self.ID_toolBreakLabel = wx.NewId()
        self.ID_toolAddBreak = wx.NewId()
        self.ID_toolDelBreak = wx.NewId()

        self.ID_toolListBookmarks = wx.NewId()

        self.ID_toolComment = wx.NewId()

        self.ID_toolFindNext = wx.NewId()

        #-----------------------------------------------------------------------------

        # tell FrameManager to manage this frame

        self._mgr = wx.aui.AuiManager()
        self._mgr.SetManagedWindow(self)
        self.gdb = gdb
        self._perspectives = []

        #-------Splash screen---------------------------------------------------------

        pn = os.path.normpath(
            os.path.join(".", "images/iodide_splash_screen.png"))
        bitmap = wx.Bitmap(pn, wx.BITMAP_TYPE_PNG)
        shadow = wx.WHITE
        frame = AS.AdvancedSplash(self, bitmap=bitmap, timeout=3000)

        #-------Set windows icon------------------------------------------------------

        image = wx.Image('images/iodide16x16.png',
                         wx.BITMAP_TYPE_PNG).ConvertToBitmap()
        icon = wx.Icon(image)
        self.SetIcon(icon)

        #-------Create menu-----------------------------------------------------------

        self.mb = wx.MenuBar()

        file_menu = wx.Menu()
        file_menu.Append(self.ID_Open, "&Open session")
        file_menu.Append(self.ID_ConfigureConnection, "&Configure connection")
        file_menu.Append(self.ID_Save, "&Save session")
        file_menu.Append(self.ID_Connect, "&Connect to device")
        file_menu.Append(self.ID_Reconnect, "&Reconnect to device")
        file_menu.Append(self.ID_Download, "&Download from memory")
        file_menu.Append(self.ID_Upload, "&Upload to memory")
        file_menu.Append(self.ID_SaveRunningConfig, "&Save running config")
        file_menu.AppendSeparator()
        file_menu.Append(wx.ID_EXIT, "Exit")

        file_menu.Enable(self.ID_Upload, False)

        view_menu = wx.Menu()
        #view_menu.Append(self.ID_ReadReg, "&Display registers")
        view_menu.Append(self.ID_ReadMem, "&Display memory")
        view_menu.Append(self.ID_Disassemble, "&Disassemble memory")
        view_menu.Append(self.ID_Search, "&Search memory address range")
        view_menu.Append(self.ID_ReadHeap, "&Display heap blocks")
        view_menu.Append(self.ID_MemMap, "&Display memory map")
        view_menu.Append(self.ID_Processes, "&Display processes")
        view_menu.Append(self.ID_RunningConfig, "&Display running config")
        view_menu.Append(self.ID_Registry, "&Display registry information")
        view_menu.Append(self.ID_ListBookmarks, "&Bookmarks")

        edit_menu = wx.Menu()
        edit_menu.Append(self.ID_WriteReg, "&Modify registers")
        edit_menu.Append(self.ID_WriteMem, "&Modify memory")
        edit_menu.Append(self.ID_SetBreakpoints, "&Set breakpoint")
        edit_menu.Append(self.ID_DelBreakpoints, "&Delete breakpoint")
        edit_menu.Append(self.ID_Comment, "&Insert comment")

        debug_menu = wx.Menu()
        debug_menu.Append(self.ID_StepInto, "&Step into")
        debug_menu.Append(self.ID_StepOver, "&Step over")
        debug_menu.Append(self.ID_Jump, "&Jump to address")
        debug_menu.Append(self.ID_Continue, "&Continue")

        debug_menu.Enable(self.ID_StepOver, False)

        help_menu = wx.Menu()
        help_menu.Append(self.ID_About, "&About")

        self.mb.Append(file_menu, "File")
        self.mb.Append(view_menu, "View")
        self.mb.Append(edit_menu, "Edit")
        self.mb.Append(debug_menu, "Debug")
        self.mb.Append(help_menu, "Help")

        self.SetMenuBar(self.mb)

        self.statusbar = self.CreateStatusBar(3, wx.STB_SIZEGRIP)
        self.statusbar.SetStatusWidths([-1, -2, -2])
        self.statusbar.SetStatusText("", 0)
        self.statusbar.SetStatusText(
            "Connection Status: Disconnected from device", 1)
        self.statusbar.SetStatusText("Debugging Status: Not debugging", 2)

        #-------Create toolbar--------------------------------------------------------

        self.tb = self.CreateToolBar()

        self.tb.AddTool(
            self.ID_toolConnect, 'Connect to device',
            wx.Image('images/connect_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Connect to device')

        self.tb.AddTool(
            self.ID_toolReconnect, 'Reconnect to device',
            wx.Image('images/reconnect_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Reconnect to device')

        self.tb.AddTool(
            self.ID_toolConfigureConnection, 'Configure connection',
            wx.Image('images/customize_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Configure connection')

        self.tb.AddSeparator()

        self.tb.AddTool(
            self.ID_toolOpen, 'Open session',
            wx.Image('images/folder_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Open session')

        self.tb.AddTool(
            self.ID_toolSave, 'Save session',
            wx.Image('images/save_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Save session')

        self.tb.AddTool(
            self.ID_toolDownload, 'Download data from memory',
            wx.Image('images/download_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Download data from memory')

        self.tb.AddTool(
            self.ID_toolUpload, 'Upload data to memory',
            wx.Image('images/upload_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Upload data to memory')

        self.tb.AddSeparator()

        self.tb.AddControl(
            wx.StaticText(self.tb,
                          self.ID_toolDisLabel,
                          label='Disassembler:',
                          name='lblDisass',
                          size=(70, -1),
                          style=0))

        self.tb.AddTool(
            self.ID_toolDisback, 'View previous disassembled memory',
            wx.Image('images/av_back_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'View previous disassembled memory')

        self.tb.AddTool(
            self.ID_toolDisforward, 'View next disassembled memory',
            wx.Image('images/av_play_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'View next disassembled memory')

        self.tb.AddSeparator()

        self.tb.AddControl(
            wx.StaticText(self.tb,
                          self.ID_toolDebugLabel,
                          label='PC:',
                          name='lblDebug',
                          size=(20, -1),
                          style=0))

        self.tb.AddTool(
            self.ID_toolStep, 'Step into',
            wx.Image('images/av_play_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Step into')

        self.tb.AddTool(
            self.ID_toolStepover, 'Step over',
            wx.Image('images/av_fast_forward_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Step over')

        self.tb.AddTool(
            self.ID_toolContinue, 'Continue execution',
            wx.Image('images/forward_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Continue execution')

        self.tb.AddSeparator()

        self.tb.AddTool(
            self.ID_toolAddBreak, 'Add breakpoint',
            wx.Image('images/document_new_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Add breakpoint')

        self.tb.AddTool(
            self.ID_toolDelBreak, 'Delete breakpoint',
            wx.Image('images/document_delete_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
            'Delete breakpoint')

        self.tb.AddSeparator()

        self.tb.AddTool(
            self.ID_toolListBookmarks, 'List bookmarks',
            wx.Image('images/bookmark_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'List bookmarks')

        self.tb.AddTool(
            self.ID_toolComment, 'Insert comment',
            wx.Image('images/comment_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Insert comment')

        self.tb.AddSeparator()

        search = TestSearchCtrl(self.tb,
                                size=(150, -1),
                                doSearch=self.gdb.DoDisSearch)
        self.tb.AddControl(search)

        self.tb.AddTool(
            self.ID_toolFindNext, 'Find next',
            wx.Image('images/forward_small.png',
                     wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Find next')

        self.tb.Realize()

        #-------Create panes----------------------------------------------------------

        self.RegistersHTMLCtrl = RegistersHTML(self, -1, wx.DefaultPosition,
                                               wx.Size(650, 195))
        self._mgr.AddPane(
            self.RegistersHTMLCtrl,
            wx.aui.AuiPaneInfo().Name("Registers").CenterPane().Caption(
                "Registers").CaptionVisible(True).Fixed())

        self.LastSigvalHTMLCtrl = SigvalHTML(self, -1, wx.DefaultPosition,
                                             wx.Size(115, 195))
        self._mgr.AddPane(
            self.LastSigvalHTMLCtrl,
            wx.aui.AuiPaneInfo().Name("LastException").CenterPane().Caption(
                "Last Exception").CaptionVisible(True).Fixed())

        self.BreakpointsHTMLCtrl = wx.html.HtmlWindow(self, -1,
                                                      wx.DefaultPosition,
                                                      wx.Size(115, 195))
        self._mgr.AddPane(
            self.BreakpointsHTMLCtrl,
            wx.aui.AuiPaneInfo().Name("Breakpoints").CenterPane().Caption(
                "Breakpoints").CaptionVisible(True).Fixed())

        self.DisassembleHTMLCtrl = DisassembleHTML(self, -1,
                                                   wx.DefaultPosition,
                                                   wx.Size(767, 370))
        self._mgr.AddPane(
            self.DisassembleHTMLCtrl,
            wx.aui.AuiPaneInfo().Name("Disassembler").CenterPane().Caption(
                "Disassembler").CaptionVisible(True).Fixed())

        self.StackHTMLCtrl = StackHTML(self, -1, wx.DefaultPosition,
                                       wx.Size(111, 370))
        self._mgr.AddPane(
            self.StackHTMLCtrl,
            wx.aui.AuiPaneInfo().Name("Stack").CenterPane().Caption(
                "Stack").CaptionVisible(True).Fixed())

        #-------Create perspectives---------------------------------------------------

        all_panes = self._mgr.GetAllPanes()
        perspective_default = self._mgr.SavePerspective()

        for ii in range(len(all_panes)):
            if not all_panes[ii].IsToolbar():
                all_panes[ii].Hide()

        self._mgr.GetPane("Registers").Show().Top().Layer(0).Row(0).Position(0)
        self._mgr.GetPane("LastException").Show().Top().Layer(0).Row(
            0).Position(0)
        self._mgr.GetPane("Breakpoints").Show().Top().Layer(0).Row(0).Position(
            0)
        self._mgr.GetPane("Disassembler").Show().Bottom().Layer(0).Row(
            0).Position(0)
        self._mgr.GetPane("Stack").Show().Bottom().Layer(0).Row(0).Position(0)

        self._perspectives.append(perspective_default)
        self._mgr.Update()

        #-------Bind events-----------------------------------------------------------

        self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_CLOSE, self.OnClose)

        self.Bind(wx.EVT_MENU, self.gdb.OnOpen, id=self.ID_Open)
        self.Bind(wx.EVT_MENU, self.gdb.OnOpen, id=self.ID_toolOpen)
        self.Bind(wx.EVT_MENU, self.gdb.OnSave, id=self.ID_Save)
        self.Bind(wx.EVT_MENU, self.gdb.OnSave, id=self.ID_toolSave)
        self.Bind(wx.EVT_MENU, self.gdb.OnSerial, id=self.ID_Serial)

        self.Bind(wx.EVT_MENU,
                  self.gdb.OnConfigureConnection,
                  id=self.ID_ConfigureConnection)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnConfigureConnection,
                  id=self.ID_toolConfigureConnection)
        self.Bind(wx.EVT_MENU, self.gdb.OnConnect, id=self.ID_Connect)
        self.Bind(wx.EVT_MENU, self.gdb.OnConnect, id=self.ID_toolConnect)
        self.Bind(wx.EVT_MENU, self.gdb.OnReconnect, id=self.ID_Reconnect)
        self.Bind(wx.EVT_MENU, self.gdb.OnReconnect, id=self.ID_toolReconnect)
        self.Bind(wx.EVT_MENU, self.gdb.OnUpload, id=self.ID_Upload)
        self.Bind(wx.EVT_MENU, self.gdb.OnUpload, id=self.ID_toolUpload)
        self.Bind(wx.EVT_MENU, self.gdb.OnDownload, id=self.ID_Download)
        self.Bind(wx.EVT_MENU, self.gdb.OnDownload, id=self.ID_toolDownload)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnSaveRunningConfig,
                  id=self.ID_SaveRunningConfig)
        self.Bind(wx.EVT_MENU, self.gdb.OnExit, id=wx.ID_EXIT)

        self.Bind(wx.EVT_MENU, self.gdb.OnReadReg, id=self.ID_ReadReg)
        self.Bind(wx.EVT_MENU, self.gdb.OnReadMem, id=self.ID_ReadMem)
        self.Bind(wx.EVT_MENU, self.gdb.OnReadHeap, id=self.ID_ReadHeap)
        self.Bind(wx.EVT_MENU, self.gdb.OnMemMap, id=self.ID_MemMap)
        self.Bind(wx.EVT_MENU, self.gdb.OnProcesses, id=self.ID_Processes)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnRunningConfig,
                  id=self.ID_RunningConfig)
        self.Bind(wx.EVT_MENU, self.gdb.OnDisplayRegistry, id=self.ID_Registry)
        self.Bind(wx.EVT_MENU, self.gdb.OnDisassemble, id=self.ID_Disassemble)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnDisassBackClick,
                  id=self.ID_toolDisback)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnDisassForwardClick,
                  id=self.ID_toolDisforward)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnListBookmarks,
                  id=self.ID_ListBookmarks)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnListBookmarks,
                  id=self.ID_toolListBookmarks)
        self.Bind(wx.EVT_MENU, self.gdb.OnSearch, id=self.ID_Search)

        self.Bind(wx.EVT_MENU, self.gdb.OnWriteReg, id=self.ID_WriteReg)
        self.Bind(wx.EVT_MENU, self.gdb.OnWriteMem, id=self.ID_WriteMem)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnSetBreakpoints,
                  id=self.ID_SetBreakpoints)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnSetBreakpoints,
                  id=self.ID_toolAddBreak)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnDelBreakpoints,
                  id=self.ID_DelBreakpoints)
        self.Bind(wx.EVT_MENU,
                  self.gdb.OnDelBreakpoints,
                  id=self.ID_toolDelBreak)
        self.Bind(wx.EVT_MENU, self.gdb.OnComment, id=self.ID_Comment)
        self.Bind(wx.EVT_MENU, self.gdb.OnComment, id=self.ID_toolComment)

        self.Bind(wx.EVT_MENU, self.gdb.OnStepInto, id=self.ID_StepInto)
        self.Bind(wx.EVT_MENU, self.gdb.OnStepInto, id=self.ID_toolStep)
        self.Bind(wx.EVT_MENU, self.gdb.OnStepOver, id=self.ID_StepOver)
        self.Bind(wx.EVT_MENU, self.gdb.OnStepOver, id=self.ID_toolStepover)

        self.Bind(wx.EVT_MENU, self.gdb.OnContinue, id=self.ID_Continue)
        self.Bind(wx.EVT_MENU, self.gdb.OnContinue, id=self.ID_toolContinue)
        self.Bind(wx.EVT_MENU, self.gdb.OnJump, id=self.ID_Jump)

        self.Bind(wx.EVT_MENU,
                  self.gdb.OnSearchNextDis,
                  id=self.ID_toolFindNext)

        self.Bind(wx.EVT_MENU, self.OnAbout, id=self.ID_About)
示例#12
0
import wx
import os
import sys
import wx.lib.agw.advancedsplash as AS

from graph_frame import GraphFrame
from serial_reader import SerialReader

SPLASH_FN = "splashscreen.png"
SPLASH_TIME = 3000

if __name__ == "__main__":
    app = wx.App(0)
    bitmap = wx.Bitmap(SPLASH_FN, wx.BITMAP_TYPE_PNG)
    shadow = wx.WHITE
    splash = AS.AdvancedSplash(None,
                               bitmap=bitmap,
                               timeout=SPLASH_TIME,
                               agwStyle=AS.AS_TIMEOUT | AS.AS_CENTER_ON_PARENT
                               | AS.AS_SHADOW_BITMAP,
                               shadowcolour=shadow)

    data_source = SerialReader()
    app.frame = GraphFrame(data_source)
    app.frame.Show()
    app.MainLoop()
示例#13
0
    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