Mercurial > traipse_dev
comparison orpg/gametree/nodehandlers/forms.py @ 71:449a8900f9ac ornery-dev
Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
author | sirebral |
---|---|
date | Thu, 20 Aug 2009 03:00:39 -0500 |
parents | c54768cffbd4 |
children | f38df4bf9715 |
comparison
equal
deleted
inserted
replaced
70:52a5fa913008 | 71:449a8900f9ac |
---|---|
27 # | 27 # |
28 | 28 |
29 __version__ = "$Id: forms.py,v 1.53 2007/04/21 23:00:51 digitalxero Exp $" | 29 __version__ = "$Id: forms.py,v 1.53 2007/04/21 23:00:51 digitalxero Exp $" |
30 | 30 |
31 from containers import * | 31 from containers import * |
32 import wx.lib.scrolledpanel | 32 from wx.lib.scrolledpanel import ScrolledPanel |
33 | 33 |
34 def bool2int(b): | 34 def bool2int(b): |
35 #in wxPython 2.5+, evt.Checked() returns True or False instead of 1.0 or 0. | 35 #in wxPython 2.5+, evt.Checked() returns True or False instead of 1.0 or 0. |
36 #by running the results of that through this function, we convert it. | 36 #by running the results of that through this function, we convert it. |
37 #if it was an int already, nothing changes. The difference between 1.0 | 37 #if it was an int already, nothing changes. The difference between 1.0 |
79 def on_drop(self,evt): | 79 def on_drop(self,evt): |
80 # make sure its a contorl node | 80 # make sure its a contorl node |
81 container_handler.on_drop(self,evt) | 81 container_handler.on_drop(self,evt) |
82 | 82 |
83 | 83 |
84 class form_panel(wx.lib.scrolledpanel.ScrolledPanel): | 84 class form_panel(ScrolledPanel): |
85 def __init__(self, parent, handler): | 85 def __init__(self, parent, handler): |
86 wx.lib.scrolledpanel.ScrolledPanel.__init__(self, parent, wx.ID_ANY, style=wx.NO_BORDER|wx.VSCROLL|wx.HSCROLL) | 86 ScrolledPanel.__init__(self, parent, wx.ID_ANY, style=wx.NO_BORDER|wx.VSCROLL|wx.HSCROLL) |
87 self.height = int(handler.atts.getAttribute("height")) | 87 self.height = int(handler.atts.getAttribute("height")) |
88 self.width = int(handler.atts.getAttribute("width")) | 88 self.width = int(handler.atts.getAttribute("width")) |
89 | 89 |
90 | 90 |
91 self.SetSize((0,0)) | 91 self.SetSize((0,0)) |
110 (x, y) = self.GetSize() | 110 (x, y) = self.GetSize() |
111 (nx, ny) = xy | 111 (nx, ny) = xy |
112 if x < nx: | 112 if x < nx: |
113 x = nx+10 | 113 x = nx+10 |
114 y += ny+11 | 114 y += ny+11 |
115 wx.lib.scrolledpanel.ScrolledPanel.SetSize(self, (x, y)) | 115 ScrolledPanel.SetSize(self, (x, y)) |
116 | 116 |
117 | 117 |
118 def create_child_wnd(self, obj, evt): | 118 def create_child_wnd(self, obj, evt): |
119 panel = obj.get_use_panel(self) | 119 panel = obj.get_use_panel(self) |
120 size = obj.get_size_constraint() | 120 size = obj.get_size_constraint() |