Rework more windows to use aux frame

This commit is contained in:
DarkPhoenix
2019-08-12 00:32:27 +03:00
parent fc65cb6000
commit 34a6fdc07e
10 changed files with 68 additions and 256 deletions

View File

@@ -392,64 +392,3 @@ class PyGauge(wx.Window):
self._timer.Stop()
self.Refresh()
if __name__ == "__main__":
def frange(x, y, jump):
while x < y:
yield x
x += jump
class MyPanel(wx.Panel):
def __init__(self, parent, size=(500, 500)):
wx.Panel.__init__(self, parent, size=size)
box = wx.BoxSizer(wx.VERTICAL)
# tests the colors of transition based on percentage used
# list of test values (from 99 -> 106 in increments of 0.5)
tests = [x for x in frange(99, 106.5, .5)]
font = wx.Font(9, wx.SWISS, wx.NORMAL, wx.NORMAL, False)
for i, value in enumerate(tests):
self.gauge = PyGauge(self, font, size=(100, 25))
self.gauge.SetValueRange(value, 100)
self.gauge.SetFractionDigits(2)
box.Add(self.gauge, 0, wx.ALL, 2)
gauge = PyGauge(self, font, size=(100, 25))
gauge.SetBackgroundColour(wx.Colour(52, 86, 98))
gauge.SetBarColour(wx.Colour(38, 133, 198))
gauge.SetValue(59)
gauge.SetFractionDigits(1)
box.Add(gauge, 0, wx.ALL, 2)
gauge = PyGauge(self, font, size=(100, 5))
gauge.SetBackgroundColour(wx.Colour(52, 86, 98))
gauge.SetBarColour(wx.Colour(255, 128, 0))
gauge.SetValue(59)
gauge.SetFractionDigits(1)
box.Add(gauge, 0, wx.ALL, 2)
self.SetSizer(box)
self.Layout()
# see animation going backwards with last gauge
wx.CallLater(2000, self.ChangeValues)
def ChangeValues(self):
self.gauge.SetValueRange(4, 100)
class Frame(wx.Frame):
def __init__(self, title, size=(500, 800)):
wx.Frame.__init__(self, None, title=title, size=size)
self.statusbar = self.CreateStatusBar()
main_sizer = wx.BoxSizer(wx.VERTICAL)
panel = MyPanel(self, size=size)
main_sizer.Add(panel)
self.SetSizer(main_sizer)
app = wx.App(redirect=False) # Error messages go to popup window
top = Frame("Test Chrome Tabs")
top.Show()
app.MainLoop()