MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / AttributeGauge

Class AttributeGauge

gui/attribute_gauge.py:11–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class AttributeGauge(wx.Window):
12 def __init__(
13 self, parent, max_range=100, animate=True, leading_edge=True,
14 edge_on_neutral=True, guide_lines=False, size=(-1, 30), *args, **kwargs
15 ):
16 super().__init__(parent, size=size, *args, **kwargs)
17
18 self._size = size
19
20 self.guide_lines = guide_lines
21
22 self._border_colour = wx.BLACK
23
24 self.leading_edge = leading_edge
25 self.edge_on_neutral = edge_on_neutral
26
27 self._border_padding = 0
28 self._max_range = max_range
29 self._value = 0
30
31 self._timer_id = wx.NewId()
32 self._timer = None
33
34 self._oldValue = 0
35
36 self._animate = animate
37 self._anim_duration = 500
38 self._anim_step = 0
39 self._period = 20
40 self._anim_value = 0
41 self._anim_direction = 0
42 self.anim_effect = anim_effects.OUT_QUAD
43
44 self.goodColor = wx.Colour(96, 191, 0)
45 self.badColor = wx.Colour(255, 64, 0)
46
47 self.gradient_effect = -35
48
49 self._percentage = 0
50 self._old_percentage = 0
51 self._show_remaining = False
52
53 self.SetBackgroundColour(wx.Colour(51, 51, 51))
54
55 self._tooltip = wx.ToolTip("0.00/100.00")
56 self.SetToolTip(self._tooltip)
57
58 self.Bind(wx.EVT_PAINT, self.OnPaint)
59 self.Bind(wx.EVT_TIMER, self.OnTimer)
60 self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
61
62 def OnEraseBackground(self, event):
63 pass
64
65 def GetBorderColour(self):
66 return self._border_colour
67
68 def SetBorderColour(self, colour):

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected