Team Fortress 2 Source Code as on 22/4/2020
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.

69 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef VGUIWND_H
  7. #define VGUIWND_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "mxtk/mx.h"
  12. #include "color.h"
  13. namespace vgui
  14. {
  15. class EditablePanel;
  16. typedef unsigned long HCursor;
  17. }
  18. class CVGuiWnd
  19. {
  20. public:
  21. CVGuiWnd(void);
  22. ~CVGuiWnd(void);
  23. public:
  24. void SetMainPanel( vgui::EditablePanel * pPanel );
  25. vgui::EditablePanel *GetMainPanel(); // returns VGUI main panel
  26. vgui::EditablePanel *CreateDefaultPanel();
  27. void SetParentWindow(mxWindow *pParent);
  28. mxWindow *GetParentWnd(); // return mxWindow handle
  29. void SetCursor(vgui::HCursor cursor);
  30. void SetCursor(const char *filename);
  31. void SetRepaintInterval( int msecs );
  32. int GetVGuiContext();
  33. protected:
  34. void DrawVGuiPanel(); // overridden to draw this view
  35. int HandeEventVGui( mxEvent *event );
  36. vgui::EditablePanel *m_pMainPanel;
  37. mxWindow *m_pParentWnd;
  38. int m_hVGuiContext;
  39. bool m_bIsDrawing;
  40. Color m_ClearColor;
  41. bool m_bClearZBuffer;
  42. };
  43. class CVGuiPanelWnd: public mxWindow, public CVGuiWnd
  44. {
  45. typedef mxWindow BaseClass;
  46. public:
  47. CVGuiPanelWnd( mxWindow *parent, int x, int y, int w, int h );
  48. virtual int handleEvent( mxEvent *event );
  49. virtual void redraw();
  50. };
  51. #endif // VGUIWND_H