Nuclide
Software Development Kit for id Technology (BETA)
Widget.h
1
5{
6public:
7 void vguiWidget(void);
8
10 virtual void Add(vguiWidget);
12 nonvirtual void FlagAdd(int);
14 nonvirtual void FlagRemove(int);
16 nonvirtual bool HasFlag(int);
17
19 nonvirtual void SetPos(vector);
21 nonvirtual vector GetPos(void);
23 nonvirtual int GetPosWidth(void);
25 nonvirtual int GetPosHeight(void);
26
28 nonvirtual void SetSize(vector);
30 nonvirtual vector GetSize(void);
31
33 nonvirtual int GetWidth(void);
35 nonvirtual int GetHeight(void);
36
38 nonvirtual void SetMinSize(vector);
40 nonvirtual vector GetMinSize(void);
41
43 nonvirtual void SetMaxSize(vector);
45 nonvirtual vector GetMaxSize(void);
46
48 nonvirtual bool Visible(void);
50 nonvirtual void Show(void);
52 nonvirtual void Hide(void);
53
55 nonvirtual void SetTheme(vguiTheme);
57 nonvirtual vguiTheme GetTheme(void);
58
60 virtual void PositionChanged(vector, vector);
62 virtual void SizeChanged(vector, vector);
63
64 virtual void NowVisible(void);
65 virtual void NowHidden(void);
66
68 virtual void Draw(void);
70 virtual void Reposition(void);
72 virtual bool Input(float, float, float, float);
76 virtual void Spawned(void);
77
78private:
79 /* why are these 3D vectors? because drawpic() etc. take it. ..you never know what that may be used for some day! */
80 vector m_vecOrigin;
81 vector m_vecSize;
82 vector m_vecMinSize;
83 vector m_vecMaxSize;
84
85 vguiWidget m_next;
86 vguiWidget m_parent;
87 vguiWidget m_children;
88 int m_iFlags;
89 bool m_bVisible;
90 vguiTheme m_theme;
91};
Abstract class than can be set/overriden to customize to final appearance of GUI widgets.
Definition: Theme.qc:54
The base VGUI widget class.
Definition: Widget.h:5
nonvirtual int GetPosHeight(void)
Returns the Y coordinate of the widget position within its context.
Definition: Widget.qc:105
virtual void Add(vguiWidget)
Adds a widget into this one.
Definition: Widget.qc:194
virtual bool Input(float, float, float, float)
Called whenever an input event gets directed to the widget.
Definition: Widget.qc:224
nonvirtual vector GetMaxSize(void)
Returns the maximum size of the widget.
Definition: Widget.qc:156
nonvirtual void SetPos(vector)
Set the position within its context.
Definition: Widget.qc:84
virtual void SizeChanged(vector, vector)
Called when the size of the widget has changed in any capacity.
Definition: Widget.qc:78
nonvirtual void FlagRemove(int)
Remove a flag from the widget.
Definition: Widget.qc:168
nonvirtual int GetHeight(void)
Returns the height of the widget, in pixels.
Definition: Widget.qc:132
nonvirtual int GetPosWidth(void)
Returns the X coordinate of the widget position within its context.
Definition: Widget.qc:99
nonvirtual void SetTheme(vguiTheme)
Sets the vguiTheme to use on this widget (and any children it may have)
Definition: Widget.qc:18
nonvirtual bool Visible(void)
Returns true/false depending on if the widget is visible.
Definition: Widget.qc:40
nonvirtual void SetMaxSize(vector)
Sets the maximum size of the widget.
Definition: Widget.qc:150
nonvirtual void Hide(void)
Hide the widget.
Definition: Widget.qc:46
nonvirtual bool HasFlag(int)
Check if the vguiWidget has a flag attached.
Definition: Widget.qc:174
virtual void Draw(void)
Called in order to draw the widget.
Definition: Widget.qc:209
nonvirtual int GetWidth(void)
Returns the width of the widget, in pixels.
Definition: Widget.qc:126
nonvirtual void FlagAdd(int)
Add a flag to the widget.
Definition: Widget.qc:162
nonvirtual vector GetPos(void)
Return the position of the widget within its context.
Definition: Widget.qc:93
nonvirtual void SetSize(vector)
Set the size of the widget to a new one.
Definition: Widget.qc:111
virtual void NowVisible(void)
Definition: Widget.qc:59
virtual void Reposition(void)
Called whenever the physical properties of the display change.
Definition: Widget.qc:180
nonvirtual vector GetSize(void)
Returns the size of the widget, in pixels.
Definition: Widget.qc:120
nonvirtual void Show(void)
Show the widget.
Definition: Widget.qc:65
nonvirtual vector GetMinSize(void)
Returns the minimum size of the widget.
Definition: Widget.qc:144
virtual void PositionChanged(vector, vector)
Called when the position of the widget was changed in any capacity.
Definition: Widget.qc:72
nonvirtual void SetMinSize(vector)
Sets the minimum size of the widget.
Definition: Widget.qc:138
void vguiWidget(void)
Definition: Widget.qc:2
nonvirtual vguiTheme GetTheme(void)
Returns the VGUI that will be used on this widget.
Definition: Widget.qc:24
virtual void NowHidden(void)
Definition: Widget.qc:53
virtual void Spawned(void)
Called when the widget has fully initialized.
Definition: Widget.qc:275