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.

42 lines
1.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "MenuDemo.h"
  8. class MenuDemo;
  9. using namespace vgui;
  10. class MenuDemo2 : public MenuDemo
  11. {
  12. public:
  13. MenuDemo2(Panel *parent, const char *name);
  14. };
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Constructor
  17. //-----------------------------------------------------------------------------
  18. MenuDemo2::MenuDemo2(Panel *parent, const char *name) : MenuDemo(parent, name)
  19. {
  20. // Set the number of items visible in the menu at one time to 5
  21. // If there are more than 5 items in the menu a scrollbar will
  22. // be added automatically
  23. m_pMenu->SetNumberOfVisibleItems(5);
  24. // Lets also make it so this menu opens up above the button
  25. // instead of below it
  26. m_pMenuButton->SetOpenDirection(Menu::UP);
  27. }
  28. Panel* MenuDemo2_Create(Panel *parent)
  29. {
  30. return new MenuDemo2(parent, "MenuDemo2");
  31. }