+ self._notebook.Show(True)
+
+ def PopulateBPList(self):
+ self.breakPointsTab.PopulateBPList()
+
+ def OnSize(self, event):
+ self._notebook.SetSize(self._p2.GetSize())
+
+ def MakeConsoleTab(self, parent, id):
+ panel = wx.Panel(parent, id)
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ self._textCtrl = STCTextEditor.TextCtrl(panel, wx.NewId())
+ sizer.Add(self._textCtrl, 1, wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 2)
+ self._textCtrl.SetViewLineNumbers(False)
+ self._textCtrl.SetReadOnly(True)
+ if wx.Platform == '__WXMSW__':
+ font = "Courier New"
+ else:
+ font = "Courier"
+ self._textCtrl.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = font))
+ self._textCtrl.SetFontColor(wx.BLACK)
+ self._textCtrl.StyleClearAll()
+ panel.SetSizer(sizer)
+ #sizer.Fit(panel)
+
+ return panel
+
+ def ReplaceLastLine(self, command):
+ line = self._interCtrl.GetLineCount() - 1
+ self._interCtrl.GotoLine(line)
+ start = self._interCtrl.GetCurrentPos()
+ self._interCtrl.SetTargetStart(start)
+ end = self._interCtrl.GetLineEndPosition(line)
+ self._interCtrl.SetTargetEnd(end)
+ self._interCtrl.ReplaceTarget(">>> " + command)
+ self._interCtrl.GotoLine(line)
+ self._interCtrl.SetSelectionStart(self._interCtrl.GetLineEndPosition(line))
+
+ def ExecuteCommand(self, command):
+ if not len(self.command_list) or not command == self.command_list[len(self.command_list) -1]:
+ self.command_list.append(command)
+ self.command_index = len(self.command_list) - 1
+ retval = self._ui._callback._debuggerServer.execute_in_frame(self._framesChoiceCtrl.GetStringSelection(), command)
+ self._interCtrl.AddText("\n" + str(retval))
+ self._interCtrl.ScrollToLine(self._interCtrl.GetLineCount())
+ # Refresh the tree view in case this command resulted in changes there. TODO: Need to reopen tree items.
+ self.PopulateTreeFromFrameMessage(self._framesChoiceCtrl.GetStringSelection())
+
+ def MakeInspectConsoleTab(self, parent, id):
+ self.command_list = []
+ self.command_index = 0
+
+ def OnKeyPressed(event):
+ key = event.KeyCode()
+ if key == wx.WXK_DELETE or key == wx.WXK_BACK:
+ if self._interCtrl.GetLine(self._interCtrl.GetCurrentLine()) == ">>> ":
+ return
+ elif key == wx.WXK_RETURN:
+ command = self._interCtrl.GetLine(self._interCtrl.GetCurrentLine())[4:]
+ self.ExecuteCommand(command)
+ self._interCtrl.AddText("\n>>> ")
+ return
+ elif key == wx.WXK_UP:
+ if not len(self.command_list):
+ return
+ self.ReplaceLastLine(self.command_list[self.command_index])
+ if self.command_index == 0:
+ self.command_index = len(self.command_list) - 1
+ else:
+ self.command_index = self.command_index - 1
+ return
+ elif key == wx.WXK_DOWN:
+ if not len(self.command_list):
+ return
+ if self.command_index < len(self.command_list) - 1:
+ self.command_index = self.command_index + 1
+ else:
+ self.command_index = 0
+ self.ReplaceLastLine(self.command_list[self.command_index])
+ return
+ event.Skip()
+
+ try:
+ panel = wx.Panel(parent, id)
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ self._interCtrl = STCTextEditor.TextCtrl(panel, wx.NewId())
+ sizer.Add(self._interCtrl, 1, wx.ALIGN_LEFT|wx.ALL|wx.EXPAND, 2)
+ self._interCtrl.SetViewLineNumbers(False)
+ if wx.Platform == '__WXMSW__':
+ font = "Courier New"
+ else:
+ font = "Courier"
+ self._interCtrl.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = font))
+ self._interCtrl.SetFontColor(wx.BLACK)
+ self._interCtrl.StyleClearAll()
+ wx.EVT_KEY_DOWN(self._interCtrl, OnKeyPressed)
+ self._interCtrl.AddText(">>> ")
+ panel.SetSizer(sizer)
+ except:
+ tp, val, tb = sys.exc_info()
+ traceback.print_exception(tp, val, tb)
+
+ return panel
+
+ def MakeBreakPointsTab(self, parent, id):
+ panel = BreakpointsUI(parent, id, self._ui)
+ return panel