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
42 lines
1.0 KiB
//========= Copyright Valve Corporation, All rights reserved. ============//
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================//
|
|
|
|
#include "MenuDemo.h"
|
|
|
|
class MenuDemo;
|
|
|
|
using namespace vgui;
|
|
|
|
|
|
class MenuDemo2 : public MenuDemo
|
|
{
|
|
public:
|
|
MenuDemo2(Panel *parent, const char *name);
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Purpose: Constructor
|
|
//-----------------------------------------------------------------------------
|
|
MenuDemo2::MenuDemo2(Panel *parent, const char *name) : MenuDemo(parent, name)
|
|
{
|
|
// Set the number of items visible in the menu at one time to 5
|
|
// If there are more than 5 items in the menu a scrollbar will
|
|
// be added automatically
|
|
m_pMenu->SetNumberOfVisibleItems(5);
|
|
|
|
// Lets also make it so this menu opens up above the button
|
|
// instead of below it
|
|
m_pMenuButton->SetOpenDirection(Menu::UP);
|
|
}
|
|
|
|
|
|
Panel* MenuDemo2_Create(Panel *parent)
|
|
{
|
|
return new MenuDemo2(parent, "MenuDemo2");
|
|
}
|
|
|
|
|