summaryrefslogtreecommitdiff
path: root/utils/hlfaceposer/mxexpressiontab.cpp
blob: 21efec02ca5514c265905b3d2b3b46c77e8819e9 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#include "hlfaceposer.h"
#include "mxExpressionTab.h"
#include "mdlviewer.h"
#include "expressions.h"

mxExpressionTab *g_pExpressionClass = 0;

//-----------------------------------------------------------------------------
// Purpose: Right click context menu
// Input  : mx - 
//			my - 
//-----------------------------------------------------------------------------
void mxExpressionTab::ShowRightClickMenu( int mx, int my )
{
	if ( !g_MDLViewer )
		return;

	mxPopupMenu *pop = new mxPopupMenu();
	Assert( pop );

	pop->add( "New...", IDC_EXPRESSIONS_NEW );
	pop->addSeparator ();
	pop->add( "Load...", IDC_EXPRESSIONS_LOAD );
	pop->add( "Save", IDC_EXPRESSIONS_SAVE );
	pop->addSeparator ();
	pop->add( "Export to VFE", IDC_EXPRESSIONS_EXPORT );
	pop->addSeparator ();
	if ( m_nSelected != -1 )
	{
		pop->add( "Close class", IDC_EXPRESSIONS_CLOSE );
	}
	pop->add( "Close all classes", IDC_EXPRESSIONS_CLOSEALL );
	pop->addSeparator();
	pop->add( "Recreate all bitmaps", IDC_EXPRESSIONS_REDOBITMAPS );

	// Convert click position
	POINT pt;
	pt.x = mx;
	pt.y = my;
	ClientToScreen( (HWND)getHandle(), &pt );
	ScreenToClient( (HWND)g_MDLViewer->getHandle(), &pt );

	// Convert coordinate space
	pop->popup( g_MDLViewer, pt.x, pt.y );
}

//-----------------------------------------------------------------------------
// Purpose: 
// Output : int	
//-----------------------------------------------------------------------------
int	mxExpressionTab::getSelectedIndex () const
{
	// Convert based on override index
	return m_nSelected;
}