Example #1
0
 def __init__(self, parent, object=None, start_component=None):
     #HACK - had to use DD_DEFAULT_STYLE to make it sizeable
     wx.Dialog.__init__(self, parent, style = wx.DD_DEFAULT_STYLE,
                        title = 'Select A Component To Add')
     self.Name = "Component Browser"
     rect = wx.GetApp().get_default_rect( self)
     if rect:
         self.SetPosition((rect[0],rect[1]))
         self.SetSize((rect[2],rect[3]))        
     sizer = wx.BoxSizer(wx.VERTICAL)
     self.SetSizer(sizer)
     self.SetSize((633, 455))   
     self.SetIcon(get_icon())             
     self.component = None
     
     buttonSizer = wx.StdDialogButtonSizer()
     addButton = wx.Button(self,wx.ID_OK,label="Add")
     addButton.SetToolTipString("Add Selected Components")
     cancelButton = wx.Button(self,wx.ID_CANCEL)
     buttonSizer.AddButton(addButton)
     buttonSizer.AddButton(cancelButton)
     buttonSizer.Realize()
     
     self.browser = ComponentBrowseWindow(self, object)
     if start_component:
         self.browser.select_component(start_component)
     self.browser.tree.ExpandRecent()
     
     sizer.Add(self.browser, 1, wx.EXPAND | wx.SOUTH, 10)        
     sizer.Add(buttonSizer, 0, wx.EXPAND | wx.SOUTH | wx.WEST, 10)
     addButton.Bind(wx.EVT_BUTTON, self.on_add)
     self.browser.tree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, 
                            self.on_tree_dclicked)
     self.Bind(wx.EVT_CLOSE, self.on_close)
Example #2
0
 def __init__(self,
              obj=None,
              objectpath="unknown",
              title="",
              show=True,
              parent=None,
              name=None,
              **kwargs):
     wx.Frame.__init__(self,
                       parent=parent,
                       size=WX_PUGFRAME_DEFAULT_SIZE,
                       title=title,
                       name='',
                       **kwargs)
     self.SetMinSize(wx.Size(250, 130))
     self.SetIcon(get_icon())
     self.objectpath = objectpath
     self.Bind(wx.EVT_ACTIVATE, self._evt_on_activate)
     self.Bind(wx.EVT_MENU, self._evt_passmenu)
     bar = self.CreateStatusBar()
     bar.Bind(wx.EVT_LEFT_DCLICK, self.show_all_attributes)
     self.setup_window(obj, objectpath, title, name)
     self.Layout()
     rect = wx.GetApp().get_default_rect(self)
     if rect:
         self.SetPosition((rect[0], rect[1]))
         self.SetSize((rect[2], rect[3]))
     if show:
         self.Show()
Example #3
0
 def __init__(self, parent=None, id=-1, title='Pug Python Editor',
              pos=wx.DefaultPosition, size=(800, 600), 
              style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
              filename=None, project_only=False, components_folder=None,
              browser_root=".", browser_filter = ("*.py","*.pyw")):
     """Create EditorNotebookFrame instance."""        
     self.notebook = None
     self.project_only = project_only
     self.components_folder = components_folder
     EditorNotebookFrame.__init__(self, parent, id, title, pos,
                          size, style, filename)
     self.Name = "Pug Python Editor"
     self.SetRect(wx.GetApp().get_default_rect(self))
     dispatcher.connect(receiver=self._editorChange,
                            signal='EditorChange', sender=self.notebook)
     self.notebook.Bind(wx.EVT_IDLE, self.OnIdle)
     self.notebook.Bind(aui.EVT_AUINOTEBOOK_PAGE_CHANGED, 
                        self.OnPageChanged)       
     self.notebook.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.PageClose)
     self.Bind(wx.EVT_CLOSE, self.OnExit)
     # override default menus
     self._createMenus()
     # setup look
     self._defaultText = title
     self.SetIcon(get_icon())     
     if browser_root is not None:
         self.browser = FileTree( self.notebook, 
                                  rootfolder=browser_root,
                                  file_filter=browser_filter) 
     self.browser.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnBrowserDClick)
     self.notebook.AddPage(page=self.browser, text="* Browser *",
                           select=True)
Example #4
0
    def __init__(self, parent, object=None, start_component=None):
        #HACK - had to use DD_DEFAULT_STYLE to make it sizeable
        wx.Dialog.__init__(self,
                           parent,
                           style=wx.DD_DEFAULT_STYLE,
                           title='Select A Component')
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(sizer)
        self.SetSize((633, 455))
        self.SetIcon(get_icon())
        self.component = None

        buttonSizer = wx.StdDialogButtonSizer()
        okayButton = wx.Button(self, wx.ID_OK)
        cancelButton = wx.Button(self, wx.ID_CANCEL)
        buttonSizer.AddButton(okayButton)
        buttonSizer.AddButton(cancelButton)
        buttonSizer.Realize()

        self.browser = ComponentBrowseWindow(self, object)
        if start_component:
            self.browser.select_component(start_component)

        sizer.Add(self.browser, 1, wx.EXPAND | wx.SOUTH, 10)
        sizer.Add(buttonSizer, 0, wx.EXPAND | wx.SOUTH | wx.EAST, 10)
        okayButton.Bind(wx.EVT_BUTTON, self.on_ok)
Example #5
0
 def __init__(self, parent=None, object=None, start_component=None, 
              title="Component Browser"):
     #HACK - had to use DD_DEFAULT_STYLE to make it sizeable
     wx.Frame.__init__(self, parent, style = wx.DD_DEFAULT_STYLE,
                        title = title)
     sizer = wx.BoxSizer(wx.VERTICAL)
     self.SetSizer(sizer)
     self.SetSize((633, 455))        
     self.SetIcon(get_icon())             
     
     self.browser = ComponentBrowseWindow(self, object)
     if start_component:
         self.browser.select_component(start_component)
     
     sizer.Add(self.browser, 1, wx.EXPAND | wx.SOUTH, 1)        
Example #6
0
    def __init__(self,
                 parent=None,
                 object=None,
                 start_component=None,
                 title="Component Browser"):
        #HACK - had to use DD_DEFAULT_STYLE to make it sizeable
        wx.Frame.__init__(self, parent, style=wx.DD_DEFAULT_STYLE, title=title)
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(sizer)
        self.SetSize((633, 455))
        self.SetIcon(get_icon())

        self.browser = ComponentBrowseWindow(self, object)
        if start_component:
            self.browser.select_component(start_component)

        sizer.Add(self.browser, 1, wx.EXPAND | wx.SOUTH, 1)
Example #7
0
    def __init__(self,
                 objInfoList=None,
                 title="",
                 show=True,
                 parent=None,
                 **kwargs):
        wx.aui.AuiMDIParentFrame.__init__(self,
                                          parent,
                                          -1,
                                          size=WX_PUGFRAME_DEFAULT_SIZE,
                                          style=wx.DEFAULT_FRAME_STYLE,
                                          title=title,
                                          **kwargs)

        sizer = wx.BoxSizer()
        self.SetMinSize(wx.Size(250, 130))
        self.SetIcon(get_icon())
        self.Bind(wx.EVT_ACTIVATE, self._evt_on_activate)
        #        menu = wx.Menu()
        #        id = wx.NewId()
        #        menu.Append(help='Tile windows horizontally', id=id,
        #                    text='Tile horizontal')
        #        self.Bind(wx.EVT_MENU, self.tile_horizontal, id=id)
        #        id = wx.NewId()
        #        menu.Append(help='Tile windows vertically', id=id,
        #                    text='Tile vertical')
        #        self.Bind(wx.EVT_MENU, self.tile_vertical, id=id)
        self.SetWindowMenu(None)

        if objInfoList and not isinstance(objInfoList, list):
            objInfoList = [objInfoList]
        self.open_obj_info_list(objInfoList)
        self.GetClientWindow().SetSelection(0)

        bar = self.CreateStatusBar()
        bar.Bind(wx.EVT_LEFT_DCLICK, self.show_all_attributes)
        self.Bind(wx.EVT_MENU, self._evt_passmenu)
        rect = wx.GetApp().get_default_rect(self)
        if rect:
            self.SetPosition((rect[0], rect[1]))
            self.SetSize((rect[2], rect[3]))
        if show:
            self.Show()
Example #8
0
 def __init__(self,
              parent=None,
              id=-1,
              title='Pug Python Editor',
              pos=wx.DefaultPosition,
              size=(800, 600),
              style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
              filename=None,
              project_only=False,
              components_folder=None,
              browser_root=".",
              browser_filter=("*.py", "*.pyw")):
     """Create EditorNotebookFrame instance."""
     self.notebook = None
     self.project_only = project_only
     self.components_folder = components_folder
     EditorNotebookFrame.__init__(self, parent, id, title, pos, size, style,
                                  filename)
     self.Name = "Pug Python Editor"
     self.SetRect(wx.GetApp().get_default_rect(self))
     dispatcher.connect(receiver=self._editorChange,
                        signal='EditorChange',
                        sender=self.notebook)
     self.notebook.Bind(wx.EVT_IDLE, self.OnIdle)
     self.notebook.Bind(aui.EVT_AUINOTEBOOK_PAGE_CHANGED,
                        self.OnPageChanged)
     self.notebook.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.PageClose)
     self.Bind(wx.EVT_CLOSE, self.OnExit)
     # override default menus
     self._createMenus()
     # setup look
     self._defaultText = title
     self.SetIcon(get_icon())
     if browser_root is not None:
         self.browser = FileTree(self.notebook,
                                 rootfolder=browser_root,
                                 file_filter=browser_filter)
     self.browser.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnBrowserDClick)
     self.notebook.AddPage(page=self.browser,
                           text="* Browser *",
                           select=True)
Example #9
0
 def __init__(self, parent, object=None, start_component=None):
     #HACK - had to use DD_DEFAULT_STYLE to make it sizeable
     wx.Dialog.__init__(self, parent, style = wx.DD_DEFAULT_STYLE,
                        title = 'Select A Component')
     sizer = wx.BoxSizer(wx.VERTICAL)
     self.SetSizer(sizer)
     self.SetSize((633,455))   
     self.SetIcon(get_icon())             
     self.component = None
     
     buttonSizer = wx.StdDialogButtonSizer()
     okayButton = wx.Button(self,wx.ID_OK)
     cancelButton = wx.Button(self,wx.ID_CANCEL)
     buttonSizer.AddButton(okayButton)
     buttonSizer.AddButton(cancelButton)
     buttonSizer.Realize()
     
     self.browser = ComponentBrowseWindow(self, object)
     if start_component:
         self.browser.select_component(start_component)
     
     sizer.Add(self.browser, 1, wx.EXPAND | wx.SOUTH, 10)        
     sizer.Add(buttonSizer, 0, wx.EXPAND | wx.SOUTH | wx.EAST, 10)
     okayButton.Bind(wx.EVT_BUTTON, self.on_ok)
Example #10
0
    def __init__(self, objInfoList=None, title="", show=True, parent=None, 
                 **kwargs):        
        wx.aui.AuiMDIParentFrame.__init__(self, parent, -1,
                            size=WX_PUGFRAME_DEFAULT_SIZE, 
                            style=wx.DEFAULT_FRAME_STYLE,
                            title=title,**kwargs) 

        sizer = wx.BoxSizer()
        self.SetMinSize(wx.Size(250, 130))
        self.SetIcon(get_icon())
        self.Bind(wx.EVT_ACTIVATE, self._evt_on_activate)
#        menu = wx.Menu()
#        id = wx.NewId()
#        menu.Append(help='Tile windows horizontally', id=id, 
#                    text='Tile horizontal')
#        self.Bind(wx.EVT_MENU, self.tile_horizontal, id=id)
#        id = wx.NewId()
#        menu.Append(help='Tile windows vertically', id=id, 
#                    text='Tile vertical')
#        self.Bind(wx.EVT_MENU, self.tile_vertical, id=id)
        self.SetWindowMenu(None)
        
        if objInfoList and not isinstance(objInfoList, list):
            objInfoList = [objInfoList]
        self.open_obj_info_list( objInfoList)
        self.GetClientWindow().SetSelection(0)
            
        bar = self.CreateStatusBar()        
        bar.Bind(wx.EVT_LEFT_DCLICK, self.show_all_attributes)        
        self.Bind(wx.EVT_MENU, self._evt_passmenu)
        rect = wx.GetApp().get_default_rect( self)
        if rect:
            self.SetPosition((rect[0],rect[1]))
            self.SetSize((rect[2],rect[3]))
        if show:
            self.Show()
Example #11
0
    def __init__(self, parent, object=None, start_component=None):
        #HACK - had to use DD_DEFAULT_STYLE to make it sizeable
        wx.Dialog.__init__(self,
                           parent,
                           style=wx.DD_DEFAULT_STYLE,
                           title='Select A Component To Add')
        self.Name = "Component Browser"
        rect = wx.GetApp().get_default_rect(self)
        if rect:
            self.SetPosition((rect[0], rect[1]))
            self.SetSize((rect[2], rect[3]))
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(sizer)
        self.SetSize((633, 455))
        self.SetIcon(get_icon())
        self.component = None

        buttonSizer = wx.StdDialogButtonSizer()
        addButton = wx.Button(self, wx.ID_OK, label="Add")
        addButton.SetToolTipString("Add Selected Components")
        cancelButton = wx.Button(self, wx.ID_CANCEL)
        buttonSizer.AddButton(addButton)
        buttonSizer.AddButton(cancelButton)
        buttonSizer.Realize()

        self.browser = ComponentBrowseWindow(self, object)
        if start_component:
            self.browser.select_component(start_component)
        self.browser.tree.ExpandRecent()

        sizer.Add(self.browser, 1, wx.EXPAND | wx.SOUTH, 10)
        sizer.Add(buttonSizer, 0, wx.EXPAND | wx.SOUTH | wx.WEST, 10)
        addButton.Bind(wx.EVT_BUTTON, self.on_add)
        self.browser.tree.Bind(wx.EVT_TREE_ITEM_ACTIVATED,
                               self.on_tree_dclicked)
        self.Bind(wx.EVT_CLOSE, self.on_close)