- Got rid of stupid buttons.
This commit is contained in:
parent
70fa59a9b5
commit
0c3f860b7b
@ -81,6 +81,17 @@ class MainWindow(wx.Frame):
|
|||||||
''' Create "interior" window components. In this case it is just a
|
''' Create "interior" window components. In this case it is just a
|
||||||
simple multiline text control. '''
|
simple multiline text control. '''
|
||||||
|
|
||||||
|
## Make zoom buttons
|
||||||
|
#sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
#buttons = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
#bt = wx.Button(self,ID_VERIFY)
|
||||||
|
#buttons.Add(bt,0)
|
||||||
|
#self.Bind(wx.EVT_BUTTON, self.OnVerify, bt)
|
||||||
|
#bt = wx.Button(self,ID_STATESPACE)
|
||||||
|
#buttons.Add(bt,0)
|
||||||
|
#self.Bind(wx.EVT_BUTTON, self.OnStatespace, bt)
|
||||||
|
#sizer.Add(buttons, 0, wx.ALIGN_LEFT)
|
||||||
|
|
||||||
# Top: input
|
# Top: input
|
||||||
self.top = wx.Notebook(self,-1)
|
self.top = wx.Notebook(self,-1)
|
||||||
self.control = wx.TextCtrl(self.top, style=wx.TE_MULTILINE)
|
self.control = wx.TextCtrl(self.top, style=wx.TE_MULTILINE)
|
||||||
@ -93,52 +104,15 @@ class MainWindow(wx.Frame):
|
|||||||
self.settings = SettingsWindow(self.top,self)
|
self.settings = SettingsWindow(self.top,self)
|
||||||
self.top.AddPage(self.settings,"Verification parameters")
|
self.top.AddPage(self.settings,"Verification parameters")
|
||||||
|
|
||||||
#self.report.SetValue("Welcome.")
|
#sizer.Add(self.top,1,wx.EXPAND,1)
|
||||||
|
#self.SetSizer(sizer)
|
||||||
self.Show(1)
|
|
||||||
|
|
||||||
|
|
||||||
def CreateExteriorWindowComponents(self):
|
def CreateExteriorWindowComponents(self):
|
||||||
''' Create "exterior" window components, such as menu and status
|
''' Create "exterior" window components, such as menu and status
|
||||||
bar. '''
|
bar. '''
|
||||||
self.CreateMenus()
|
self.CreateMenus()
|
||||||
self.SetupToolBar()
|
|
||||||
self.SetTitle()
|
self.SetTitle()
|
||||||
|
|
||||||
def SetupToolBar(self):
|
|
||||||
|
|
||||||
tb = self.CreateToolBar(wx.TB_HORIZONTAL
|
|
||||||
#| wx.NO_BORDER
|
|
||||||
#| wx.TB_FLAT
|
|
||||||
)
|
|
||||||
|
|
||||||
#print "Default toolbar tool size: %s\n" % tb.GetToolBitmapSize()
|
|
||||||
|
|
||||||
def getBmp(name):
|
|
||||||
bmp = wx.Image(os.path.join("Images","%s.png" % name),wx.BITMAP_TYPE_PNG).ConvertToBitmap()
|
|
||||||
if not bmp.Ok():
|
|
||||||
bmp = wx.EmptyBitmap(32,32)
|
|
||||||
return bmp
|
|
||||||
|
|
||||||
bmpverify = getBmp("verify-button")
|
|
||||||
bmpcharacterize = getBmp("characterize-button")
|
|
||||||
|
|
||||||
# add the actual tools
|
|
||||||
tb.AddSimpleTool(ID_VERIFY, bmpverify,shortHelpString="Verify claims in protocol")
|
|
||||||
self.Bind(wx.EVT_TOOL, self.OnVerify, id=ID_VERIFY)
|
|
||||||
tb.AddSimpleTool(ID_STATESPACE,
|
|
||||||
bmpcharacterize,shortHelpString="Generate statespace for all roles")
|
|
||||||
self.Bind(wx.EVT_TOOL, self.OnStatespace, id=ID_STATESPACE)
|
|
||||||
|
|
||||||
# tb.AddSeparator()
|
|
||||||
|
|
||||||
# tb.AddSimpleTool(ID_CHECK, bmp,"Check","Check protocol")
|
|
||||||
# self.Bind(wx.EVT_TOOL, self.OnCheck, id=ID_CHECK)
|
|
||||||
# tb.AddSimpleTool(ID_AUTOVERIFY, bmp,"Default claims","Verify default claims")
|
|
||||||
# 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()
|
||||||
@ -181,8 +155,7 @@ class MainWindow(wx.Frame):
|
|||||||
def SetTitle(self):
|
def SetTitle(self):
|
||||||
# MainWindow.SetTitle overrides wx.Frame.SetTitle, so we have to
|
# MainWindow.SetTitle overrides wx.Frame.SetTitle, so we have to
|
||||||
# call it using super:
|
# call it using super:
|
||||||
super(MainWindow, self).SetTitle('Scyther-gui: %s'%self.filename)
|
super(MainWindow, self).SetTitle('Scyther: %s'%self.filename)
|
||||||
|
|
||||||
|
|
||||||
# Helper methods:
|
# Helper methods:
|
||||||
|
|
||||||
@ -252,6 +225,7 @@ class MainWindow(wx.Frame):
|
|||||||
def firstCommand(self):
|
def firstCommand(self):
|
||||||
if self.opts.command:
|
if self.opts.command:
|
||||||
# Trigger a command automatically
|
# Trigger a command automatically
|
||||||
|
self.Show(True)
|
||||||
self.RunScyther(self.opts.command)
|
self.RunScyther(self.opts.command)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user