Inherits objects::logic::common::threads::appThreadBase::appThreadBase.
Public Member Functions | |
| def | run |
| Thread class run method. | |
| def | createTipWindow |
| Sends a message back to the Mainframe, in order to displays a tool tip window showing varied information on the Endpoint(s) right underneath the mouse Note that there may be more than one Endpoint sharing the same space. | |
Public Attributes | |
| iterationTime | |
| lastMousePosition | |
| positionChecked | |
| killSwitch | |
This class is used to determine if a tool tip must be drawn onto the screen (if course the mouse has stopped right on top of an Endpoint).
Definition at line 34 of file mouseHoverThread.py.
| def objects.gui.threads.mouseHoverThread.mouseHoverThread.createTipWindow | ( | self, | ||
| entList | ||||
| ) |
Sends a message back to the Mainframe, in order to displays a tool tip window showing varied information on the Endpoint(s) right underneath the mouse Note that there may be more than one Endpoint sharing the same space.
| entList | List of endpoints (usually just a single item list) underneath the mouse |
Definition at line 93 of file mouseHoverThread.py.
00093 : 00094 evt = wx.PyEvent() 00095 evt.SetEventType(EVT_DISPLAY_TOOLINFOWIN) 00096 evt.entityList = entList 00097 00098 wx.PostEvent(self.parent, evt) wx.PostEvent(self.parent, evt)
| def objects.gui.threads.mouseHoverThread.mouseHoverThread.run | ( | self | ) |
Thread class run method.
This method will essentially detect when the mouse has stopped moving (since lack of movement does not generate a UI event), and determine if a tool tip window needs to be displayed. This method will end when the parent.killMouseHoverThread flag is set
Definition at line 39 of file mouseHoverThread.py.
00039 : 00040 self.iterationTime = None 00041 self.lastMousePosition = None 00042 00043 # true if the lastMousePosition was already processed 00044 self.positionChecked = False 00045 00046 try: 00047 while(self.killSwitch == False): 00048 self.threadEvent.clear() 00049 time.sleep(0.5) 00050 00051 if self.parent.currentMousePosition != None: 00052 currentMousePos = wx.Point() 00053 currentMousePos.x = self.parent.currentMousePosition.x 00054 currentMousePos.y = self.parent.currentMousePosition.y 00055 00056 lastMouseMovTim = self.parent.lastMouseMoveTime 00057 00058 self.iterationTime = time.time() 00059 00060 # if mouse is over the figure 00061 if self.parent.fig_axes.axes.in_axes(currentMousePos.x, currentMousePos.y): 00062 #MH##if self.parent.fig_axes.axes.in_axes(currentMousePos): 00063 # and if mouse position has not changed over some period of time 00064 if (self.lastMousePosition == currentMousePos) \ 00065 and abs(self.iterationTime - lastMouseMovTim) > .5: 00066 00067 # if this particular spot has not already been checked... 00068 if self.positionChecked == False: 00069 #check this position 00070 00071 entList = self.parent.hitTest(currentMousePos) 00072 if entList is not None: 00073 00074 self.createTipWindow(entList) 00075 00076 self.positionChecked = True 00077 else: 00078 self.positionChecked = False 00079 self.lastMousePosition = currentMousePos 00080 else: 00081 self.positionChecked = False 00082 00083 finally: 00084 self.threadEvent.set() 00085 self.threadEvent.clear() 00086 00087 logger.log(__name__ + ": Mouse Hover Thread Done") 00088 00089 ## Sends a message back to the Mainframe, in order to displays a tool tip window showing varied information on the Endpoint(s) right underneath the mouse
Definition at line 40 of file mouseHoverThread.py.
Reimplemented from objects.logic.common.threads.appThreadBase.appThreadBase.
Definition at line 47 of file mouseHoverThread.py.
Definition at line 41 of file mouseHoverThread.py.
Definition at line 44 of file mouseHoverThread.py.
1.5.8