more backports
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -70,7 +70,7 @@ class Panel(wx.Notebook):
|
|||||||
if g.conf.panic:
|
if g.conf.panic:
|
||||||
topSizer.Add(sizer, 1, wx.EXPAND)
|
topSizer.Add(sizer, 1, wx.EXPAND)
|
||||||
else:
|
else:
|
||||||
topSizer.Add(sizer, 0, wx.ALL, 5)
|
topSizer.Add(sizer, 1, wx.ALL, 5)
|
||||||
return sizer
|
return sizer
|
||||||
|
|
||||||
def SetData(self, xxx):
|
def SetData(self, xxx):
|
||||||
@@ -281,7 +281,7 @@ class PropPage(ParamPage):
|
|||||||
def __init__(self, parent, label, xxx):
|
def __init__(self, parent, label, xxx):
|
||||||
ParamPage.__init__(self, parent, xxx)
|
ParamPage.__init__(self, parent, xxx)
|
||||||
self.box = wx.StaticBox(self, -1, label)
|
self.box = wx.StaticBox(self, -1, label)
|
||||||
self.box.SetFont(g.labelFont())
|
#self.box.SetFont(g.labelFont())
|
||||||
topSizer = wx.StaticBoxSizer(self.box, wx.VERTICAL)
|
topSizer = wx.StaticBoxSizer(self.box, wx.VERTICAL)
|
||||||
sizer = wx.FlexGridSizer(len(xxx.allParams), 2, 1, 5)
|
sizer = wx.FlexGridSizer(len(xxx.allParams), 2, 1, 5)
|
||||||
sizer.AddGrowableCol(1)
|
sizer.AddGrowableCol(1)
|
||||||
@@ -370,7 +370,7 @@ class StylePage(ParamPage):
|
|||||||
def __init__(self, parent, label, xxx):
|
def __init__(self, parent, label, xxx):
|
||||||
ParamPage.__init__(self, parent, xxx)
|
ParamPage.__init__(self, parent, xxx)
|
||||||
box = wx.StaticBox(self, -1, label)
|
box = wx.StaticBox(self, -1, label)
|
||||||
box.SetFont(g.labelFont())
|
#box.SetFont(g.labelFont())
|
||||||
topSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
|
topSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
|
||||||
sizer = wx.FlexGridSizer(len(xxx.styles), 2, 1, 5)
|
sizer = wx.FlexGridSizer(len(xxx.styles), 2, 1, 5)
|
||||||
sizer.AddGrowableCol(1)
|
sizer.AddGrowableCol(1)
|
||||||
|
@@ -263,7 +263,7 @@ class ParamFont(PPanel):
|
|||||||
PPanel.OnChange(self, evt)
|
PPanel.OnChange(self, evt)
|
||||||
self.textModified = True
|
self.textModified = True
|
||||||
def _defaultValue(self):
|
def _defaultValue(self):
|
||||||
return [`g._sysFont.GetPointSize()`, 'default', 'normal', 'normal', '0', '', '']
|
return [`g.sysFont().GetPointSize()`, 'default', 'normal', 'normal', '0', '', '']
|
||||||
def GetValue(self):
|
def GetValue(self):
|
||||||
if self.textModified: # text has newer value
|
if self.textModified: # text has newer value
|
||||||
try:
|
try:
|
||||||
@@ -287,7 +287,7 @@ class ParamFont(PPanel):
|
|||||||
self.value = self._defaultValue()
|
self.value = self._defaultValue()
|
||||||
# Make initial font
|
# Make initial font
|
||||||
# Default values
|
# Default values
|
||||||
size = g._sysFont.GetPointSize()
|
size = g.sysFont().GetPointSize()
|
||||||
family = wx.DEFAULT
|
family = wx.DEFAULT
|
||||||
style = weight = wx.NORMAL
|
style = weight = wx.NORMAL
|
||||||
underlined = 0
|
underlined = 0
|
||||||
|
@@ -56,7 +56,6 @@ class Tools(wx.Panel):
|
|||||||
(ID_NEW.STATIC_TEXT, images.getToolStaticTextBitmap()),
|
(ID_NEW.STATIC_TEXT, images.getToolStaticTextBitmap()),
|
||||||
(ID_NEW.STATIC_BITMAP, images.getToolStaticBitmapBitmap()),
|
(ID_NEW.STATIC_BITMAP, images.getToolStaticBitmapBitmap()),
|
||||||
(ID_NEW.STATIC_LINE, images.getToolStaticLineBitmap()),
|
(ID_NEW.STATIC_LINE, images.getToolStaticLineBitmap()),
|
||||||
|
|
||||||
(ID_NEW.BUTTON, images.getToolButtonBitmap()),
|
(ID_NEW.BUTTON, images.getToolButtonBitmap()),
|
||||||
(ID_NEW.BITMAP_BUTTON, images.getToolBitmapButtonBitmap()),
|
(ID_NEW.BITMAP_BUTTON, images.getToolBitmapButtonBitmap()),
|
||||||
(ID_NEW.STATIC_BOX, images.getToolStaticBoxBitmap()),
|
(ID_NEW.STATIC_BOX, images.getToolStaticBoxBitmap()),
|
||||||
@@ -99,8 +98,9 @@ class Tools(wx.Panel):
|
|||||||
wx.wxEVT_COMMAND_BUTTON_CLICKED, g.frame.OnCreate)
|
wx.wxEVT_COMMAND_BUTTON_CLICKED, g.frame.OnCreate)
|
||||||
wx.EVT_KEY_DOWN(self, self.OnKeyDown)
|
wx.EVT_KEY_DOWN(self, self.OnKeyDown)
|
||||||
wx.EVT_KEY_UP(self, self.OnKeyUp)
|
wx.EVT_KEY_UP(self, self.OnKeyUp)
|
||||||
self.Bind(wx.EVT_LEFT_DOWN, self.OnClickBox)
|
# wxMSW does not generate click events for StaticBox
|
||||||
|
if wx.Platform == '__WXMSW__':
|
||||||
|
self.Bind(wx.EVT_LEFT_DOWN, self.OnClickBox)
|
||||||
self.drag = None
|
self.drag = None
|
||||||
|
|
||||||
def AddButton(self, id, image, text):
|
def AddButton(self, id, image, text):
|
||||||
@@ -127,9 +127,9 @@ class Tools(wx.Panel):
|
|||||||
box.gnum = len(self.groups)
|
box.gnum = len(self.groups)
|
||||||
box.Bind(wx.EVT_LEFT_DOWN, self.OnClickBox)
|
box.Bind(wx.EVT_LEFT_DOWN, self.OnClickBox)
|
||||||
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
|
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
|
||||||
boxSizer.Add((0, 4))
|
boxSizer.Add((0, 0))
|
||||||
self.boxes[id] = box
|
self.boxes[id] = box
|
||||||
self.curSizer = wx.GridSizer(0, 3)
|
self.curSizer = wx.GridSizer(0, 3, 3, 3)
|
||||||
boxSizer.Add(self.curSizer)
|
boxSizer.Add(self.curSizer)
|
||||||
self.sizer.Add(boxSizer, 0, wx.TOP | wx.LEFT | wx.RIGHT | wx.EXPAND, 4)
|
self.sizer.Add(boxSizer, 0, wx.TOP | wx.LEFT | wx.RIGHT | wx.EXPAND, 4)
|
||||||
self.groups.append((box,{}))
|
self.groups.append((box,{}))
|
||||||
@@ -137,7 +137,6 @@ class Tools(wx.Panel):
|
|||||||
# Enable/disable group
|
# Enable/disable group
|
||||||
def EnableGroup(self, gnum, enable = True):
|
def EnableGroup(self, gnum, enable = True):
|
||||||
grp = self.groups[gnum]
|
grp = self.groups[gnum]
|
||||||
#grp[0].Enable(enable)
|
|
||||||
for b in grp[1].values(): b.Enable(enable)
|
for b in grp[1].values(): b.Enable(enable)
|
||||||
|
|
||||||
# Show/hide group
|
# Show/hide group
|
||||||
@@ -161,11 +160,13 @@ class Tools(wx.Panel):
|
|||||||
if wx.Platform == '__WXMSW__':
|
if wx.Platform == '__WXMSW__':
|
||||||
box = None
|
box = None
|
||||||
for id,b in self.boxes.items():
|
for id,b in self.boxes.items():
|
||||||
# Detect click on label
|
# How to detect a click on a label?
|
||||||
if b.GetRect().Inside(evt.GetPosition()):
|
if b.GetRect().Inside(evt.GetPosition()):
|
||||||
box = b
|
box = b
|
||||||
break
|
break
|
||||||
if not box: return
|
if not box:
|
||||||
|
evt.Skip()
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
box = self.boxes[evt.GetId()]
|
box = self.boxes[evt.GetId()]
|
||||||
# Collapse/restore static box, change label
|
# Collapse/restore static box, change label
|
||||||
@@ -363,3 +364,4 @@ class Tools(wx.Panel):
|
|||||||
self.EnableGroupItem(GROUP_MENUS, ID_NEW.MENU_BAR)
|
self.EnableGroupItem(GROUP_MENUS, ID_NEW.MENU_BAR)
|
||||||
# Save state
|
# Save state
|
||||||
self.state = state
|
self.state = state
|
||||||
|
self.Refresh()
|
||||||
|
@@ -792,7 +792,7 @@ class XML_Tree(wx.TreeCtrl):
|
|||||||
self.selection = None
|
self.selection = None
|
||||||
g.tools.UpdateUI()
|
g.tools.UpdateUI()
|
||||||
wx.TreeCtrl.UnselectAll(self)
|
wx.TreeCtrl.UnselectAll(self)
|
||||||
wx.Yield()
|
#wx.Yield()
|
||||||
|
|
||||||
def ChangeSelection(self, item):
|
def ChangeSelection(self, item):
|
||||||
# Apply changes
|
# Apply changes
|
||||||
@@ -1109,8 +1109,9 @@ class XML_Tree(wx.TreeCtrl):
|
|||||||
n = 0 # index of sibling
|
n = 0 # index of sibling
|
||||||
prev = self.GetPrevSibling(item)
|
prev = self.GetPrevSibling(item)
|
||||||
while prev.IsOk():
|
while prev.IsOk():
|
||||||
# MenuBar is not a child
|
# MenuBar and sizers are not real children (who else?)
|
||||||
if not isinstance(self.GetPyData(prev), xxxMenuBar):
|
if not isinstance(self.GetPyData(prev), xxxMenuBar) and not \
|
||||||
|
isinstance(self.GetPyData(prev), xxxSizer):
|
||||||
n += 1
|
n += 1
|
||||||
prev = self.GetPrevSibling(prev)
|
prev = self.GetPrevSibling(prev)
|
||||||
return n
|
return n
|
||||||
|
@@ -210,6 +210,10 @@ class UndoMove:
|
|||||||
|
|
||||||
selected = g.tree.InsertNode(self.oldParent, parent, elem, nextItem)
|
selected = g.tree.InsertNode(self.oldParent, parent, elem, nextItem)
|
||||||
g.tree.EnsureVisible(selected)
|
g.tree.EnsureVisible(selected)
|
||||||
|
# Highlight is outdated
|
||||||
|
if g.testWin and g.testWin.highLight:
|
||||||
|
g.testWin.highLight.Remove()
|
||||||
|
g.tree.needUpdate = True
|
||||||
g.tree.SelectItem(selected)
|
g.tree.SelectItem(selected)
|
||||||
def redo(self):
|
def redo(self):
|
||||||
item = g.tree.GetFirstChild(self.oldParent)[0]
|
item = g.tree.GetFirstChild(self.oldParent)[0]
|
||||||
@@ -248,6 +252,10 @@ class UndoMove:
|
|||||||
for i in range(self.newIndex): nextItem = g.tree.GetNextSibling(nextItem)
|
for i in range(self.newIndex): nextItem = g.tree.GetNextSibling(nextItem)
|
||||||
selected = g.tree.InsertNode(self.newParent, parent, elem, nextItem)
|
selected = g.tree.InsertNode(self.newParent, parent, elem, nextItem)
|
||||||
g.tree.EnsureVisible(selected)
|
g.tree.EnsureVisible(selected)
|
||||||
|
# Highlight is outdated
|
||||||
|
if g.testWin and g.testWin.highLight:
|
||||||
|
g.testWin.highLight.Remove()
|
||||||
|
g.tree.needUpdate = True
|
||||||
g.tree.SelectItem(selected)
|
g.tree.SelectItem(selected)
|
||||||
|
|
||||||
class UndoEdit:
|
class UndoEdit:
|
||||||
|
@@ -92,14 +92,29 @@ class Locator(wx.EvtHandler):
|
|||||||
def ProcessEvent(self, evt):
|
def ProcessEvent(self, evt):
|
||||||
print evt
|
print evt
|
||||||
|
|
||||||
|
class TaskBarIcon(wx.TaskBarIcon):
|
||||||
|
def __init__(self, frame):
|
||||||
|
wx.TaskBarIcon.__init__(self)
|
||||||
|
self.frame = frame
|
||||||
|
# Set the image
|
||||||
|
self.SetIcon(images.getIconIcon(), "XRCed")
|
||||||
|
|
||||||
class Frame(wx.Frame):
|
class Frame(wx.Frame):
|
||||||
def __init__(self, pos, size):
|
def __init__(self, pos, size):
|
||||||
wx.Frame.__init__(self, None, -1, '', pos, size)
|
pre = wx.PreFrame()
|
||||||
|
# pre.SetExtraStyle(wx.FRAME_EX_METAL)
|
||||||
|
pre.Create(None, -1, '', pos, size)
|
||||||
|
self.PostCreate(pre)
|
||||||
|
#wx.Frame.__init__(self, None, -1, '', pos, size)
|
||||||
global frame
|
global frame
|
||||||
frame = g.frame = self
|
frame = g.frame = self
|
||||||
bar = self.CreateStatusBar(2)
|
bar = self.CreateStatusBar(2)
|
||||||
bar.SetStatusWidths([-1, 40])
|
bar.SetStatusWidths([-1, 40])
|
||||||
self.SetIcon(images.getIconIcon())
|
self.SetIcon(images.getIconIcon())
|
||||||
|
try:
|
||||||
|
self.tbicon = TaskBarIcon(self)
|
||||||
|
except:
|
||||||
|
self.tbicon = None
|
||||||
|
|
||||||
# Idle flag
|
# Idle flag
|
||||||
self.inIdle = False
|
self.inIdle = False
|
||||||
@@ -156,7 +171,6 @@ class Frame(wx.Frame):
|
|||||||
self.ID_TOOL_PASTE = wx.NewId()
|
self.ID_TOOL_PASTE = wx.NewId()
|
||||||
menu.Append(self.ID_LOCATE, '&Locate\tCtrl-L', 'Locate control in test window and select it')
|
menu.Append(self.ID_LOCATE, '&Locate\tCtrl-L', 'Locate control in test window and select it')
|
||||||
menuBar.Append(menu, '&Edit')
|
menuBar.Append(menu, '&Edit')
|
||||||
|
|
||||||
menu = wx.Menu()
|
menu = wx.Menu()
|
||||||
self.ID_EMBED_PANEL = wx.NewId()
|
self.ID_EMBED_PANEL = wx.NewId()
|
||||||
menu.Append(self.ID_EMBED_PANEL, '&Embed Panel',
|
menu.Append(self.ID_EMBED_PANEL, '&Embed Panel',
|
||||||
@@ -204,31 +218,35 @@ class Frame(wx.Frame):
|
|||||||
|
|
||||||
# Create toolbar
|
# Create toolbar
|
||||||
tb = self.CreateToolBar(wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT)
|
tb = self.CreateToolBar(wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT)
|
||||||
tb.SetToolBitmapSize((24,24))
|
|
||||||
new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR)
|
|
||||||
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR)
|
|
||||||
save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
|
|
||||||
undo_bmp = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR)
|
|
||||||
redo_bmp = wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR)
|
|
||||||
cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR)
|
|
||||||
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)
|
|
||||||
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR)
|
|
||||||
|
|
||||||
tb.AddSimpleTool(wx.ID_NEW, new_bmp, 'New', 'New file')
|
# Hide some icons on Mac to reduce the toolbar size,
|
||||||
tb.AddSimpleTool(wx.ID_OPEN, open_bmp, 'Open', 'Open file')
|
# and comply more with the Apple LnF, besides
|
||||||
tb.AddSimpleTool(wx.ID_SAVE, save_bmp, 'Save', 'Save file')
|
# wxMac icons are ugly
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
if wx.Platform != '__WXMAC__':
|
||||||
tb.AddSimpleTool(wx.ID_UNDO, undo_bmp, 'Undo', 'Undo')
|
tb.SetToolBitmapSize((24,24))
|
||||||
tb.AddSimpleTool(wx.ID_REDO, redo_bmp, 'Redo', 'Redo')
|
new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_TOOLBAR)
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR)
|
||||||
tb.AddSimpleTool(wx.ID_CUT, cut_bmp, 'Cut', 'Cut')
|
save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR)
|
||||||
tb.AddSimpleTool(wx.ID_COPY, copy_bmp, 'Copy', 'Copy')
|
undo_bmp = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR)
|
||||||
tb.AddSimpleTool(self.ID_TOOL_PASTE, paste_bmp, 'Paste', 'Paste')
|
redo_bmp = wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR)
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR)
|
||||||
|
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)
|
||||||
|
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR)
|
||||||
|
tb.AddSimpleTool(wx.ID_NEW, new_bmp, 'New', 'New file')
|
||||||
|
tb.AddSimpleTool(wx.ID_OPEN, open_bmp, 'Open', 'Open file')
|
||||||
|
tb.AddSimpleTool(wx.ID_SAVE, save_bmp, 'Save', 'Save file')
|
||||||
|
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
|
tb.AddSimpleTool(wx.ID_UNDO, undo_bmp, 'Undo', 'Undo')
|
||||||
|
tb.AddSimpleTool(wx.ID_REDO, redo_bmp, 'Redo', 'Redo')
|
||||||
|
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
|
tb.AddSimpleTool(wx.ID_CUT, cut_bmp, 'Cut', 'Cut')
|
||||||
|
tb.AddSimpleTool(wx.ID_COPY, copy_bmp, 'Copy', 'Copy')
|
||||||
|
tb.AddSimpleTool(self.ID_TOOL_PASTE, paste_bmp, 'Paste', 'Paste')
|
||||||
|
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
tb.AddSimpleTool(self.ID_TOOL_LOCATE,
|
tb.AddSimpleTool(self.ID_TOOL_LOCATE,
|
||||||
images.getLocateBitmap(), #images.getLocateArmedBitmap(),
|
images.getLocateBitmap(), #images.getLocateArmedBitmap(),
|
||||||
'Locate', 'Locate control in test window and select it', True)
|
'Locate', 'Locate control in test window and select it', True)
|
||||||
tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
# tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL))
|
||||||
tb.AddSimpleTool(self.ID_TEST, images.getTestBitmap(), 'Test', 'Test window')
|
tb.AddSimpleTool(self.ID_TEST, images.getTestBitmap(), 'Test', 'Test window')
|
||||||
tb.AddSimpleTool(self.ID_REFRESH, images.getRefreshBitmap(),
|
tb.AddSimpleTool(self.ID_REFRESH, images.getRefreshBitmap(),
|
||||||
'Refresh', 'Refresh view')
|
'Refresh', 'Refresh view')
|
||||||
@@ -328,9 +346,7 @@ class Frame(wx.Frame):
|
|||||||
(conf.panelWidth, conf.panelHeight))
|
(conf.panelWidth, conf.panelHeight))
|
||||||
self.miniFrame = miniFrame
|
self.miniFrame = miniFrame
|
||||||
sizer2 = wx.BoxSizer()
|
sizer2 = wx.BoxSizer()
|
||||||
miniFrame.SetAutoLayout(True)
|
|
||||||
miniFrame.SetSizer(sizer2)
|
miniFrame.SetSizer(sizer2)
|
||||||
wx.EVT_CLOSE(self.miniFrame, self.OnCloseMiniFrame)
|
|
||||||
# Create panel for parameters
|
# Create panel for parameters
|
||||||
global panel
|
global panel
|
||||||
if conf.embedPanel:
|
if conf.embedPanel:
|
||||||
@@ -342,7 +358,10 @@ class Frame(wx.Frame):
|
|||||||
sizer2.Add(panel, 1, wx.EXPAND)
|
sizer2.Add(panel, 1, wx.EXPAND)
|
||||||
miniFrame.Show(True)
|
miniFrame.Show(True)
|
||||||
splitter.Initialize(tree)
|
splitter.Initialize(tree)
|
||||||
sizer1.Add(splitter, 1, wx.EXPAND)
|
if wx.Platform == '__WXMAC__':
|
||||||
|
sizer1.Add(splitter, 1, wx.EXPAND|wx.RIGHT, 5)
|
||||||
|
else:
|
||||||
|
sizer1.Add(splitter, 1, wx.EXPAND)
|
||||||
sizer.Add(sizer1, 1, wx.EXPAND)
|
sizer.Add(sizer1, 1, wx.EXPAND)
|
||||||
self.SetAutoLayout(True)
|
self.SetAutoLayout(True)
|
||||||
self.SetSizer(sizer)
|
self.SetSizer(sizer)
|
||||||
@@ -762,10 +781,9 @@ class Frame(wx.Frame):
|
|||||||
# Check compatibility
|
# Check compatibility
|
||||||
if not self.ItemsAreCompatible(tree.GetPyData(pparent).treeObject(), tree.GetPyData(selected).treeObject()): return
|
if not self.ItemsAreCompatible(tree.GetPyData(pparent).treeObject(), tree.GetPyData(selected).treeObject()): return
|
||||||
|
|
||||||
# Remove highlight, update testWin
|
|
||||||
if g.testWin and g.testWin.highLight:
|
if g.testWin and g.testWin.highLight:
|
||||||
g.testWin.highLight.Remove()
|
g.testWin.highLight.Remove()
|
||||||
tree.needUpdate = True
|
tree.needUpdate = True
|
||||||
|
|
||||||
# Undo info
|
# Undo info
|
||||||
self.lastOp = 'MOVELEFT'
|
self.lastOp = 'MOVELEFT'
|
||||||
@@ -806,7 +824,6 @@ class Frame(wx.Frame):
|
|||||||
|
|
||||||
selected = tree.InsertNode(pparent, tree.GetPyData(pparent).treeObject(), elem, nextItem)
|
selected = tree.InsertNode(pparent, tree.GetPyData(pparent).treeObject(), elem, nextItem)
|
||||||
newIndex = tree.ItemIndex(selected)
|
newIndex = tree.ItemIndex(selected)
|
||||||
tree.oldItem = None
|
|
||||||
tree.SelectItem(selected)
|
tree.SelectItem(selected)
|
||||||
|
|
||||||
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, pparent, newIndex))
|
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, pparent, newIndex))
|
||||||
@@ -832,7 +849,7 @@ class Frame(wx.Frame):
|
|||||||
# Remove highlight, update testWin
|
# Remove highlight, update testWin
|
||||||
if g.testWin and g.testWin.highLight:
|
if g.testWin and g.testWin.highLight:
|
||||||
g.testWin.highLight.Remove()
|
g.testWin.highLight.Remove()
|
||||||
tree.needUpdate = True
|
tree.needUpdate = True
|
||||||
|
|
||||||
# Undo info
|
# Undo info
|
||||||
self.lastOp = 'MOVERIGHT'
|
self.lastOp = 'MOVERIGHT'
|
||||||
@@ -870,7 +887,6 @@ class Frame(wx.Frame):
|
|||||||
selected = tree.InsertNode(newParent, tree.GetPyData(newParent).treeObject(), elem, wx.TreeItemId())
|
selected = tree.InsertNode(newParent, tree.GetPyData(newParent).treeObject(), elem, wx.TreeItemId())
|
||||||
|
|
||||||
newIndex = tree.ItemIndex(selected)
|
newIndex = tree.ItemIndex(selected)
|
||||||
tree.oldItem = None
|
|
||||||
tree.SelectItem(selected)
|
tree.SelectItem(selected)
|
||||||
|
|
||||||
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, newParent, newIndex))
|
undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, newParent, newIndex))
|
||||||
@@ -1323,8 +1339,11 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
menuId = evt.GetMenuId()
|
menuId = evt.GetMenuId()
|
||||||
if menuId != -1:
|
if menuId != -1:
|
||||||
menu = evt.GetEventObject()
|
menu = evt.GetEventObject()
|
||||||
help = menu.GetHelpString(menuId)
|
try:
|
||||||
self.SetStatusText(help)
|
help = menu.GetHelpString(menuId)
|
||||||
|
self.SetStatusText(help)
|
||||||
|
except:
|
||||||
|
self.SetStatusText('')
|
||||||
else:
|
else:
|
||||||
self.SetStatusText('')
|
self.SetStatusText('')
|
||||||
|
|
||||||
@@ -1345,6 +1364,7 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
def OnIdle(self, evt):
|
def OnIdle(self, evt):
|
||||||
if self.inIdle: return # Recursive call protection
|
if self.inIdle: return # Recursive call protection
|
||||||
self.inIdle = True
|
self.inIdle = True
|
||||||
|
#print 'onidle',tree.needUpdate,tree.pendingHighLight
|
||||||
try:
|
try:
|
||||||
if tree.needUpdate:
|
if tree.needUpdate:
|
||||||
if conf.autoRefresh:
|
if conf.autoRefresh:
|
||||||
@@ -1368,10 +1388,6 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
finally:
|
finally:
|
||||||
self.inIdle = False
|
self.inIdle = False
|
||||||
|
|
||||||
# We don't let close panel window
|
|
||||||
def OnCloseMiniFrame(self, evt):
|
|
||||||
return
|
|
||||||
|
|
||||||
def OnIconize(self, evt):
|
def OnIconize(self, evt):
|
||||||
if evt.Iconized():
|
if evt.Iconized():
|
||||||
conf.x, conf.y = self.GetPosition()
|
conf.x, conf.y = self.GetPosition()
|
||||||
@@ -1381,10 +1397,10 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
else:
|
else:
|
||||||
conf.panelX, conf.panelY = self.miniFrame.GetPosition()
|
conf.panelX, conf.panelY = self.miniFrame.GetPosition()
|
||||||
conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
|
conf.panelWidth, conf.panelHeight = self.miniFrame.GetSize()
|
||||||
self.miniFrame.Iconize()
|
self.miniFrame.Show(False)
|
||||||
else:
|
else:
|
||||||
if not conf.embedPanel:
|
if not conf.embedPanel:
|
||||||
self.miniFrame.Iconize(False)
|
self.miniFrame.Show(True)
|
||||||
evt.Skip()
|
evt.Skip()
|
||||||
|
|
||||||
def OnCloseWindow(self, evt):
|
def OnCloseWindow(self, evt):
|
||||||
@@ -1397,7 +1413,10 @@ Homepage: http://xrced.sourceforge.net\
|
|||||||
panel.RemovePage(1)
|
panel.RemovePage(1)
|
||||||
if not self.IsIconized():
|
if not self.IsIconized():
|
||||||
conf.x, conf.y = self.GetPosition()
|
conf.x, conf.y = self.GetPosition()
|
||||||
conf.width, conf.height = self.GetClientSize()
|
if wx.Platform == '__WXMAC__':
|
||||||
|
conf.width, conf.height = self.GetClientSize()
|
||||||
|
else:
|
||||||
|
conf.width, conf.height = self.GetSize()
|
||||||
if conf.embedPanel:
|
if conf.embedPanel:
|
||||||
conf.sashPos = self.splitter.GetSashPosition()
|
conf.sashPos = self.splitter.GetSashPosition()
|
||||||
else:
|
else:
|
||||||
@@ -1763,7 +1782,9 @@ Please upgrade wxWidgets to %d.%d.%d or higher.''' % MinWxVersion)
|
|||||||
wx.FileSystem.AddHandler(wx.MemoryFSHandler())
|
wx.FileSystem.AddHandler(wx.MemoryFSHandler())
|
||||||
# Create main frame
|
# Create main frame
|
||||||
frame = Frame(pos, size)
|
frame = Frame(pos, size)
|
||||||
frame.SetClientSize(size)
|
# Mac does not set the correct size
|
||||||
|
if wx.Platform == '__WXMAC__':
|
||||||
|
frame.SetClientSize(size)
|
||||||
frame.Show(True)
|
frame.Show(True)
|
||||||
|
|
||||||
# Load plugins
|
# Load plugins
|
||||||
|
Reference in New Issue
Block a user