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
20 nonvirtual bool HasFocus(void);
21
23 nonvirtual void SetPos(vector);
25 nonvirtual vector GetPos(void);
27 nonvirtual int GetPosWidth(void);
29 nonvirtual int GetPosHeight(void);
30
31 nonvirtual vector GetAbsPos(void);
32
34 nonvirtual void SetSize(vector);
36 nonvirtual vector GetSize(void);
37
39 nonvirtual int GetWidth(void);
41 nonvirtual int GetHeight(void);
42
44 nonvirtual void SetMinSize(vector);
46 nonvirtual vector GetMinSize(void);
47
49 nonvirtual void SetMaxSize(vector);
51 nonvirtual vector GetMaxSize(void);
52
54 nonvirtual bool Visible(void);
56 nonvirtual void Show(void);
58 nonvirtual void Hide(void);
59
61 nonvirtual void SetTheme(vguiTheme);
63 nonvirtual vguiTheme GetTheme(void);
64
66 virtual void PositionChanged(vector, vector);
68 virtual void SizeChanged(vector, vector);
69
70 virtual void NowVisible(void);
71 virtual void NowHidden(void);
72
74 nonvirtual void Enable(void);
76 nonvirtual void Disable(void);
77
78 virtual void NowEnabled(void);
79 virtual void NowDisabled(void);
80
81 virtual void ReloadVideoResources(void);
82
84 virtual void Draw(void);
86 virtual void Reposition(void);
88 virtual bool Input(float, float, float, float);
92 virtual void Spawned(void);
93
95 virtual void OnRemove(void);
96
97 nonvirtual void Remove(void);
98
99 nonvirtual vguiWidget GetRootWindow(void);
100 nonvirtual vector GetMousePos(void);
101
102 nonvirtual bool MouseAbove(void);
103
104private:
105 /* why are these 3D vectors? because drawpic() etc. take it. ..you never know what that may be used for some day! */
106 vector m_vecOrigin;
107 vector m_vecSize;
108 vector m_vecMinSize;
109 vector m_vecMaxSize;
110
111 vguiWidget m_next;
112 vguiWidget m_parent;
113 vguiWidget m_children;
114
115 vguiWidget m_windowNext; /* for windows */
116 vguiWidget m_windowPrev; /* for windows 2 */
117 vguiWidget m_rootNext; /* for root windows */
118 vguiWidget m_rootPrev; /* for root windows 2 */
119 int m_iFlags;
120 bool m_bVisible;
121 bool m_bEnabled;
122 vguiTheme m_theme;
123};
Abstract class than can be set/overriden to customize to final appearance of GUI widgets.
Definition: Theme.qc:63
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:273
virtual void Add(vguiWidget)
Adds a widget into this one.
Definition: Widget.qc:354
virtual bool Input(float, float, float, float)
Called whenever an input event gets directed to the widget.
Definition: Widget.qc:366
nonvirtual vector GetMaxSize(void)
Returns the maximum size of the widget.
Definition: Widget.qc:324
nonvirtual void SetPos(vector)
Set the position within its context.
Definition: Widget.qc:242
virtual void SizeChanged(vector, vector)
Called when the size of the widget has changed in any capacity.
Definition: Widget.qc:236
virtual void NowEnabled(void)
Definition: Widget.qc:172
nonvirtual void FlagRemove(int)
Remove a flag from the widget.
Definition: Widget.qc:336
nonvirtual int GetHeight(void)
Returns the height of the widget, in pixels.
Definition: Widget.qc:300
nonvirtual int GetPosWidth(void)
Returns the X coordinate of the widget position within its context.
Definition: Widget.qc:267
nonvirtual void SetTheme(vguiTheme)
Sets the vguiTheme to use on this widget (and any children it may have)
Definition: Widget.qc:81
nonvirtual bool Visible(void)
Returns true/false depending on if the widget is visible.
Definition: Widget.qc:198
nonvirtual void SetMaxSize(vector)
Sets the maximum size of the widget.
Definition: Widget.qc:318
nonvirtual void Hide(void)
Hide the widget.
Definition: Widget.qc:204
nonvirtual bool HasFlag(int)
Check if the vguiWidget has a flag attached.
Definition: Widget.qc:342
nonvirtual bool HasFocus(void)
Definition: Widget.qc:148
virtual void Draw(void)
Called in order to draw the widget.
Definition: Widget.qc:360
nonvirtual bool IsEnabled(void)
Returns if the widget is active.
Definition: Widget.qc:87
nonvirtual int GetWidth(void)
Returns the width of the widget, in pixels.
Definition: Widget.qc:294
nonvirtual void Disable(void)
Disable the widget.
Definition: Widget.qc:166
nonvirtual void FlagAdd(int)
Add a flag to the widget.
Definition: Widget.qc:330
nonvirtual vector GetAbsPos(void)
Definition: Widget.qc:251
virtual void ReloadVideoResources(void)
Definition: Widget.qc:75
nonvirtual vector GetPos(void)
Return the position of the widget within its context.
Definition: Widget.qc:261
nonvirtual void SetSize(vector)
Set the size of the widget to a new one.
Definition: Widget.qc:279
virtual void NowVisible(void)
Definition: Widget.qc:217
virtual void Reposition(void)
Called whenever the physical properties of the display change.
Definition: Widget.qc:348
nonvirtual vector GetSize(void)
Returns the size of the widget, in pixels.
Definition: Widget.qc:288
nonvirtual void Show(void)
Show the widget.
Definition: Widget.qc:223
virtual void NowDisabled(void)
Definition: Widget.qc:177
nonvirtual vguiWidget GetRootWindow(void)
Definition: Widget.qc:156
nonvirtual vector GetMinSize(void)
Returns the minimum size of the widget.
Definition: Widget.qc:312
virtual void PositionChanged(vector, vector)
Called when the position of the widget was changed in any capacity.
Definition: Widget.qc:230
virtual void OnRemove(void)
Called when the widget gets removed, destroyed.
Definition: Widget.qc:105
nonvirtual bool MouseAbove(void)
Definition: Widget.qc:124
nonvirtual void SetMinSize(vector)
Sets the minimum size of the widget.
Definition: Widget.qc:306
void vguiWidget(void)
Definition: Widget.qc:49
nonvirtual void Enable(void)
Enable the widget.
Definition: Widget.qc:93
nonvirtual vguiTheme GetTheme(void)
Returns the VGUI that will be used on this widget.
Definition: Widget.qc:182
nonvirtual void Remove(void)
Definition: Widget.qc:139
virtual void NowHidden(void)
Definition: Widget.qc:211
virtual void Spawned(void)
Called when the widget has fully initialized.
Definition: Widget.qc:372
nonvirtual vector GetMousePos(void)
Definition: Widget.qc:131