- undo/redo fix for nonchecked items

- global modified state set as soon as possible
- "option" property renamed to "proportion"


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky 2007-03-15 19:17:27 +00:00
parent 733f486aac
commit a023b456b4
2 changed files with 11 additions and 3 deletions

View File

@ -160,6 +160,7 @@ class Panel(wx.Notebook):
# Register undo object when modifying first time
if not self.modified and value:
g.undoMan.RegisterUndo(UndoEdit())
g.frame.SetModified()
self.modified = value
def Apply(self):
@ -258,7 +259,8 @@ class ParamPage(wx.Panel):
for k,v,e in state[1]:
self.controls[k].SetValue(v)
self.controls[k].Enable(e)
if e: self.controls[k].modified = True
# Set all states to modified
if e and k in self.xxx.params: self.controls[k].modified = True
if self.controlName:
self.controlName.SetValue(state[2])
@ -290,8 +292,9 @@ class PropPage(ParamPage):
label = wx.StaticText(self, paramIDs[param], param + ':',
size = (LABEL_WIDTH,-1), name = param)
else:
# Notebook has one very loooooong parameter
# Rename some parameters
if param == 'usenotebooksizer': sParam = 'usesizer:'
elif param == 'option': sParam = 'proportion'
else: sParam = param + ':'
label = wx.CheckBox(self, paramIDs[param], sParam,
size = (LABEL_WIDTH,-1), name = param)

View File

@ -479,10 +479,14 @@ class Frame(wx.Frame):
# Extra check to not mess with idle updating
if undoMan.CanUndo():
undoMan.Undo()
g.panel.SetModified(False)
if not undoMan.CanUndo():
self.SetModified(False)
def OnRedo(self, evt):
if undoMan.CanRedo():
undoMan.Redo()
self.SetModified(True)
def OnCopy(self, evt):
selected = tree.selection
@ -1635,7 +1639,8 @@ Please upgrade wxWidgets to %d.%d.%d or higher.''' % MinWxVersion)
cwd = os.getcwd()
try:
for dir in plugins.split(':'):
if os.path.isdir(dir):
if os.path.isdir(dir) and \
os.path.isfile(os.path.join(dir, '__init__.py')):
# Normalize
dir = os.path.abspath(os.path.normpath(dir))
sys.path = sys_path + [os.path.dirname(dir)]