comparison orpg/gametree/nodehandlers/containers.py @ 183:0d9b746b5751 beta

Traipse Beta 'OpenRPG' {100115-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Beta) New Features: Added Bookmarks Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager New TrueDebug Class in orpg_log (See documentation for usage) Portable Mercurial Tip of the Day added, from Core and community New Reference Syntax added for custom PC sheets New Child Reference for gametree New Parent Reference for gametree New Gametree Recursion method, mapping, context sensitivity, and effeciency.. New Features node with bonus nodes and Node Referencing help added Dieroller structure from Core New DieRoller portability for odd Dice Added 7th Sea die roller; ie [7k3] = [7d10.takeHighest(3).open(10)] New 'Mythos' System die roller added Added new vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)]. Included for Mythos roller also New Warhammer FRPG Die Roller (Special thanks to Puu-san for the support) New EZ_Tree Reference system. Push a button, Traipse the tree, get a reference (Beta!) Fixes: Fix to Text based Server Fix to Remote Admin Commands Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Fix to Map from gametree not showing to all clients Fix to gametree about menus Fix to Password Manager check on startup Fix to PC Sheets from tool nodes. They now use the tabber_panel Fix to Whiteboard ID to prevent random line or text deleting. Fixes to Server, Remote Server, and Server GUI Fix to Update Manager; cleaner clode for saved repositories Fixes made to Settings Panel and now reactive settings when Ok is pressed Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of a Splice Fix to Use panel of Forms and Tabbers. Now longer enters design mode Fix made Image Fetching. New fetching image and new failed image Modified ID's to prevent non updated clients from ruining the fix. default_manifest.xml renamed to default_upmana.xml
author sirebral
date Fri, 15 Jan 2010 23:01:42 -0600
parents 3b6888bb53b5
children dcae32e219f1
comparison
equal deleted inserted replaced
172:8834425a85b0 183:0d9b746b5751
103 container_handler.__init__(self, xml, tree_node) 103 container_handler.__init__(self, xml, tree_node)
104 104
105 def load_children(self): 105 def load_children(self):
106 self.atts = None 106 self.atts = None
107 for child_xml in self.xml: 107 for child_xml in self.xml:
108 if child_xml.get == "group_atts": #having the group attributes as a child is bad! 108 if child_xml.tag == "group_atts": #having the group attributes as a child is bad!
109 self.xml.remove(child_xml) 109 self.xml.remove(child_xml)
110 elif child_xml: self.tree.load_xml(child_xml, self.mytree_node) 110 elif child_xml: self.tree.load_xml(child_xml, self.mytree_node)
111 if not self.xml.get('cols'): self.xml.set('cols', '1') 111 if not self.xml.get('cols'): self.xml.set('cols', '1')
112 if not self.xml.get('border'): self.xml.set('border', '1') 112 if not self.xml.get('border'): self.xml.set('border', '1')
113 113
198 """ <nodehandler name='?' module='containers' class='tabber_handler' />""" 198 """ <nodehandler name='?' module='containers' class='tabber_handler' />"""
199 199
200 def __init__(self, xml, tree_node): 200 def __init__(self, xml, tree_node):
201 container_handler.__init__(self, xml, tree_node) 201 container_handler.__init__(self, xml, tree_node)
202 202
203 def get_design_panel(self,parent): 203 def get_design_panel(self, parent):
204 return tabbed_edit_panel(parent, self)
205
206 def get_use_panel(self,parent):
207 return tabbed_panel(parent, self, 1) 204 return tabbed_panel(parent, self, 1)
205
206 def get_use_panel(self, parent):
207 return tabbed_panel(parent, self, 0)
208 208
209 209
210 class tabbed_panel(orpgTabberWnd): 210 class tabbed_panel(orpgTabberWnd):
211 def __init__(self, parent, handler, mode): 211 def __init__(self, parent, handler, mode):
212 orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON) 212 orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON)
213 self.handler = handler 213 self.handler = handler
214 self.parent = parent 214 self.parent = parent
215 if mode == 1: self.AddPage(tabbed_edit_panel(parent, handler), 'Tabber', False)
215 handler.tree.traverse(handler.mytree_node, self.pick_panel, mode, False) 216 handler.tree.traverse(handler.mytree_node, self.pick_panel, mode, False)
216 parent.SetSize(self.GetBestSize()) 217 parent.SetSize(self.GetBestSize())
217 218
218 def pick_panel(self, treenode, mode): 219 def pick_panel(self, treenode, mode):
219 node = self.handler.tree.GetPyData(treenode) 220 node = self.handler.tree.GetPyData(treenode)
221
220 if mode == 1: panel = node.get_design_panel(self) 222 if mode == 1: panel = node.get_design_panel(self)
221 else: panel = node.get_use_panel(self) 223 else: panel = node.get_use_panel(self)
222 name = node.xml.get("name") 224 name = node.xml.get("name")
223 if name == None: ## Fixes broken 3e Inventory child 225 if name == None: ## Fixes broken 3e Inventory child
224 if node.xml.tag == 'inventory': 226 if node.xml.tag == 'inventory':
226 name = "Inventory" 228 name = "Inventory"
227 logger.info('A corrective action was take to a 3e PC Sheet', True) 229 logger.info('A corrective action was take to a 3e PC Sheet', True)
228 component.get('frame').TraipseSuiteWarn('item') 230 component.get('frame').TraipseSuiteWarn('item')
229 if panel: self.AddPage(panel, name, False) 231 if panel: self.AddPage(panel, name, False)
230 232
231 class tabbed_edit_panel(orpgTabberWnd): 233 class tabbed_edit_panel(wx.Panel):
232 def __init__(self, parent, handler): 234 def __init__(self, parent, handler):
233 orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON) 235 wx.Panel.__init__(self, parent, -1, style=FNB.FNB_NO_X_BUTTON)
234 self.handler = handler 236 self.handler = handler
235 self.parent = parent 237 self.parent = parent
236 main_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Tabber"), wx.VERTICAL) 238 main_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Tabber"), wx.VERTICAL)
237 self.title = wx.TextCtrl(self, 1, handler.xml.get('name')) 239 self.title = wx.TextCtrl(self, 1, handler.xml.get('name'))
238 main_sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND) 240 main_sizer.Add(wx.StaticText(self, -1, "Title:"), 0, wx.EXPAND)
239 main_sizer.Add(self.title, 0, wx.EXPAND) 241 main_sizer.Add(self.title, 0, wx.EXPAND)
240 self.SetSizer(main_sizer) 242 self.SetSizer(main_sizer)
241 self.SetAutoLayout(True) 243 self.SetAutoLayout(True)
242 self.Fit() 244 self.Fit()
245 parent.SetSize(self.GetBestSize())
243 self.Bind(wx.EVT_TEXT, self.on_text, id=1) 246 self.Bind(wx.EVT_TEXT, self.on_text, id=1)
247
244 248
245 def on_text(self,evt): 249 def on_text(self,evt):
246 txt = self.title.GetValue() 250 txt = self.title.GetValue()
247 if txt != "": 251 if txt != "":
248 self.handler.xml.set('name',txt) 252 self.handler.xml.set('name',txt)
260 container_handler.__init__(self,xml,tree_node) 264 container_handler.__init__(self,xml,tree_node)
261 265
262 def load_children(self): 266 def load_children(self):
263 self.atts = None 267 self.atts = None
264 for child_xml in self.xml: 268 for child_xml in self.xml:
265 if child_xml.tag == "splitter_atts": self.xml.remove(child_xml) #Same here! 269 if child_xml.tag == "splitter_atts": print 'splitter_atts exist!'; self.xml.remove(child_xml) #Same here!
266 elif child_xml: self.tree.load_xml(child_xml,self.mytree_node) 270 elif child_xml: self.tree.load_xml(child_xml,self.mytree_node)
267 if not self.xml.get('horizontal'): self.xml.set('horizontal', '0') 271 if not self.xml.get('horizontal'): self.xml.set('horizontal', '0')
268 272
269 def get_design_panel(self,parent): 273 def get_design_panel(self,parent):
270 return self.build_splitter_wnd(parent, 1) 274 return self.build_splitter_wnd(parent, 1)
271 275
272 def get_use_panel(self,parent): 276 def get_use_panel(self,parent):
273 return self.build_splitter_wnd(parent, 2) 277 return self.build_splitter_wnd(parent, 0)
274 278
275 def on_drop(self,evt): 279 def on_drop(self,evt):
276 drag_obj = self.tree.drag_obj 280 drag_obj = self.tree.drag_obj
277 container_handler.on_drop(self,evt) 281 container_handler.on_drop(self,evt)
278 282