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;
178 CLASS_PROTOTYPE(UIWidget);
180 void (*m_commandhandler)(
const char *,
void *);
183 bool addChild(UIWidget *widget);
184 bool removeChild(UIWidget *widget);
185 void PropogateCoordinateSystem(
void);
187 virtual void Draw(
void);
188 virtual void FrameInitialized(
void);
189 void DrawTitle(
float x,
float y);
191 virtual void AlignPosition(
void);
192 void Hide(Event *ev);
193 void Activate(Event *ev);
194 void BringToFront(
void);
195 static void SplitWidgets(
201 static void CombineWidgets(
213 virtual void Shutdown(
void);
214 virtual void InitFrame(
215 UIWidget *parentview,
221 const char *fontname =
"verdana-12"
223 void InitFrame(UIWidget *parentview,
const UIRect2D& r,
int border,
const char *fontname =
"verdana-12");
224 void LayoutSize(Event *ev);
225 void LayoutRect(Event *ev);
226 void LayoutName(Event *ev);
227 void LayoutTitle(Event *ev);
228 void LayoutFont(Event *ev);
229 void LayoutBgColor(Event *ev);
230 void LayoutFgColor(Event *ev);
231 void LayoutBorderStyle(Event *ev);
232 void LayoutBorderColor(Event *ev);
233 void LayoutShader(Event *ev);
234 void LayoutTileShader(Event *ev);
235 void LayoutHoverShader(Event *ev);
236 void LayoutPressedShader(Event *ev);
237 void LayoutFadeIn(Event *ev);
238 void LayoutStopSound(Event *ev);
239 void LayoutClickSound(Event *ev);
240 void LayoutStretch(Event *ev);
241 void LayoutVirtualRes(Event *ev);
242 void LayoutInitData(Event *ev);
243 void LayoutDirection(Event *ev);
244 void LayoutAlign(Event *ev);
245 void LayoutStuffCommand(Event *ev);
246 void LayoutLinkCvar(Event *ev);
247 void LayoutNoParentClipping(Event *ev);
248 void LayoutNoParentAdjustment(Event *ev);
249 void LayoutOrderNumber(Event *ev);
250 void TextAlignment(Event *ev);
251 void LayoutAliasCache(Event *ev);
252 void SetEnabledCvar(Event *ev);
253 void SetScaleCvar(Event *ev);
257 void SetDontLocalize(Event *ev);
258 void EventFadeSequence(Event *ev);
261 void SetVirtualScale(vec2_t out);
262 void SetDontLocalize();
263 void setParent(UIWidget *parent);
264 class UIWidget *getParent(
void);
265 class UIWidget *getFirstChild(
void);
266 class UIWidget *getNextSibling(
void);
267 class UIWidget *getNextChild(UIWidget *child);
268 class UIWidget *getPrevChild(UIWidget *child);
269 class UIWidget *getPrevSibling(
void);
270 class UIWidget *getPrevSibling(UIWidget *curr);
271 class UIWidget *getLastSibling(
void);
272 class UIWidget *findSibling(str name);
276 bool isEnabled(
void);
278 class UIWidget *FindResponder(
const UIPoint2D& pos);
279 void setFont(
const char *name);
280 void setFontHorizontalAlignment(fonthorzjustify_t alignment);
281 void setFontVerticalAlignment(fontvertjustify_t alignment);
282 void setShow(
bool visible);
284 class UColor getBackgroundColor(void);
285 virtual void setBackgroundColor(
const UColor& color,
bool setbordercolor);
288 class UColor getForegroundColor(void);
289 virtual void setForegroundColor(
const UColor& color);
290 borderstyle_t getBorderStyle(
void);
291 void setBorderStyle(borderstyle_t style);
293 void setSize(
const UISize2D& newsize);
295 void setFrame(
const UIRect2D& newframe);
297 void setOrigin(
const UIPoint2D& neworigin);
298 void setName(str name);
299 const char *getName(
void);
300 void setTitle(str title);
301 const char *getTitle(
void);
302 void setDirection(direction_t dir);
303 direction_t getDirection(
void);
304 void setMotionType(motion_t type);
305 motion_t getMotionType(
void);
306 void setMotionTime(
float time);
307 float getMotionTime(
void);
308 void setAlign(
int align);
315 virtual void setBackgroundAlpha(
float f);
316 float getBackgroundAlpha(
void);
317 void Display(
const UIRect2D& drawframe,
float parent_alpha);
318 virtual qboolean KeyEvent(
int key,
unsigned int time);
319 virtual void CharEvent(
int ch);
320 virtual void UpdateData(
void);
321 virtual void UpdateUIElement(
void);
322 float getTitleWidth(
void);
323 float getTitleHeight(
void);
324 bool CanActivate(
void);
325 void AllowActivate(
bool canactivate);
327 bool IsVisible(
void);
328 virtual void LinkCvar(str cvarname);
329 void LinkCommand(str cmd);
330 void ExecuteShowCommands(
void);
331 void ExecuteHideCommands(
void);
332 void InitializeCommandHandler(
void (*fcn)(
const char *,
void *));
333 class UIWidget *FindWidget(str name);
334 void ResetMotion(motion_t type);
335 virtual void Realign(
void);
336 void BringToFrontPropogated(
void);
337 class UIWidget *IsThisOrChildActive(
void);
338 class UIPoint2D MouseEventToClientPoint(Event *ev);
339 class UIRect2D getClientFrame(void);
340 void setAlwaysOnBottom(
bool b);
341 void setAlwaysOnTop(
bool b);
342 bool getAlwaysOnBottom(
void);
343 bool getAlwaysOnTop(
void);
344 bool SendSignal(Event& event);
345 void ShowCommand(Event *ev);
346 void HideCommand(Event *ev);
347 void AddFlag(
int flag);
348 void SetHovermaterialActive(
bool a);
349 void SetPressedmaterialActive(
bool a);
350 int getOrderNum(
void);
351 class str getCommand(void);
352 void ActivateOrder(
void);
353 void EnableEvent(Event *ev);
354 void DisableEvent(Event *ev);
355 void setConfigstringIndex(
int cs);
356 int getConfigstringIndex(
void);
357 bool PassEventToWidget(str name, Event *ev);
361 bool isVirtual()
const;
362 const vec2_t& getVirtualScale()
const;
363 const vec2_t& getHighResScale()
const;