Esempio n. 1
0
 def __init_gui(self):
     '''
     Initialization related to the widgets which make up the gui project.
     '''
     
     self.frame.Bind(wx.EVT_MENU, self.fork_by_editing,
                      id=s2i("Fork by editing"))
     self.frame.Bind(wx.EVT_MENU, self.fork_by_crunching,
                      id=s2i("Fork by crunching"))
Esempio n. 2
0
    def __init_gui(self, parent_window):
        '''
        Initialization related to the GUI widgets which make up the gui project.
        '''
        main_window = self.main_window = wx.ScrolledWindow(parent_window, -1)
        self.main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.main_window.SetSizer(self.main_sizer)

        self.state_showing_window = \
            wx.lib.scrolledpanel.ScrolledPanel(self.main_window, -1)

        locals_for_shell = locals()
        locals_for_shell.update({'gp': self,
                                 'p': self.project,
                                 't': self.project.tree,
                                 'garlicsim': garlicsim})
        self.shell = wx.py.shell.Shell(self.main_window, -1, size=(400, -1),
                                       locals=locals_for_shell)
        self.seek_bar = custom_widgets.SeekBar(self.main_window, -1, self)
        self.tree_browser = custom_widgets.TreeBrowser(self.main_window, -1,
                                                       self)


        self.top_fwc = FoldableWindowContainer(self.main_window, -1,
                                               self.state_showing_window,
                                               self.shell, wx.RIGHT,
                                               folded=True)
        temp = FoldableWindowContainer(self.main_window, -1, self.top_fwc,
                                       self.seek_bar, wx.BOTTOM)
        temp = FoldableWindowContainer(self.main_window, -1, temp,
                                       self.tree_browser, wx.BOTTOM)
        self.main_sizer.Add(temp, 1, wx.EXPAND)
        self.main_sizer.Fit(self.main_window)
        
        main_window.Bind(wx.EVT_MENU, self.edit_from_active_node,
                         id=s2i("Fork by editing"))
        main_window.Bind(wx.EVT_MENU, self.fork_naturally,
                         id=s2i("Fork naturally"))
        
        self.stuff_to_do_when_idle = Queue.Queue()
        self.main_window.Bind(wx.EVT_IDLE, self.on_idle)
Esempio n. 3
0
 def get_node_menu(self):
     '''
     Get the node menu.
     
     The node menu lets you do actions with the active node.
     '''
     nodemenu = wx.Menu()
     nodemenu.Append(
         s2i("Fork by editing"),
         "Fork by &editing",
         " Create a new edited node with the current node as the template"
     )
     nodemenu.Append(
         s2i("Fork naturally"),
         "Fork &naturally",
         " Run the simulation from this node"
     )
     nodemenu.AppendSeparator()
     nodemenu.Append(
         s2i("Delete..."),
         "&Delete...",
         " Delete the node"
     )
     return nodemenu