summaryrefslogtreecommitdiff
path: root/utils/hlfaceposer/choreoactorwidget.h
blob: b3cfb72a1baa662999c45e70bb30fe5bbb236460 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//
#ifndef CHOREOACTORWIDGET_H
#define CHOREOACTORWIDGET_H
#ifdef _WIN32
#pragma once
#endif

#include "studio.h"
#include "choreowidget.h"
#include "utlvector.h"
#include "mxBitmapButton.h"
#include "expressions.h"

class CChoreoActor;
class CChoreoChannelWidget;
class mxCheckBox;
class CChoreoActorWidget;

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
class CActorBitmapButton : public mxBitmapButton
{
public:
	CActorBitmapButton( CChoreoActorWidget *actor, mxWindow *parent, int x, int y, int w, int h, int id = 0, const char *bitmap = 0 );

	CChoreoActorWidget	*GetActor( void );
private:

	CChoreoActorWidget		*m_pActor;
};

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
class CActorActiveCheckBox : public mxCheckBox
{
public:
	CActorActiveCheckBox( CChoreoActorWidget *actor, mxWindow *parent, int x, int y, int w, int h, const char *label = 0, int id = 0);

	CChoreoActorWidget	*GetActor( void );
private:

	CChoreoActorWidget		*m_pActor;
};

//-----------------------------------------------------------------------------
// Purpose: The base actor ui widget.  Owns the channels
//-----------------------------------------------------------------------------
class CChoreoActorWidget : public CChoreoWidget
{
public:
	typedef CChoreoWidget		BaseClass;

	// Construction / destruction
								CChoreoActorWidget( CChoreoWidget *parent );
	virtual						~CChoreoActorWidget( void );

	virtual void				Create( void );
	virtual void				Layout( RECT& rc );

	virtual void				redraw(CChoreoWidgetDrawHelper& drawHelper);

	// Accessors
	CChoreoActor				*GetActor( void );
	void						SetActor( CChoreoActor *actor );

	// Manipulate channels
	void						AddChannel( CChoreoChannelWidget *channel );
	void						RemoveChannel( CChoreoChannelWidget *channel );
	CChoreoChannelWidget		*GetChannel( int num );
	int							GetNumChannels( void );

	// Override height because we can be open/collapsed and we contain the channels
	virtual int					GetItemHeight( void );

	// UI interactions
	void						DeleteChannel( void );
	void						NewChannel( void );
	void						MoveChannelUp( void );
	void						MoveChannelDown( void );

	// Expanded view or contracted view
	void						ShowChannels( bool show );
	bool						GetShowChannels( void );

	float						*GetSettings( void );

	void						ResetSettings( void );

private:
	// Context menu handler
	void						ShowRightClickMenu( int mx, int my );

	// The underlying actor
	CChoreoActor				*m_pActor;

	// Children
	CUtlVector < CChoreoChannelWidget * > m_Channels;

	// Expanded mode?
	bool						m_bShowChannels;

	// Expand/collapse buttons
	CActorBitmapButton			*m_btnOpen;
	CActorBitmapButton			*m_btnClose;

	CActorActiveCheckBox		*m_cbActive;

	float						m_rgCurrentSetting[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ];
};

#endif // CHOREOACTORWIDGET_H