MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / MouseMove

Method MouseMove

gui/builtinShipBrowser/sfBrowserItem.py:110–138  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

108 self.hoverLabel = ""
109
110 def MouseMove(self, event):
111 doRefresh = False
112 changeCursor = False
113 bx = self.toolbarX
114 self.hoverLabel = ""
115
116 for button in self.buttons:
117 if not button.IsVisible():
118 continue
119
120 state = button.GetState()
121 if self.HitTest((bx, self.toolbarY), event.GetPosition(), button.GetSize()):
122 changeCursor = True
123 if not state & BTN_HOVER:
124 button.SetState(state | BTN_HOVER)
125 self.hoverLabel = button.GetLabel()
126 self.Parent.SetCursor(wx.Cursor(wx.CURSOR_HAND))
127 doRefresh = True
128 else:
129 if state & BTN_HOVER:
130 button.SetState(state ^ BTN_HOVER)
131 doRefresh = True
132
133 bwidth, bheight = button.GetSize()
134 bx += bwidth + self.padding
135
136 if not changeCursor:
137 self.Parent.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
138 return doRefresh
139
140 def MouseClick(self, event):
141 bx = self.toolbarX

Callers 1

OnMotionMethod · 0.45

Calls 7

HitTestMethod · 0.95
IsVisibleMethod · 0.80
SetStateMethod · 0.80
GetLabelMethod · 0.80
GetStateMethod · 0.45
GetPositionMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected