Mercurial > openrpg
changeset 561:1359862ed024
trying to fix MultiTextEntry
author | davidbyron |
---|---|
date | Fri, 09 Apr 2010 00:12:57 -0500 |
parents | 4d0190cfb5a5 |
children | a095896cdd8a |
files | orpg/gametree/nodehandlers/core.py orpg/ui/util/text/_multi.py |
diffstat | 2 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/orpg/gametree/nodehandlers/core.py Thu Apr 08 23:02:18 2010 -0500 +++ b/orpg/gametree/nodehandlers/core.py Fri Apr 09 00:12:57 2010 -0500 @@ -31,7 +31,7 @@ import urllib import wx - +from orpg.ui.util.text import MultiTextEntry from orpg.mapper import map from orpg.orpgCore import open_rpg, ParserContext from orpg.dirpath import dir_struct
--- a/orpg/ui/util/text/_multi.py Thu Apr 08 23:02:18 2010 -0500 +++ b/orpg/ui/util/text/_multi.py Fri Apr 09 00:12:57 2010 -0500 @@ -9,7 +9,7 @@ def __init__(self, parent, opts, caption, pos=wx.DefaultPosition): wx.Dialog.__init__(self, parent, wx.ID_ANY, caption, pos, wx.DefaultSize) - num = len(tlist) + num = len(opts) sizers = {'ctrls': wx.FlexGridSizer(num, 2, 5, 0), 'buttons': wx.BoxSizer(wx.HORIZONTAL)} @@ -20,7 +20,7 @@ add_list.append((wx.StaticText(self, wx.ID_ANY, name + ": "), 0, wx.ALIGN_CENTER_VERTICAL)) ctrls[name] = wx.TextCtrl(self, wx.ID_ANY, value) - add_list.append((ctrls[i], 1, wx.EXPAND)) + add_list.append((ctrls[name], 1, wx.EXPAND)) self.ctrls = ctrls sizers['ctrls'].AddMany(add_list) @@ -30,7 +30,7 @@ sizers['buttons'].Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.EXPAND) width = 300 - w, h = ctrls[0].GetSizeTuple() + w, h = ctrls.values()[0].GetSizeTuple() h = h + 5 height = ((num)*h)+35 self.SetClientSizeWH(width,height) @@ -40,10 +40,16 @@ @debugging def on_ok(self,evt): - for i in range(len(self.ctrls)): - self.vlist[i] = self.ctrls[i].GetValue() self.EndModal(wx.ID_OK) @debugging def get_values(self): - return self.ctrls \ No newline at end of file + return self.ctrls + + @debugging + def __exit__(self, type, value, traceback): + return False + + @debugging + def __enter__(self): + return self