Counter Strike : Global Offensive Source Code
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.

118 lines
3.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CHOREOACTORWIDGET_H
  8. #define CHOREOACTORWIDGET_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "studio.h"
  13. #include "choreowidget.h"
  14. #include "utlvector.h"
  15. #include "mxBitmapButton.h"
  16. #include "expressions.h"
  17. class CChoreoActor;
  18. class CChoreoChannelWidget;
  19. class mxCheckBox;
  20. class CChoreoActorWidget;
  21. //-----------------------------------------------------------------------------
  22. // Purpose:
  23. //-----------------------------------------------------------------------------
  24. class CActorBitmapButton : public mxBitmapButton
  25. {
  26. public:
  27. CActorBitmapButton( CChoreoActorWidget *actor, mxWindow *parent, int x, int y, int w, int h, int id = 0, const char *bitmap = 0 );
  28. CChoreoActorWidget *GetActor( void );
  29. private:
  30. CChoreoActorWidget *m_pActor;
  31. };
  32. //-----------------------------------------------------------------------------
  33. // Purpose:
  34. //-----------------------------------------------------------------------------
  35. class CActorActiveCheckBox : public mxCheckBox
  36. {
  37. public:
  38. CActorActiveCheckBox( CChoreoActorWidget *actor, mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0);
  39. CChoreoActorWidget *GetActor( void );
  40. private:
  41. CChoreoActorWidget *m_pActor;
  42. };
  43. //-----------------------------------------------------------------------------
  44. // Purpose: The base actor ui widget. Owns the channels
  45. //-----------------------------------------------------------------------------
  46. class CChoreoActorWidget : public CChoreoWidget
  47. {
  48. public:
  49. typedef CChoreoWidget BaseClass;
  50. // Construction / destruction
  51. CChoreoActorWidget( CChoreoWidget *parent );
  52. virtual ~CChoreoActorWidget( void );
  53. virtual void Create( void );
  54. virtual void Layout( RECT& rc );
  55. virtual void redraw(CChoreoWidgetDrawHelper& drawHelper);
  56. // Accessors
  57. CChoreoActor *GetActor( void );
  58. void SetActor( CChoreoActor *actor );
  59. // Manipulate channels
  60. void AddChannel( CChoreoChannelWidget *channel );
  61. void RemoveChannel( CChoreoChannelWidget *channel );
  62. CChoreoChannelWidget *GetChannel( int num );
  63. int GetNumChannels( void );
  64. // Override height because we can be open/collapsed and we contain the channels
  65. virtual int GetItemHeight( void );
  66. // UI interactions
  67. void DeleteChannel( void );
  68. void NewChannel( void );
  69. void MoveChannelUp( void );
  70. void MoveChannelDown( void );
  71. // Expanded view or contracted view
  72. void ShowChannels( bool show );
  73. bool GetShowChannels( void );
  74. float *GetSettings( void );
  75. void ResetSettings( void );
  76. private:
  77. // Context menu handler
  78. void ShowRightClickMenu( int mx, int my );
  79. // The underlying actor
  80. CChoreoActor *m_pActor;
  81. // Children
  82. CUtlVector < CChoreoChannelWidget * > m_Channels;
  83. // Expanded mode?
  84. bool m_bShowChannels;
  85. // Expand/collapse buttons
  86. CActorBitmapButton *m_btnOpen;
  87. CActorBitmapButton *m_btnClose;
  88. CActorActiveCheckBox *m_cbActive;
  89. float m_rgCurrentSetting[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
  90. };
  91. #endif // CHOREOACTORWIDGET_H