- Refactoring, explanations, added button.

This commit is contained in:
ccremers
2006-08-11 09:41:12 +00:00
parent 347010bfa4
commit 9ce483095d
5 changed files with 52 additions and 30 deletions

View File

@@ -147,12 +147,10 @@ class AttackWindow(wx.Frame):
# Make zoom buttons
if Preference.usePIL():
buttons = wx.BoxSizer(wx.HORIZONTAL)
bt = wx.Button(self,wx.ID_ZOOM_100)
bt = wx.ToggleButton(self,-1,"Fit to window")
bt.SetValue(self.fit)
buttons.Add(bt,0)
self.Bind(wx.EVT_BUTTON, self.OnZoom100, bt)
bt = wx.Button(self,wx.ID_ZOOM_FIT)
buttons.Add(bt,0)
self.Bind(wx.EVT_BUTTON, self.OnZoomFit, bt)
self.Bind(wx.EVT_TOGGLEBUTTON, self.OnFit, bt)
sizer.Add(buttons, 0, wx.ALIGN_LEFT)
# Add attacks (possible with tabs)
@@ -197,13 +195,14 @@ class AttackWindow(wx.Frame):
self.Refresh()
def OnZoom100(self,evt):
self.Refresh()
self.fit = False
self.update()
self.Refresh()
def OnZoomFit(self,evt):
self.Refresh()
self.fit = True
self.update()
self.Refresh()

View File

@@ -380,15 +380,15 @@ class ResultWindow(wx.Frame):
grid.Add(bmpfield,(ypos,xpos),(1,1),wx.ALIGN_CENTER_VERTICAL|wx.ALL,10)
else:
# new style text control Ok/Fail
rank = cl.getRank()
rankt = [('Fail','red'),
('Fail','dark red'),
('Ok','dark green'),
('Ok','forest green')]
txt = wx.StaticText(self,-1,rankt[rank][0])
rankc = cl.getColour()
if cl.okay:
rankt = "Ok"
else:
rankt = "Fail"
txt = wx.StaticText(self,-1,rankt)
font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD)
txt.SetFont(font)
txt.SetForegroundColour(rankt[rank][1])
txt.SetForegroundColour(rankc)
grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10)
xpos += 1

View File

@@ -83,7 +83,7 @@ class SettingsWindow(wx.Panel):
else:
defsize = 11
self.fontsize = int(Preference.get('fontsize',defsize))
txt = wx.StaticText(self,-1,"Attack graph font size")
txt = wx.StaticText(self,-1,"Attack graph font size (in points)")
ctrl = wx.SpinCtrl(self, -1, "",style=wx.RIGHT)
ctrl.SetRange(6,32)
ctrl.SetValue(self.fontsize)