mirror of
https://github.com/unknownworlds/NS.git
synced 2024-12-21 01:41:13 +00:00
5dcc163bd5
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@379 67975925-1194-0748-b3d5-c16f83f1a3a1
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
#ifndef UICOMPONENT_H
|
|
#define UICOMPONENT_H
|
|
|
|
#include "textrep/TRDescription.h"
|
|
#include "VGUI_Panel.h"
|
|
class CSchemeManager;
|
|
|
|
using namespace vgui;
|
|
|
|
// Maintains the text representation of a component. This is a base class that other UI components will be extended
|
|
// from. It can read and write a description of the component, building the VGUI component in the process. At any time
|
|
// it can be bound to the Half-life engine or removed from it.
|
|
class UIComponent
|
|
{
|
|
public:
|
|
UIComponent(void);
|
|
|
|
// Destructor automatically removes component from the engine
|
|
virtual ~UIComponent(void);
|
|
|
|
bool AllocateAndSetProperties(const TRDescription& inDescription, CSchemeManager* inSchemeManager);
|
|
|
|
virtual Panel* GetComponentPointer(void) = 0;
|
|
|
|
// Used to save component back out again
|
|
TRDescription& GetDescription(void);
|
|
|
|
const TRDescription& GetDescription(void) const;
|
|
|
|
const string& GetName(void) const;
|
|
|
|
virtual const string& GetType(void) const = 0;
|
|
|
|
virtual bool SetClassProperties(const TRDescription& inDescription, Panel* inComponent, CSchemeManager* inSchemeManager);
|
|
|
|
void SetName(const string& inName);
|
|
|
|
virtual void Update(float theCurrentTime);
|
|
|
|
protected:
|
|
string mName;
|
|
|
|
string mType;
|
|
|
|
TRDescription mDescription;
|
|
|
|
private:
|
|
|
|
virtual void AllocateComponent(const TRDescription& inDescription) = 0;
|
|
|
|
|
|
};
|
|
|
|
#endif
|