comparison orpg/gametree/nodehandlers/containers.py @ 111:0c936d98f9eb alpha

Traipse Alpha 'OpenRPG' {091008-01} 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: {091006} 00: Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images! 03: Changes made to the map for increased portability. SnowDog has changes planned in Core, though. Added an initial push to the BCG. Not much to see, just shows off how it is re-writing Main code. {091007} 00: New images added to Plugin Control Panel for Auto Start. 01: Attempting to fix Deprecation warning from Main. 02: Second attempt, problem in gsclient with "s. 03: Fail. {091008} 00: Fix to remote admin commands 01: Minor fix to texted based server, works in /System/ folder Some Core changes to gametree to correctly disply Pretty Print, thanks David!
author sirebral
date Thu, 08 Oct 2009 09:10:55 -0500
parents 449a8900f9ac
children 217fb049bd00
comparison
equal deleted inserted replaced
110:910942d07574 111:0c936d98f9eb
52 if hasattr(obj,"map_aware") and obj.map_aware(): 52 if hasattr(obj,"map_aware") and obj.map_aware():
53 obj.on_send_to_map(evt) 53 obj.on_send_to_map(evt)
54 54
55 55
56 def on_send_to_map(self, evt): 56 def on_send_to_map(self, evt):
57 child = self.tree.GetFirstChild(self.mytree_node) 57 self.traverse(self.mytree_node, self.check_map_aware, evt)
58 if child[0].IsOk():
59 self.traverse(child[0], self.check_map_aware, 0, evt)
60 58
61 59
62 def checkChildToMap(self, obj, evt): 60 def checkChildToMap(self, obj, evt):
63 if hasattr(obj,"map_aware") and obj.map_aware(): 61 if hasattr(obj,"map_aware") and obj.map_aware():
64 self.mapcheck = True 62 self.mapcheck = True
65 63
66 def checkToMapMenu(self): 64 def checkToMapMenu(self):
67 self.mapcheck = False 65 self.mapcheck = False
68 child = self.tree.GetFirstChild(self.mytree_node) 66 self.traverse(self.mytree_node, self.checkChildToMap)
69 if child[0].IsOk():
70 self.traverse(child[0], self.checkChildToMap, 0, self.mapcheck)
71 67
72 return self.mapcheck 68 return self.mapcheck
73 69
74 def on_drop(self,evt): 70 def on_drop(self,evt):
75 drag_obj = self.tree.drag_obj 71 drag_obj = self.tree.drag_obj
91 self.html_str = "<table border=\"1\" ><tr><td>" 87 self.html_str = "<table border=\"1\" ><tr><td>"
92 self.html_str += "<b>"+self.master_dom.getAttribute("name") + "</b>" 88 self.html_str += "<b>"+self.master_dom.getAttribute("name") + "</b>"
93 self.html_str += "</td></tr>\n" 89 self.html_str += "</td></tr>\n"
94 self.html_str += "<tr><td>" 90 self.html_str += "<tr><td>"
95 91
96 child = self.tree.GetFirstChild(self.mytree_node) 92 self.traverse(self.mytree_node, self.gen_html, recurse=False)
97 self.traverse(child[0], self.gen_html, 0, None)
98 93
99 self.html_str += "</td></tr></table>" 94 self.html_str += "</td></tr></table>"
100 return self.html_str 95 return self.html_str
101 96
102 def get_size_constraint(self): 97 def get_size_constraint(self):
151 146
152 self.cols = int(cols) 147 self.cols = int(cols)
153 self.i = 0 148 self.i = 0
154 self.tdatas = {} 149 self.tdatas = {}
155 150
156 child = self.tree.GetFirstChild(self.mytree_node) 151 self.traverse(self.mytree_node, self.gen_html, recurse=False)
157 if child[0].IsOk():
158 self.traverse(child[0], self.gen_html, 0, None)
159 152
160 for td in self.tdatas: 153 for td in self.tdatas:
161 self.html_str += "<td valign=\"top\" >" + self.tdatas[td] + "</td>\n"; 154 self.html_str += "<td valign=\"top\" >" + self.tdatas[td] + "</td>\n";
162 self.html_str += "</tr></table>" 155 self.html_str += "</tr></table>"
163 return self.html_str 156 return self.html_str
237 class tabbed_panel(orpgTabberWnd): 230 class tabbed_panel(orpgTabberWnd):
238 def __init__(self, parent, handler, mode): 231 def __init__(self, parent, handler, mode):
239 orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON) 232 orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON)
240 self.handler = handler 233 self.handler = handler
241 self.parent = parent 234 self.parent = parent
242 tree = self.handler.tree 235 handler.traverse(handler.mytree_node, self.pick_panel, mode, False)
243 child = tree.GetFirstChild(handler.mytree_node)
244 if child[0].IsOk():
245 handler.traverse(child[0], self.pick_panel, 0, mode, False)
246 236
247 parent.SetSize(self.GetBestSize()) 237 parent.SetSize(self.GetBestSize())
248 238
249 def pick_panel(self, obj, mode): 239 def pick_panel(self, obj, mode):
250 if mode == 1: 240 if mode == 1:
251 panel = obj.get_design_panel(self) 241 panel = obj.get_design_panel(self)
252 else: 242 else:
253 panel = obj.get_use_panel(self) 243 panel = obj.get_use_panel(self)
254 244
255 name = obj.master_dom.getAttribute("name") 245 name = obj.master_dom.getAttribute("name");print 'here '+name
256 246
257 if panel: 247 if panel:
258 self.AddPage(panel, name, False) 248 self.AddPage(panel, name, False)
259 249
260 ################################# 250 #################################
303 self.splitter.SetOrientation(wx.HORIZONTAL) 293 self.splitter.SetOrientation(wx.HORIZONTAL)
304 294
305 self.bestSizex = -1 295 self.bestSizex = -1
306 self.bestSizey = -1 296 self.bestSizey = -1
307 297
308 cookie = 0 298 self.traverse(self.mytree_node, self.doSplit, mode, False)
309 (child, cookie) = self.tree.GetFirstChild(self.mytree_node)
310 if child.IsOk():
311 self.traverse(child, self.doSplit, 0, mode, False)
312 299
313 self.pane.sizer.Add(self.splitter, 1, wx.EXPAND) 300 self.pane.sizer.Add(self.splitter, 1, wx.EXPAND)
314 301
315 302
316 if mode != 1: 303 if mode != 1: