mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-04 18:09:53 +03:00
1
This commit is contained in:
42
utils/vgui_panel_zoo/MenuDemo2.cpp
Normal file
42
utils/vgui_panel_zoo/MenuDemo2.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
//========= 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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user