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

Method __init__

graphs/gui/vector.py:34–58  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

32 EVT_VECTOR_CHANGED = wx.PyEventBinder(myEVT_VECTOR_CHANGED, 1)
33
34 def __init__(self, *args, **kwargs):
35 self._label = str(kwargs.pop('label', ''))
36 self._labelpos = int(kwargs.pop('labelpos', 0))
37 self._offset = float(kwargs.pop('offset', 0))
38 self._size = max(0, float(kwargs.pop('size', 50)))
39 self._directionOnly = kwargs.pop('directionOnly', False)
40 super().__init__(*args, **kwargs)
41 self._fontsize = max(1, float(kwargs.pop('fontsize', 8 / self.GetContentScaleFactor())))
42 self._font = wx.Font(round(self._fontsize), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)
43 self._angle = 0
44 self.__length = 1
45 self._left = False
46 self._right = False
47 self._savedFocusedWindow = None
48 self.SetToolTip(wx.ToolTip(self._tooltip))
49 self.Bind(wx.EVT_PAINT, self.OnPaint)
50 self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
51 self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
52 self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
53 self.Bind(wx.EVT_MOUSEWHEEL, self.OnWheel)
54 # Allows to focus these widgets on hover, needed to support
55 # vector length changing by scrolling
56 if 'wxMSW' in wx.PlatformInfo:
57 self.Bind(wx.EVT_MOTION, self.OnMouseMove)
58 self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
59
60 @property
61 def _tooltip(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected