示例#1
0
 def setup(self, attribute, window, aguidata):
     aguidata.update({
         'list_generator': self.get_list,
         'allow_typing': True,
     })
     aguidata.setdefault('component_types', [])
     Dropdown.setup(self, attribute, window, aguidata)
示例#2
0
 def setup(self, attribute, window, aguidata):
     specialaguidata = {
         'allow_typing': True,
         'list_generator': self.list_generator_func
     }
     specialaguidata.update(aguidata)
     self.class_list = aguidata.get('class_list', [])
     Dropdown.setup(self, attribute, window, specialaguidata)
示例#3
0
 def setup(self, attribute, window, aguidata):
     aguidata.setdefault('as_character', True)
     aguidata.setdefault('sort', False)
     if aguidata['as_character']:
         keylist = []
         for pair in pig.keyboard.key_list:
             keylist.append(pair[0])
         aguidata['list'] = keylist
     else:
         aguidata['list'] = pig.keyboard.key_list
     Dropdown.setup(self, attribute, window, aguidata)
示例#4
0
 def setup(self, attribute, window, aguidata): 
     aguidata.setdefault('as_character', True)
     aguidata.setdefault('sort', False)
     if aguidata['as_character']:
         keylist = []
         for pair in pig.keyboard.key_list:
             keylist.append(pair[0])
         aguidata['list'] = keylist
     else:
         aguidata['list'] = pig.keyboard.key_list
     Dropdown.setup(self, attribute, window, aguidata)
     
                     
示例#5
0
 def setup(self, attribute, window, aguidata):    
     specialaguidata = {'class_list': [Node],
                        'append_list':[],
                        'prepend_list':[],
                        'doc': 'Saved object class', 
                         'list_generator': self.object_list_generator}
     specialaguidata.update(aguidata)
     if specialaguidata.get('component'):
         specialaguidata.setdefault('none_choice', True)
         self.return_strings = True
     none_choice = specialaguidata.get('none_choice')
     if none_choice == -1:
         specialaguidata['append_list'].append(('#None#',None))
     elif none_choice:
         specialaguidata['prepend_list'].insert(0,('#None#',None))
     specialaguidata['prepend_list'].reverse()
     self.class_list = aguidata.get('class_list',[])
     Dropdown.setup(self, attribute, window, specialaguidata)
示例#6
0
 def set_control_value(self, value):
     # use name of value if we can
     if not value:
         self.control.SetText("")
         self.data = None
         return
     try:
         scenename = value.__name__
     except:
         scenename = value
     i = self.listctrl.FindText( scenename)
     if i != -1:
         self.listctrl.SelectItem(i)
         self.control.SetText( self.listctrl.GetStringValue())
         self.data = value
         self.set_tooltip()
     else:
         Dropdown.set_control_value(self, value)
示例#7
0
 def setup(self, attribute, window, aguidata):
     specialaguidata = {
         'class_list': [Node],
         'append_list': [],
         'prepend_list': [],
         'doc': 'Saved object class',
         'list_generator': self.object_list_generator
     }
     specialaguidata.update(aguidata)
     if specialaguidata.get('component'):
         specialaguidata.setdefault('none_choice', True)
         self.return_strings = True
     none_choice = specialaguidata.get('none_choice')
     if none_choice == -1:
         specialaguidata['append_list'].append(('#None#', None))
     elif none_choice:
         specialaguidata['prepend_list'].insert(0, ('#None#', None))
     specialaguidata['prepend_list'].reverse()
     self.class_list = aguidata.get('class_list', [])
     Dropdown.setup(self, attribute, window, specialaguidata)
示例#8
0
 def setup(self, attribute, window, aguidata): 
     aguidata.update({'list_generator': self.get_list,
                      'allow_typing':True,
                      })
     aguidata.setdefault('component_types',[])
     Dropdown.setup(self, attribute, window, aguidata)
示例#9
0
 def setup(self, attribute, window, aguidata):
     aguidata.update({
         'list_generator': get_group_list,
         'allow_typing': True
     })
     Dropdown.setup(self, attribute, window, aguidata)
示例#10
0
 def setup(self, attribute, window, aguidata):    
     specialaguidata = {'allow_typing': True, 
                         'list_generator': self.list_generator_func}
     specialaguidata.update(aguidata)
     self.class_list = aguidata.get('class_list',[])
     Dropdown.setup(self, attribute, window, specialaguidata)
示例#11
0
 def item_selected(self, event=None):
     self.do_change = True
     Dropdown.item_selected(self, event)
     self.do_change = False
示例#12
0
 def apply(self, event=None):
     # only apply when user changes dropdown
     if not self.do_change:
         return
     Dropdown.apply(self, event)
示例#13
0
 def setup(self, attribute, window, aguidata): 
     aguidata.update({'list_generator': get_group_list,
                      'allow_typing':True})
     Dropdown.setup(self, attribute, window, aguidata)