editing comments by editing tree label

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky
2007-03-11 23:37:08 +00:00
parent 9812391356
commit fe295b0d3e
5 changed files with 40 additions and 8 deletions

View File

@@ -309,6 +309,8 @@ class PropPage(ParamPage):
control.Enable(present)
# Comment has only one parameter
if isinstance(xxx, xxxComment):
# Bind char event to check Enter key
control.text.Bind(wx.EVT_CHAR, self.OnEnter)
sizer.Add(control, 0, wx.ALIGN_CENTER_VERTICAL | wx.GROW)
else:
sizer.AddMany([ (label, 0, wx.ALIGN_CENTER_VERTICAL),
@@ -317,6 +319,7 @@ class PropPage(ParamPage):
topSizer.Add(sizer, 1, wx.ALL | wx.EXPAND, 3)
self.SetSizer(topSizer)
topSizer.Fit(self)
def SetValues(self, xxx):
self.xxx = xxx
self.origChecks = []
@@ -343,6 +346,13 @@ class PropPage(ParamPage):
self.origChecks.append((param, False))
self.origControls.append((param, '', False))
# This is called only for comment now
def OnEnter(self, evt):
if evt.GetKeyCode() == 13:
g.tree.Apply(self.xxx, g.tree.selection)
else:
evt.Skip()
################################################################################
# Style notebook page
@@ -369,6 +379,7 @@ class StylePage(ParamPage):
self.SetAutoLayout(True)
self.SetSizer(topSizer)
topSizer.Fit(self)
# Set data for a cahced page
def SetValues(self, xxx):
self.xxx = xxx