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.

62 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "hlfaceposer.h"
  8. #include "mxExpressionTab.h"
  9. #include "mdlviewer.h"
  10. #include "expressions.h"
  11. mxExpressionTab *g_pExpressionClass = 0;
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Right click context menu
  14. // Input : mx -
  15. // my -
  16. //-----------------------------------------------------------------------------
  17. void mxExpressionTab::ShowRightClickMenu( int mx, int my )
  18. {
  19. if ( !g_MDLViewer )
  20. return;
  21. mxPopupMenu *pop = new mxPopupMenu();
  22. Assert( pop );
  23. pop->add( "New...", IDC_EXPRESSIONS_NEW );
  24. pop->addSeparator ();
  25. pop->add( "Load...", IDC_EXPRESSIONS_LOAD );
  26. pop->add( "Save", IDC_EXPRESSIONS_SAVE );
  27. pop->addSeparator ();
  28. pop->add( "Export to VFE", IDC_EXPRESSIONS_EXPORT );
  29. pop->addSeparator ();
  30. if ( m_nSelected != -1 )
  31. {
  32. pop->add( "Close class", IDC_EXPRESSIONS_CLOSE );
  33. }
  34. pop->add( "Close all classes", IDC_EXPRESSIONS_CLOSEALL );
  35. pop->addSeparator();
  36. pop->add( "Recreate all bitmaps", IDC_EXPRESSIONS_REDOBITMAPS );
  37. // Convert click position
  38. POINT pt;
  39. pt.x = mx;
  40. pt.y = my;
  41. ClientToScreen( (HWND)getHandle(), &pt );
  42. ScreenToClient( (HWND)g_MDLViewer->getHandle(), &pt );
  43. // Convert coordinate space
  44. pop->popup( g_MDLViewer, pt.x, pt.y );
  45. }
  46. //-----------------------------------------------------------------------------
  47. // Purpose:
  48. // Output : int
  49. //-----------------------------------------------------------------------------
  50. int mxExpressionTab::getSelectedIndex () const
  51. {
  52. // Convert based on override index
  53. return m_nSelected;
  54. }