#include <GUIGLObjectToolTip.h>

Definition at line 51 of file GUIGLObjectToolTip.h.
Public Member Functions | |
| FXint | getDefaultHeight () |
| FXint | getDefaultWidth () |
| GUIGLObjectToolTip (FXWindow *a) | |
| Constructor. | |
| long | onPaint (FXObject *, FXSelector, void *ptr) |
| long | onTipHide (FXObject *, FXSelector, void *) |
| long | onTipShow (FXObject *, FXSelector, void *) |
| ~GUIGLObjectToolTip () | |
| Destructor. | |
Protected Member Functions | |
| GUIGLObjectToolTip () | |
| FOX default constructor. | |
Private Member Functions | |
| void | eraseTip () |
| removes the tooltip (undisplays it) | |
| void | setObjectTip (GUIGlObject *object, FXint x, FXint y) |
| sets the tooltip displaying information about the given object at the given position | |
Private Attributes | |
| FXFont * | myFont |
| The used font. | |
| FXint | myHeight |
| FXint | myLastXPos |
| The last position of the tool tip. | |
| FXint | myLastYPos |
| GUIGlObject * | myObject |
| The object for which the tool tip is displayed. | |
| std::string | myObjectName |
| The name of the object currently displayed. | |
| GUISUMOAbstractView * | myParent |
| The parent window. | |
| int | myTextHeight |
| The height of the displayed text. | |
| FXint | myWidth |
| The current width and height. | |
Friends | |
| class | GUIRouterSUMOAbstractView |
| class | GUISUMOAbstractView |
| an abstract view may set or erase the tooltip | |
| GUIGLObjectToolTip::GUIGLObjectToolTip | ( | FXWindow * | a | ) |
Constructor.
| GUIGLObjectToolTip::~GUIGLObjectToolTip | ( | ) |
| GUIGLObjectToolTip::GUIGLObjectToolTip | ( | ) | [inline, protected] |
| void GUIGLObjectToolTip::eraseTip | ( | ) | [private] |
removes the tooltip (undisplays it)
| FXint GUIGLObjectToolTip::getDefaultHeight | ( | ) |
Definition at line 128 of file GUIGLObjectToolTip.cpp.
References myHeight.
00128 { 00129 return myHeight; 00130 }
| FXint GUIGLObjectToolTip::getDefaultWidth | ( | ) |
Definition at line 122 of file GUIGLObjectToolTip.cpp.
References myWidth.
00122 { 00123 return myWidth; 00124 }
| long GUIGLObjectToolTip::onPaint | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ptr | |||
| ) |
Definition at line 103 of file GUIGLObjectToolTip.cpp.
References GUIGlObject::getFullName(), myFont, myObject, myObjectName, and myTextHeight.
00103 { 00104 if (myObject==0) { 00105 return 1; 00106 } 00107 // Start drawing 00108 FXDCWindow dc(this); 00109 dc.setForeground(backColor); 00110 dc.fillRectangle(1, 1, 00111 myFont->getTextWidth(myObjectName.c_str(), (FXuint) myObjectName.length())+4, myTextHeight+4); 00112 dc.setFont(myFont); 00113 dc.setForeground(0); 00114 dc.drawText(3, myTextHeight, 00115 myObjectName.c_str(), (FXuint) myObject->getFullName().length()); 00116 dc.drawRectangle(0, 0, myFont->getTextWidth(myObjectName.c_str(), (FXuint) myObjectName.length())+5, myTextHeight+5); 00117 return 1; 00118 }
| long GUIGLObjectToolTip::onTipHide | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ||||
| ) |
| long GUIGLObjectToolTip::onTipShow | ( | FXObject * | , | |
| FXSelector | , | |||
| void * | ||||
| ) |
| void GUIGLObjectToolTip::setObjectTip | ( | GUIGlObject * | object, | |
| FXint | x, | |||
| FXint | y | |||
| ) | [private] |
sets the tooltip displaying information about the given object at the given position
Definition at line 68 of file GUIGLObjectToolTip.cpp.
References myFont, myHeight, myLastXPos, myLastYPos, myObject, myObjectName, myTextHeight, and myWidth.
Referenced by GUISUMOAbstractView::onMouseLeft(), and GUISUMOAbstractView::showToolTipFor().
00069 { 00070 // check whether the object has changed 00071 bool objectChanged = (myObject!=object); 00072 // save current object 00073 myObject = object; 00074 if (object==0) { 00075 // hide the tool tip if there is no object below 00076 hide(); 00077 return; 00078 } 00079 // if the object has changed 00080 if (objectChanged) { 00081 // get the new name and width 00082 myObjectName = object->getFullName(); 00083 label = myObjectName.c_str(); 00084 myWidth = myFont->getTextWidth(myObjectName.c_str(), (FXuint) myObjectName.length())+6; 00085 } 00086 myHeight = myTextHeight+6; 00087 position(x+15, y-20, 1, 1); 00088 position(x+15, y-20, myWidth, myHeight); 00089 if (!shown()) { 00090 show(); 00091 } else { 00092 if (objectChanged) { 00093 recalc(); 00094 } 00095 update(); 00096 } 00097 myLastXPos = x; 00098 myLastYPos = y; 00099 }
friend class GUIRouterSUMOAbstractView [friend] |
Definition at line 63 of file GUIGLObjectToolTip.h.
friend class GUISUMOAbstractView [friend] |
FXFont* GUIGLObjectToolTip::myFont [private] |
The used font.
Definition at line 89 of file GUIGLObjectToolTip.h.
Referenced by onPaint(), and setObjectTip().
FXint GUIGLObjectToolTip::myHeight [private] |
Definition at line 95 of file GUIGLObjectToolTip.h.
Referenced by getDefaultHeight(), and setObjectTip().
FXint GUIGLObjectToolTip::myLastXPos [private] |
The last position of the tool tip.
Definition at line 98 of file GUIGLObjectToolTip.h.
Referenced by setObjectTip().
FXint GUIGLObjectToolTip::myLastYPos [private] |
GUIGlObject* GUIGLObjectToolTip::myObject [private] |
The object for which the tool tip is displayed.
Definition at line 101 of file GUIGLObjectToolTip.h.
Referenced by onPaint(), and setObjectTip().
std::string GUIGLObjectToolTip::myObjectName [private] |
The name of the object currently displayed.
Definition at line 92 of file GUIGLObjectToolTip.h.
Referenced by onPaint(), and setObjectTip().
GUISUMOAbstractView* GUIGLObjectToolTip::myParent [private] |
int GUIGLObjectToolTip::myTextHeight [private] |
The height of the displayed text.
Definition at line 86 of file GUIGLObjectToolTip.h.
Referenced by onPaint(), and setObjectTip().
FXint GUIGLObjectToolTip::myWidth [private] |
The current width and height.
Definition at line 95 of file GUIGLObjectToolTip.h.
Referenced by getDefaultWidth(), and setObjectTip().
1.5.6