- Toolbars should be realized.

This commit is contained in:
ccremers 2006-08-03 08:18:14 +00:00
parent 69581fcacc
commit 77afb897fa
2 changed files with 14 additions and 3 deletions

View File

@ -136,10 +136,12 @@ class AttackWindow(wx.Frame):
# Add fit button # Add fit button
bmp = wx.ArtProvider_GetBitmap(wx.ART_MISSING_IMAGE,wx.ART_TOOLBAR,(20,20)) bmp = wx.ArtProvider_GetBitmap(wx.ART_MISSING_IMAGE,wx.ART_TOOLBAR,(20,20))
if not bmp.Ok(): if not bmp.Ok():
bmp = wx.EmptyBitmap(20,20) bmp = wx.EmptyBitmap(32,32)
tb.AddCheckTool(wx.ID_ZOOM_FIT, bmp, bmp, 'Toggle zoom', 'Toggle zoom level') tb.AddCheckTool(wx.ID_ZOOM_FIT, bmp, bmp, 'Toggle zoom', 'Toggle zoom level')
self.Bind(wx.EVT_TOOL, self.OnFit, id=wx.ID_ZOOM_FIT) self.Bind(wx.EVT_TOOL, self.OnFit, id=wx.ID_ZOOM_FIT)
tb.Realize()
# And shortcut # And shortcut
aTable = wx.AcceleratorTable([ aTable = wx.AcceleratorTable([
(wx.ACCEL_NORMAL, ord('Z'), wx.ID_ZOOM_FIT) (wx.ACCEL_NORMAL, ord('Z'), wx.ID_ZOOM_FIT)

View File

@ -114,13 +114,20 @@ class MainWindow(wx.Frame):
| wx.TB_TEXT | wx.TB_TEXT
) )
bmp = wx.ArtProvider_GetBitmap(wx.ART_EXECUTABLE_FILE,wx.ART_TOOLBAR,(20,20)) #print "Default toolbar tool size: %s\n" % tb.GetToolBitmapSize()
tsize = (32,32)
bmp = wx.ArtProvider_GetBitmap(wx.ART_EXECUTABLE_FILE,wx.ART_TOOLBAR,tsize)
if not bmp.Ok(): if not bmp.Ok():
bmp = wx.EmptyBitmap(20,20) bmp = wx.EmptyBitmap(tsize)
# add the actual tools
tb.AddSimpleTool(ID_VERIFY, bmp,"Verify","Verify claims") tb.AddSimpleTool(ID_VERIFY, bmp,"Verify","Verify claims")
self.Bind(wx.EVT_TOOL, self.OnVerify, id=ID_VERIFY) self.Bind(wx.EVT_TOOL, self.OnVerify, id=ID_VERIFY)
tb.AddSimpleTool(ID_STATESPACE, bmp,"Statespace","Generate statespace for all roles") tb.AddSimpleTool(ID_STATESPACE, bmp,"Statespace","Generate statespace for all roles")
self.Bind(wx.EVT_TOOL, self.OnStatespace, id=ID_STATESPACE) self.Bind(wx.EVT_TOOL, self.OnStatespace, id=ID_STATESPACE)
tb.AddSeparator() tb.AddSeparator()
tb.AddSimpleTool(ID_CHECK, bmp,"Check","Check protocol") tb.AddSimpleTool(ID_CHECK, bmp,"Check","Check protocol")
@ -128,6 +135,8 @@ class MainWindow(wx.Frame):
tb.AddSimpleTool(ID_AUTOVERIFY, bmp,"Default claims","Verify default claims") tb.AddSimpleTool(ID_AUTOVERIFY, bmp,"Default claims","Verify default claims")
self.Bind(wx.EVT_TOOL, self.OnAutoVerify, id=ID_AUTOVERIFY) self.Bind(wx.EVT_TOOL, self.OnAutoVerify, id=ID_AUTOVERIFY)
tb.Realize()
def CreateMenu(self, bar, name, list): def CreateMenu(self, bar, name, list):
fileMenu = wx.Menu() fileMenu = wx.Menu()