Changeset 716
- Timestamp:
- 01/12/05 12:54:57 (4 years ago)
- Files:
-
- trunk/AUTHORS (modified) (1 diff)
- trunk/ui/uiwx/dComboBox.py (modified) (1 diff)
- trunk/ui/uiwx/dDropdownList.py (modified) (1 diff)
- trunk/ui/uiwx/dListBox.py (modified) (2 diffs)
- trunk/ui/uiwx/dRadioGroup.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/AUTHORS
r56 r716 1 Ed Leafe <ed@leafe.com> 2 Paul McNett <p@ulmcnett.com> 1 The core authors of Dabo are: 2 3 Ed Leafe 4 Paul McNett 5 6 7 The following people have submitted patches to Dabo: 8 9 John Fabiani 10 Vladimir Sekissov 11 12 13 Thanks everyone for using, improving, and enjoying Dabo!! trunk/ui/uiwx/dComboBox.py
r696 r716 77 77 if type(val) == dict: 78 78 self._keys = val 79 self._invertedKeys = dict([[v,k] for k,v in val.iteritems()]) 79 80 else: 80 81 raise TypeError, "Keys must be a dictionary." 81 82 82 83 def _getKeyValue(self): 83 # invert the dict so we can get the key based on current position: 84 inverted = dict([[v,k] for k,v in self.Keys.iteritems()]) 85 try: 86 return inverted[self.PositionValue] 84 # Return the current key value based on the current position value 85 try: 86 return self._invertedKeys[self.PositionValue] 87 87 except KeyError: 88 88 return None 89 89 90 90 def _setKeyValue(self, val): 91 91 # This function takes a key value, such as 10992, finds the mapped position, trunk/ui/uiwx/dDropdownList.py
r696 r716 68 68 if type(val) == dict: 69 69 self._keys = val 70 self._invertedKeys = dict([[v,k] for k,v in val.iteritems()]) 70 71 else: 71 72 raise TypeError, "Keys must be a dictionary." 72 73 73 74 def _getKeyValue(self): 74 # invert the dict so we can get the key based on current position: 75 inverted = dict([[v,k] for k,v in self.Keys.iteritems()]) 76 try: 77 return inverted[self.PositionValue] 75 # Return the current key value based on the current position value 76 try: 77 return self._invertedKeys[self.PositionValue] 78 78 except KeyError: 79 79 return None 80 # (note that the above method has to make a new dict every time the KeyValue81 # is accessed... possible performance bottleneck on large lists!)82 80 83 81 def _setKeyValue(self, val): trunk/ui/uiwx/dListBox.py
r696 r716 70 70 if type(val) == dict: 71 71 self._keys = val 72 self._invertedKeys = dict([[v,k] for k,v in val.iteritems()]) 72 73 else: 73 74 raise TypeError, "Keys must be a dictionary." 74 75 75 76 def _getKeyValue(self): 76 # invert the dict so we can get the key based on current position:77 inverted = dict([[v,k] for k,v in self.Keys.iteritems()])78 77 selections = self.PositionValue 79 78 values = [] … … 87 86 for selection in selections: 88 87 try: 89 values.append( inverted[selection])88 values.append(self._invertedKeys[selection]) 90 89 except KeyError: 91 90 values.append(None) trunk/ui/uiwx/dRadioGroup.py
r696 r716 109 109 if type(val) == dict: 110 110 self._keys = val 111 self._invertedKeys = dict([[v,k] for k,v in val.iteritems()]) 111 112 else: 112 113 raise TypeError, "Keys must be a dictionary." 113 114 114 115 def _getKeyValue(self): 115 # invert the dict so we can get the key based on current position: 116 inverted = dict([[v,k] for k,v in self.Keys.iteritems()]) 117 try: 118 return inverted[self.PositionValue] 116 # Return the current key value based on the current position value 117 try: 118 return self._invertedKeys[self.PositionValue] 119 119 except KeyError: 120 120 return None … … 343 343 print "StringValue: ", self.StringValue 344 344 print "Value: ", self.Value 345 self.enable Item(42, False)345 self.enable(42, False) 346 346 347 347 test.Test().runTest(_T)
