105 friend class UILayout;
106 friend class UIWindowManager;
110 vec2_t m_vVirtualScale;
117 UColor m_background_color;
118 UColor m_foreground_color;
120 borderstyle_t m_borderStyle;
124 class UIWidget *m_parent;
135 float m_bottomindent;
139 bool m_hovermaterial_active;
140 bool m_pressedmaterial_active;
141 direction_t m_direction;
142 direction_t m_direction_orig;
143 motion_t m_motiontype;
149 float m_fadeSequenceDelay;
150 float m_fadeSequenceFadeIn;
151 float m_fadeSequenceHold;
152 float m_fadeSequenceFadeOut;
153 float m_fadeSequenceRemainingTime;
154 float m_fadeSequenceLastTime;
155 int m_fadeSequenceState;
162 int m_configstring_index;
163 fonthorzjustify_t m_iFontAlignmentHorizontal;
164 fontvertjustify_t m_iFontAlignmentVertical;
173 CLASS_PROTOTYPE(UIWidget);
175 void (*m_commandhandler)(
const char *,
void *);
178 bool addChild(UIWidget *widget);
179 bool removeChild(UIWidget *widget);
180 void PropogateCoordinateSystem(
void);
182 virtual void Draw(
void);
183 virtual void FrameInitialized(
void);
184 void DrawTitle(
float x,
float y);
186 virtual void AlignPosition(
void);
187 void Hide(
Event *ev);
188 void Activate(
Event *ev);
189 void BringToFront(
void);
190 static void SplitWidgets(
196 static void CombineWidgets(
208 virtual void Shutdown(
void);
209 virtual void InitFrame(
210 UIWidget *parentview,
216 const char *fontname =
"verdana-12"
218 void InitFrame(UIWidget *parentview,
const UIRect2D& r,
int border,
const char *fontname =
"verdana-12");
219 void LayoutSize(
Event *ev);
220 void LayoutRect(
Event *ev);
221 void LayoutName(
Event *ev);
222 void LayoutTitle(
Event *ev);
223 void LayoutFont(
Event *ev);
224 void LayoutBgColor(
Event *ev);
225 void LayoutFgColor(
Event *ev);
226 void LayoutBorderStyle(
Event *ev);
227 void LayoutBorderColor(
Event *ev);
228 void LayoutShader(
Event *ev);
229 void LayoutTileShader(
Event *ev);
230 void LayoutHoverShader(
Event *ev);
231 void LayoutPressedShader(
Event *ev);
232 void LayoutFadeIn(
Event *ev);
233 void LayoutStopSound(
Event *ev);
234 void LayoutClickSound(
Event *ev);
235 void LayoutStretch(
Event *ev);
236 void LayoutVirtualRes(
Event *ev);
237 void LayoutInitData(
Event *ev);
238 void LayoutDirection(
Event *ev);
239 void LayoutAlign(
Event *ev);
240 void LayoutStuffCommand(
Event *ev);
241 void LayoutLinkCvar(
Event *ev);
242 void LayoutNoParentClipping(
Event *ev);
243 void LayoutNoParentAdjustment(
Event *ev);
244 void LayoutOrderNumber(
Event *ev);
245 void TextAlignment(
Event *ev);
246 void LayoutAliasCache(
Event *ev);
247 void SetEnabledCvar(
Event *ev);
248 void SetScaleCvar(
Event *ev);
252 void SetDontLocalize(
Event *ev);
253 void EventFadeSequence(
Event *ev);
256 void SetVirtualScale(vec2_t out);
257 void SetDontLocalize();
258 void setParent(UIWidget *parent);
259 class UIWidget *getParent(
void);
260 class UIWidget *getFirstChild(
void);
261 class UIWidget *getNextSibling(
void);
262 class UIWidget *getNextChild(UIWidget *child);
263 class UIWidget *getPrevChild(UIWidget *child);
264 class UIWidget *getPrevSibling(
void);
265 class UIWidget *getPrevSibling(UIWidget *curr);
266 class UIWidget *getLastSibling(
void);
267 class UIWidget *findSibling(
str name);
271 bool isEnabled(
void);
273 class UIWidget *FindResponder(
const UIPoint2D& pos);
274 void setFont(
const char *name);
275 void setFontHorizontalAlignment(fonthorzjustify_t alignment);
276 void setFontVerticalAlignment(fontvertjustify_t alignment);
277 void setShow(
bool visible);
279 class UColor getBackgroundColor(void);
280 virtual void setBackgroundColor(
const UColor& color,
bool setbordercolor);
283 class UColor getForegroundColor(void);
284 virtual void setForegroundColor(
const UColor& color);
285 borderstyle_t getBorderStyle(
void);
286 void setBorderStyle(borderstyle_t style);
288 void setSize(
const UISize2D& newsize);
290 void setFrame(
const UIRect2D& newframe);
292 void setOrigin(
const UIPoint2D& neworigin);
293 void setName(
str name);
294 const char *getName(
void);
295 void setTitle(
str title);
296 const char *getTitle(
void);
297 void setDirection(direction_t dir);
298 direction_t getDirection(
void);
299 void setMotionType(motion_t type);
300 motion_t getMotionType(
void);
301 void setMotionTime(
float time);
302 float getMotionTime(
void);
303 void setAlign(
int align);
310 virtual void setBackgroundAlpha(
float f);
311 float getBackgroundAlpha(
void);
312 void Display(
const UIRect2D& drawframe,
float parent_alpha);
313 virtual qboolean KeyEvent(
int key,
unsigned int time);
314 virtual void CharEvent(
int ch);
315 virtual void UpdateData(
void);
316 virtual void UpdateUIElement(
void);
317 float getTitleWidth(
void);
318 float getTitleHeight(
void);
319 bool CanActivate(
void);
320 void AllowActivate(
bool canactivate);
322 bool IsVisible(
void);
323 virtual void LinkCvar(
str cvarname);
324 void LinkCommand(
str cmd);
325 void ExecuteShowCommands(
void);
326 void ExecuteHideCommands(
void);
327 void InitializeCommandHandler(
void (*fcn)(
const char *,
void *));
328 class UIWidget *FindWidget(
str name);
329 void ResetMotion(motion_t type);
330 virtual void Realign(
void);
331 void BringToFrontPropogated(
void);
332 class UIWidget *IsThisOrChildActive(
void);
334 class UIRect2D getClientFrame(void);
335 void setAlwaysOnBottom(
bool b);
336 void setAlwaysOnTop(
bool b);
337 bool getAlwaysOnBottom(
void);
338 bool getAlwaysOnTop(
void);
339 bool SendSignal(
Event& event);
340 void ShowCommand(
Event *ev);
341 void HideCommand(
Event *ev);
342 void AddFlag(
int flag);
343 void SetHovermaterialActive(
bool a);
344 void SetPressedmaterialActive(
bool a);
345 int getOrderNum(
void);
346 class str getCommand(void);
347 void ActivateOrder(
void);
348 void EnableEvent(
Event *ev);
349 void DisableEvent(
Event *ev);
350 void setConfigstringIndex(
int cs);
351 int getConfigstringIndex(
void);
352 bool PassEventToWidget(
str name,
Event *ev);
356 bool isVirtual()
const;
357 const vec2_t& getVirtualScale()
const;
358 const vec2_t& getHighResScale()
const;
361class UIWidgetContainer :
public UIWidget
364 qboolean m_fullscreen;
370 class UILayout *m_layout;
372 CLASS_PROTOTYPE(UIWidgetContainer);
375 void AlignPosition(
void)
override;
376 void Draw(
void)
override;
381 void Realign(
void)
override;
382 void SetBGFill(
Event *ev);
383 void SetFullscreen(
Event *ev);
384 void SetVidMode(
Event *ev);
385 int getVidMode(
void);
386 qboolean isFullscreen(
void);
387 UIWidget *GetNextWidgetInOrder(
void);
388 UIWidget *GetPrevWidgetInOrder(
void);
389 void SetActiveWidgetOrderNum(UIWidget *wid);
390 void SetActiveWidgetOrderNum(
int num);
391 void SetLastActiveWidgetOrderNum(
void);