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);
18 nonvirtual bool IsEnabled(void);
19
21 nonvirtual void SetPos(vector);
23 nonvirtual vector GetPos(void);
25 nonvirtual int GetPosWidth(void);
27 nonvirtual int GetPosHeight(void);
28
30 nonvirtual void SetSize(vector);
32 nonvirtual vector GetSize(void);
33
35 nonvirtual int GetWidth(void);
37 nonvirtual int GetHeight(void);
38
40 nonvirtual void SetMinSize(vector);
42 nonvirtual vector GetMinSize(void);
43
45 nonvirtual void SetMaxSize(vector);
47 nonvirtual vector GetMaxSize(void);
48
50 nonvirtual bool Visible(void);
52 nonvirtual void Show(void);
54 nonvirtual void Hide(void);
55
57 nonvirtual void SetTheme(vguiTheme);
59 nonvirtual vguiTheme GetTheme(void);
60
62 virtual void PositionChanged(vector, vector);
64 virtual void SizeChanged(vector, vector);
65
66 virtual void NowVisible(void);
67 virtual void NowHidden(void);
68
70 nonvirtual void Enable(void);
72 nonvirtual void Disable(void);
73
74 virtual void NowEnabled(void);
75 virtual void NowDisabled(void);
76
78 virtual void Draw(void);
80 virtual void Reposition(void);
82 virtual bool Input(float, float, float, float);
86 virtual void Spawned(void);
87
88private:
89 /* why are these 3D vectors? because drawpic() etc. take it. ..you never know what that may be used for some day! */
90 vector m_vecOrigin;
91 vector m_vecSize;
92 vector m_vecMinSize;
93 vector m_vecMaxSize;
94
95 vguiWidget m_next;
96 vguiWidget m_parent;
97 vguiWidget m_children;
98 int m_iFlags;
99 bool m_bVisible;
100 bool m_bEnabled;
101 vguiTheme m_theme;
102};
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:134
virtual void Add(vguiWidget)
Adds a widget into this one.
Definition: Widget.qc:223
virtual bool Input(float, float, float, float)
Called whenever an input event gets directed to the widget.
Definition: Widget.qc:253
nonvirtual vector GetMaxSize(void)
Returns the maximum size of the widget.
Definition: Widget.qc:185
nonvirtual void SetPos(vector)
Set the position within its context.
Definition: Widget.qc:113
virtual void SizeChanged(vector, vector)
Called when the size of the widget has changed in any capacity.
Definition: Widget.qc:107
virtual void NowEnabled(void)
Definition: Widget.qc:43
nonvirtual void FlagRemove(int)
Remove a flag from the widget.
Definition: Widget.qc:197
nonvirtual int GetHeight(void)
Returns the height of the widget, in pixels.
Definition: Widget.qc:161
nonvirtual int GetPosWidth(void)
Returns the X coordinate of the widget position within its context.
Definition: Widget.qc:128
nonvirtual void SetTheme(vguiTheme)
Sets the vguiTheme to use on this widget (and any children it may have)
Definition: Widget.qc:19
nonvirtual bool Visible(void)
Returns true/false depending on if the widget is visible.
Definition: Widget.qc:69
nonvirtual void SetMaxSize(vector)
Sets the maximum size of the widget.
Definition: Widget.qc:179
nonvirtual void Hide(void)
Hide the widget.
Definition: Widget.qc:75
nonvirtual bool HasFlag(int)
Check if the vguiWidget has a flag attached.
Definition: Widget.qc:203
virtual void Draw(void)
Called in order to draw the widget.
Definition: Widget.qc:238
nonvirtual bool IsEnabled(void)
Returns if the widget is active.
Definition: Widget.qc:25
nonvirtual int GetWidth(void)
Returns the width of the widget, in pixels.
Definition: Widget.qc:155
nonvirtual void Disable(void)
Disable the widget.
Definition: Widget.qc:37
nonvirtual void FlagAdd(int)
Add a flag to the widget.
Definition: Widget.qc:191
nonvirtual vector GetPos(void)
Return the position of the widget within its context.
Definition: Widget.qc:122
nonvirtual void SetSize(vector)
Set the size of the widget to a new one.
Definition: Widget.qc:140
virtual void NowVisible(void)
Definition: Widget.qc:88
virtual void Reposition(void)
Called whenever the physical properties of the display change.
Definition: Widget.qc:209
nonvirtual vector GetSize(void)
Returns the size of the widget, in pixels.
Definition: Widget.qc:149
nonvirtual void Show(void)
Show the widget.
Definition: Widget.qc:94
virtual void NowDisabled(void)
Definition: Widget.qc:48
nonvirtual vector GetMinSize(void)
Returns the minimum size of the widget.
Definition: Widget.qc:173
virtual void PositionChanged(vector, vector)
Called when the position of the widget was changed in any capacity.
Definition: Widget.qc:101
nonvirtual void SetMinSize(vector)
Sets the minimum size of the widget.
Definition: Widget.qc:167
void vguiWidget(void)
Definition: Widget.qc:2
nonvirtual void Enable(void)
Enable the widget.
Definition: Widget.qc:31
nonvirtual vguiTheme GetTheme(void)
Returns the VGUI that will be used on this widget.
Definition: Widget.qc:53
virtual void NowHidden(void)
Definition: Widget.qc:82
virtual void Spawned(void)
Called when the widget has fully initialized.
Definition: Widget.qc:304