--- a/controls/DebugVariablePanel.py Fri Jun 15 18:03:25 2012 +0200
+++ b/controls/DebugVariablePanel.py Mon Jun 25 20:03:53 2012 +0200
@@ -23,9 +23,11 @@
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import wx
+import wx.lib.buttons
from graphics import DebugDataConsumer, DebugViewer
from controls import CustomGrid, CustomTable
+from utils.BitmapLibrary import GetBitmap
def GetDebugVariablesTableColnames():
_ = lambda x : x
@@ -159,7 +161,7 @@
class DebugVariablePanel(wx.Panel, DebugViewer):
- def __init__(self, parent, window, producer):
+ def __init__(self, parent, producer):
wx.Panel.__init__(self, parent, style=wx.TAB_TRAVERSAL)
DebugViewer.__init__(self, producer, True)
@@ -171,14 +173,15 @@
main_sizer.AddSizer(button_sizer, border=5,
flag=wx.ALIGN_RIGHT|wx.ALL)
- up_button = wx.Button(self, label='^', size=wx.Size(28, 28))
- button_sizer.AddWindow(up_button, border=5, flag=wx.RIGHT)
-
- down_button = wx.Button(self, label='v', size=wx.Size(28, 28))
- button_sizer.AddWindow(down_button, border=5, flag=wx.RIGHT)
-
- delete_button = wx.Button(self, label=_('Delete'), size=wx.DefaultSize)
- button_sizer.AddWindow(delete_button)
+ for name, bitmap, help in [
+ ("DeleteButton", "remove_element", _("Remove debug variable")),
+ ("UpButton", "up", _("Move debug variable up")),
+ ("DownButton", "down", _("Move debug variable down"))]:
+ button = wx.lib.buttons.GenBitmapButton(self, bitmap=GetBitmap(bitmap),
+ size=wx.Size(28, 28), style=wx.NO_BORDER)
+ button.SetToolTipString(help)
+ setattr(self, name, button)
+ button_sizer.AddWindow(button, border=5, flag=wx.LEFT)
self.VariablesGrid = CustomGrid(self, size=wx.Size(0, 150), style=wx.VSCROLL)
self.VariablesGrid.SetDropTarget(DebugVariableDropTarget(self))
@@ -192,9 +195,9 @@
self.Table = DebugVariableTable(self, [], GetDebugVariablesTableColnames())
self.VariablesGrid.SetTable(self.Table)
- self.VariablesGrid.SetButtons({"Delete": delete_button,
- "Up": up_button,
- "Down": down_button})
+ self.VariablesGrid.SetButtons({"Delete": self.DeleteButton,
+ "Up": self.UpButton,
+ "Down": self.DownButton})
def _AddVariable(new_row):
return self.VariablesGrid.GetGridCursorRow()