Changeset 614
- Timestamp:
- 07/12/03 20:20:09 (5 years ago)
- Files:
-
- trunk/RBSkinning/RBSkinning/wxPythonSkin/check_list.py (modified) (3 diffs)
- trunk/RBSkinning/RBSkinning/wxPythonSkin/choice.py (modified) (3 diffs)
- trunk/RBSkinning/RBSkinning/wxPythonSkin/combo.py (modified) (3 diffs)
- trunk/RBSkinning/RBSkinning/wxPythonSkin/list.py (modified) (1 diff)
- trunk/RBSkinning/RBSkinning/wxPythonSkin/wxSkinObject.py (modified) (3 diffs)
- trunk/RBSkinning/plans/todo.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBSkinning/RBSkinning/wxPythonSkin/check_list.py
r472 r614 24 24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 25 26 from wxSkinLayoutObject import wx, wxSkinLayoutObject26 from list import wx, list as listelement 27 27 28 28 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 30 30 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 31 32 class check_list( wxSkinLayoutObject):32 class check_list(listelement): 33 33 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 34 #~ Constants / Variables / Etc. 35 35 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 36 37 default_settings = wxSkinLayoutObject.default_settings.copy()37 default_settings = listelement.default_settings.copy() 38 38 default_settings.update({ 39 39 'name': __name__, 40 'wxid': 'wx.wxNewId()',41 'choices': '[]',42 'selection':'-1',43 40 }) 44 41 … … 53 50 self.wxInitialStandardOptions() 54 51 55 def SkinFinalize(self):56 content = self.Content()57 for each in content:58 each = each.replace('\n', '').strip()59 if each: self.object.Append(each)60 self.object.SetSelection(self.wxEval('selection'))61 62 self.wxFinalStandardOptions()63 trunk/RBSkinning/RBSkinning/wxPythonSkin/choice.py
r472 r614 24 24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 25 26 from wxSkinLayoutObject import wx, wxSkinLayoutObject26 from list import wx, list as listelement 27 27 28 28 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 30 30 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 31 32 class choice( wxSkinLayoutObject):32 class choice(listelement): 33 33 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 34 #~ Constants / Variables / Etc. 35 35 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 36 37 default_settings = wxSkinLayoutObject.default_settings.copy()37 default_settings = listelement.default_settings.copy() 38 38 default_settings.update({ 39 39 'name': __name__, 40 'wxid': 'wx.wxNewId()',41 'choices': '[]',42 'selection':'-1',43 40 }) 44 41 … … 53 50 self.wxInitialStandardOptions() 54 51 55 def SkinFinalize(self):56 content = self.Content()57 for each in content:58 each = each.replace('\n', '').strip()59 if each: self.object.Append(each)60 self.object.SetSelection(self.wxEval('selection'))61 62 self.wxFinalStandardOptions()trunk/RBSkinning/RBSkinning/wxPythonSkin/combo.py
r472 r614 24 24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 25 26 from wxSkinLayoutObject import wx, wxSkinLayoutObject26 from list import wx, list as listelement 27 27 28 28 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 30 30 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 31 32 class combo( wxSkinLayoutObject):32 class combo(listelement): 33 33 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 34 34 #~ Constants / Variables / Etc. 35 35 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 36 37 default_settings = wxSkinLayoutObject.default_settings.copy()37 default_settings = listelement.default_settings.copy() 38 38 default_settings.update({ 39 39 'name': __name__, 40 'wxid': 'wx.wxNewId()',41 'choices': '[]',42 'selection':'-1',43 40 'value': '', 44 41 }) … … 55 52 56 53 def SkinFinalize(self): 57 content = self.Content()58 for each in content:59 each = each.replace('\n', '').strip()60 if each: self.object.Append(each)61 self.object.SetSelection(self.wxEval('selection'))62 54 value = self.settings['value'] 63 55 if value: self.object.SetValue(value) 64 56 65 self.wxFinalStandardOptions()57 listelement.SkinFinalize(self) 66 58 trunk/RBSkinning/RBSkinning/wxPythonSkin/list.py
r472 r614 54 54 55 55 def SkinFinalize(self): 56 content = self.Content() 57 for each in content: 58 each = each.replace('\n', '').strip() 59 if each: self.object.Append(each) 56 content = filter(None, map(str.strip, ''.join(self.Content()).split('\n'))) 57 for each in content: self.object.Append(each) 58 60 59 if self.object.GetCount() > 0: 61 self.object.SetSelection(self.wxEval('selection')) 60 selection = self.wxEval('selection') 61 if selection >= 0: 62 self.object.SetSelection(selection) 62 63 63 64 self.wxFinalStandardOptions() trunk/RBSkinning/RBSkinning/wxPythonSkin/wxSkinObject.py
r606 r614 24 24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 25 26 from wxPython import wx 27 from RBFoundation.XMLUtilityFunctions import ColorStringToRGB 26 28 from RBSkinning.SkinObject import SkinObject 27 from wxPython import wx28 import re29 29 30 30 try: … … 36 36 #~ Constants / Variables / Etc. 37 37 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 39 reColorHex = re.compile('(?:0x|#)([0-9a-fA-F]{6})')40 38 41 39 # vv NOTE: DEBUG vvvvvvvvvvvvv … … 213 211 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 214 212 215 from wxPython.lib import colourdb as _colourdb 216 _NamedColours = {} 217 for each in _colourdb.getColourList(): _NamedColours[each] = 1 213 def _GetNamedColors(): 214 global _NamedColours 215 try: 216 return _NamedColours 217 except NameError: 218 from wxPython.lib import colourdb as _colourdb 219 _NamedColours = {} 220 for each in _colourdb.getColourList(): 221 _NamedColours[each] = 1 222 return _NamedColours 218 223 219 224 def wxColorEval(strColor): 220 lst = reColorHex.split(strColor)[1:-1] 221 if lst: 222 color = int(lst[0], 16) 223 return wx.wxColor( (color >> 16) & 0xff, (color >> 8) & 0xff, (color) & 0xff) 224 elif strColor in _NamedColours: 225 try: rgbcolor = ColorStringToRGB(strColor) 226 except ValueError: pass # couldn't read format 227 else: 228 if rgbcolor is not None: 229 return wx.wxColor(*rgbcolor) 230 231 if strColor in _GetNamedColors(): 225 232 return wx.wxNamedColor(strColor) 226 233 else: 227 234 return wx.wxColor(*eval(strColor, {}, {})) 235 trunk/RBSkinning/plans/todo.txt
r608 r614 1 Modularize skin namespaces 1 2 wx namespace conversion? 2 3 … … 30 31 31 32 New Functionality: 32 [.] Customizeability:33 [X] xmlPython34 [X] Components35 [.] Templates36 [X] Custom Skins37 38 33 [.] Drag & Locking stuff: 39 34 [.] Should be able to turn it off or add a modifier key
