CBaseModFrame

From Valve Developer Community
Revision as of 02:14, 25 July 2010 by TomEdwards (talk | contribs) (Created page with ''''<code>CBaseModFrame</code>''' is the basic C++ class that each user interface panel in L4D-branch GameUI inherits from. == Simple example == <source lang=cpp> #include "…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CBaseModFrame is the basic C++ class that each user interface panel in L4D-branch GameUI inherits from.

Simple example

#include "gameui\swarm\basemodui.h"

using namespace BaseModUI;

class MyWindow : public CBaseModFrame
{
	DECLARE_CLASS_SIMPLE( MyWindow, CBaseModFrame );

public:
	MyWindow(vgui::Panel *parent, const char *panelName):BaseClass(parent, panelName) { }
};

A "MyWindow.res" layout script is also required in resource\ui\basemodui\:

Resource/UI/MyWindow.res
{
	MyWindow
	{
		ControlName		Frame
		fieldName		MyWindow
		xpos			c
		ypos			c
		wide			1024
		tall			768
		autoResize		0
		pinCorner		0
		visible			1
		enabled			1
		tabPosition		0
		usetitlesafe		1
	}
}

Key functions

  • void OnOpen()
  • void OnClose()
  • void SetDataSettings(KeyValues*)
  • CBaseModFrame* SetNavBack(CBaseModFrame*)
  • CBaseModFrame* GetNavBack()
  • void PushModalInputFocus()
    • void PopModalInputFocus()
  • void RunFrame()
  • void AddFrameListener(IBaseModFrameListener*)
    • void RemoveFrameListener(IBaseModFrameListener*)
    • void RunFrameOnListeners()

See also