예제 #1
0
    def __create_components(self):
        label_select_tagset = wx.StaticText(self, -1, 'Select tagset', style=wx.ALIGN_CENTRE) 
        
        # Add the tagsets to the drop down.
        self.tagsets = objectCubeService.getAllTagsets()
        self.drop_down_type = wx.ComboBox(self, -1, choices=[t.name for t in self.tagsets ], style=wx.CB_READONLY) 
        
        # Select the first element in the dropdown. 
        # We must do this later so we trigger the select event.
        label_select_tag = wx.StaticText(self, -1, 'Select tag', style=wx.ALIGN_CENTRE)
        
        # Create listbox for the tags from the selection in the drop down.
        self.listBox1 = wx.ListBox(choices=[], id=-1, name='listBox1', parent=self, style=0)
        
        # Create buttons for this dialog.
        self.btn_ok = wx.Button(self, id=-1, label='Add', pos=(160, 150))
        self.btn_cancel = wx.Button(self, id=-1, label='Cancel', pos=(260, 150))

        # Create horizontal box sizer for the buttons.
        self.button_box = wx.BoxSizer(wx.HORIZONTAL)
        self.button_box.Add(self.btn_ok,0, wx.EXPAND)
        self.button_box.Add(self.btn_cancel,0,wx.EXPAND)
        
        # create a sizer for this dialog. 
        self.sizer=wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(label_select_tagset, 0, wx.ALL,5)
        self.sizer.Add(self.drop_down_type, 0, wx.ALL|wx.EXPAND, 5)
        self.sizer.Add(label_select_tag, 0, wx.ALL|wx.EXPAND, 5)
        self.sizer.Add(self.listBox1, 1, wx.ALL|wx.EXPAND,5)
        self.sizer.Add(self.button_box,0,wx.EXPAND, 5)
        self.SetSizer(self.sizer)
예제 #2
0
 def __init_components(self):
     # create label for the file url.
     self.lbl_select_object = wx.StaticText(self, -1, 'Select directory:', 
         style=wx.ALIGN_CENTRE, 
         pos=(10,10))
     
     # create text label for the file url.
     self.text_location = wx.TextCtrl ( self, -1, pos=(20, 45), size=wx.Size(240, -1), style=wx.TE_READONLY )
 
     # create button for the file url.
     self.btn_browse = wx.Button(self, id=-1, label='Browse..', pos=(270, 45), size=wx.Size(80, 25))
     
     # create submit buttons.
     #self.btn_ok = wx.Button(self, id=-1, label='Add', pos=(110, 80))
     #self.btn_cancel = wx.Button(self, id=-1, label='Cancel', pos=(190, 80))
     self.btn_ok = wx.Button(self, id=-1, label='Add', pos=(170, 290))
     self.btn_cancel = wx.Button(self, id=-1, label='Cancel', pos=(265, 290))
     
     # Create tagset tree for selecting tags for images that we are importing.
     self.tagset_tree = CheckTreeCtrl(self, -1, 
     style=CT_AUTO_CHECK_CHILD|wx.TR_DEFAULT_STYLE|wx.SUNKEN_BORDER, pos=(20,80), size=wx.Size(330,200))
     
     self.tag_nodes = {}
     
     tagset_root = self.tagset_tree.AddRoot("All tagsets")
     for tagset in objectCubeService.getAllTagsets():
         child = self.tagset_tree.AppendItem(tagset_root, tagset.name, False)
         for tag in tagset.getTags():
             tn = self.tagset_tree.AppendItem(child, tag.valueAsString(), False)
             self.tag_nodes[tn] = tag
예제 #3
0
 def load_data(self):
     """
     Function for loading data for this list.
     """
     self.DeleteAllItems()
     self.items = []
     for n in objectCubeService.getAllTagsets():
         self.items.append(n.id)
         self.add_line([n.name, n.typeAsString()])
예제 #4
0
 def load_data(self):
     """
     Function for loading data for this list.
     """
     self.DeleteAllItems()
     self.items = []
     for n in objectCubeService.getAllTagsets():
         self.items.append(n.id)
         self.add_line([n.name, n.typeAsString()])
예제 #5
0
    def __init_components(self):
        # create label for the file url.
        self.lbl_select_object = wx.StaticText(self,
                                               -1,
                                               'Select directory:',
                                               style=wx.ALIGN_CENTRE,
                                               pos=(10, 10))

        # create text label for the file url.
        self.text_location = wx.TextCtrl(self,
                                         -1,
                                         pos=(20, 45),
                                         size=wx.Size(240, -1),
                                         style=wx.TE_READONLY)

        # create button for the file url.
        self.btn_browse = wx.Button(self,
                                    id=-1,
                                    label='Browse..',
                                    pos=(270, 45),
                                    size=wx.Size(80, 25))

        # create submit buttons.
        #self.btn_ok = wx.Button(self, id=-1, label='Add', pos=(110, 80))
        #self.btn_cancel = wx.Button(self, id=-1, label='Cancel', pos=(190, 80))
        self.btn_ok = wx.Button(self, id=-1, label='Add', pos=(170, 290))
        self.btn_cancel = wx.Button(self,
                                    id=-1,
                                    label='Cancel',
                                    pos=(265, 290))

        # Create tagset tree for selecting tags for images that we are importing.
        self.tagset_tree = CheckTreeCtrl(
            self,
            -1,
            style=CT_AUTO_CHECK_CHILD | wx.TR_DEFAULT_STYLE | wx.SUNKEN_BORDER,
            pos=(20, 80),
            size=wx.Size(330, 200))

        self.tag_nodes = {}

        tagset_root = self.tagset_tree.AddRoot("All tagsets")
        for tagset in objectCubeService.getAllTagsets():
            child = self.tagset_tree.AppendItem(tagset_root, tagset.name,
                                                False)
            for tag in tagset.getTags():
                tn = self.tagset_tree.AppendItem(child, tag.valueAsString(),
                                                 False)
                self.tag_nodes[tn] = tag
예제 #6
0
    def __create_components(self):
        label_select_tagset = wx.StaticText(self,
                                            -1,
                                            'Select tagset',
                                            style=wx.ALIGN_CENTRE)

        # Add the tagsets to the drop down.
        self.tagsets = objectCubeService.getAllTagsets()
        self.drop_down_type = wx.ComboBox(
            self,
            -1,
            choices=[t.name for t in self.tagsets],
            style=wx.CB_READONLY)

        # Select the first element in the dropdown.
        # We must do this later so we trigger the select event.
        label_select_tag = wx.StaticText(self,
                                         -1,
                                         'Select tag',
                                         style=wx.ALIGN_CENTRE)

        # Create listbox for the tags from the selection in the drop down.
        self.listBox1 = wx.ListBox(choices=[],
                                   id=-1,
                                   name='listBox1',
                                   parent=self,
                                   style=0)

        # Create buttons for this dialog.
        self.btn_ok = wx.Button(self, id=-1, label='Add', pos=(160, 150))
        self.btn_cancel = wx.Button(self,
                                    id=-1,
                                    label='Cancel',
                                    pos=(260, 150))

        # Create horizontal box sizer for the buttons.
        self.button_box = wx.BoxSizer(wx.HORIZONTAL)
        self.button_box.Add(self.btn_ok, 0, wx.EXPAND)
        self.button_box.Add(self.btn_cancel, 0, wx.EXPAND)

        # create a sizer for this dialog.
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(label_select_tagset, 0, wx.ALL, 5)
        self.sizer.Add(self.drop_down_type, 0, wx.ALL | wx.EXPAND, 5)
        self.sizer.Add(label_select_tag, 0, wx.ALL | wx.EXPAND, 5)
        self.sizer.Add(self.listBox1, 1, wx.ALL | wx.EXPAND, 5)
        self.sizer.Add(self.button_box, 0, wx.EXPAND, 5)
        self.SetSizer(self.sizer)