You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __POINT_2D_WIDGET_HEADER__
  2. #define __POINT_2D_WIDGET_HEADER__
  3. #ifndef __linux__
  4. #include <WinSock2.h>
  5. #endif
  6. #include <queue>
  7. #include "../guiClass.h"
  8. enum{
  9. P2D_STYLE_TOOLTIP = 0,
  10. P2D_STYLE_TARGET = 1,
  11. P2D_STYLE_POI = 2,
  12. P2D_STYLE_ROI = 3
  13. };
  14. class point2DWidget : public QWidget {
  15. private:
  16. uint32_t m_nX;
  17. uint32_t m_nY;
  18. uint32_t m_nlX;
  19. uint32_t m_nlY;
  20. uint32_t m_nMaxX;
  21. uint32_t m_nMaxY;
  22. QWidget *m_pParent;
  23. QTimer *m_pAnimationTimer;
  24. uint8_t m_bStyle;
  25. uint8_t m_bMode;
  26. uint8_t m_bNSteps;
  27. uint8_t m_LineHeight;
  28. uint8_t m_bPointSize;
  29. uint16_t m_bHandleLength;
  30. uint16_t m_bBannerWidth;
  31. uint32_t m_nAuxCounter;
  32. uint8_t m_bDirection;
  33. uint8_t m_bLabelHeight;
  34. QColor m_pPenColor;
  35. QColor m_pBrushColor;
  36. QColor m_pTextColor;
  37. QFont m_pFont;
  38. bool m_bAutoHide;
  39. bool m_bRoundPoint;
  40. uint32_t m_nAutoHideInterval;
  41. uint32_t m_nAutohideCounter;
  42. char m_cLabel[3][128];
  43. public:
  44. explicit point2DWidget(QWidget *parent = NULL, uint8_t Mode = P2D_STYLE_TOOLTIP );
  45. ~point2DWidget();
  46. void create( uint32_t x, uint32_t y, char *labelLine1 = NULL, char *labelLine2 = NULL, char *labelLine3 = NULL );
  47. void setMaxValues(uint32_t x, uint32_t y);
  48. void setAutoHide( bool ah = true, uint32_t interval = 120 ); // 3 seconds
  49. public slots:
  50. void paintEvent(QPaintEvent*);
  51. private slots:
  52. void handleTimer();
  53. };
  54. #endif