--- a/Viewer.py Wed Sep 05 12:38:41 2012 +0200
+++ b/Viewer.py Wed Sep 05 12:39:50 2012 +0200
@@ -207,6 +207,7 @@
self.ParentWindow = parent
def OnDropText(self, x, y, data):
+ self.ParentWindow.Select()
tagname = self.ParentWindow.GetTagName()
pou_name, pou_type = self.ParentWindow.Controler.GetEditedElementType(tagname, self.ParentWindow.Debug)
x, y = self.ParentWindow.CalcUnscrolledPosition(x, y)
@@ -272,7 +273,7 @@
if pou_type == "program":
location = values[0]
if not location.startswith("%"):
- dialog = wx.SingleChoiceDialog(self.ParentWindow,
+ dialog = wx.SingleChoiceDialog(self.ParentWindow.ParentWindow,
_("Select a variable class:"), _("Variable class"),
["Input", "Output", "Memory"],
wx.DEFAULT_DIALOG_STYLE|wx.OK|wx.CANCEL)
@@ -630,9 +631,12 @@
self.Editor.Bind(wx.EVT_MOUSEWHEEL, self.OnMouseWheelWindow)
self.Editor.Bind(wx.EVT_SIZE, self.OnMoveWindow)
self.Editor.Bind(wx.EVT_MOUSE_EVENTS, self.OnViewerMouseEvent)
-
+
+ # Destructor
def __del__(self):
DebugViewer.__del__(self)
+ self.Flush()
+ self.ResetView()
self.RefreshHighlightsTimer.Stop()
def SetCurrentCursor(self, cursor):
@@ -671,13 +675,7 @@
def GetNewId(self):
self.current_id += 1
return self.current_id
-
- # Destructor
- def __del__(self):
- DebugViewer.__del__(self)
- self.Flush()
- self.ResetView()
-
+
def SetScale(self, scale_number, refresh=True, mouse_event=None):
new_scale = max(0, min(scale_number, len(ZOOM_FACTORS) - 1))
if self.CurrentScale != new_scale: