102 friend class UILayout;
103 friend class UIWindowManager;
107 vec2_t m_vVirtualScale;
114 UColor m_background_color;
115 UColor m_foreground_color;
117 borderstyle_t m_borderStyle;
121 class UIWidget *m_parent;
132 float m_bottomindent;
136 bool m_hovermaterial_active;
137 bool m_pressedmaterial_active;
138 direction_t m_direction;
139 direction_t m_direction_orig;
140 motion_t m_motiontype;
146 float m_fadeSequenceDelay;
147 float m_fadeSequenceFadeIn;
148 float m_fadeSequenceHold;
149 float m_fadeSequenceFadeOut;
150 float m_fadeSequenceRemainingTime;
151 float m_fadeSequenceLastTime;
152 int m_fadeSequenceState;
159 int m_configstring_index;
160 fonthorzjustify_t m_iFontAlignmentHorizontal;
161 fontvertjustify_t m_iFontAlignmentVertical;
170 CLASS_PROTOTYPE( UIWidget );
172 void( *m_commandhandler ) (
const char *,
void * );
175 bool addChild( UIWidget *widget );
176 bool removeChild( UIWidget *widget );
177 void PropogateCoordinateSystem(
void );
179 virtual void Draw(
void );
180 virtual void FrameInitialized(
void );
181 void DrawTitle(
float x,
float y );
183 virtual void AlignPosition(
void );
184 void Hide(
Event *ev );
185 void Activate(
Event *ev );
186 void BringToFront(
void );
196 virtual void Shutdown(
void );
197 virtual void InitFrame( UIWidget *parentview,
float x,
float y,
float width,
float height,
int border = -1,
const char *fontname =
"verdana-12" );
198 void InitFrame( UIWidget *parentview,
const UIRect2D& r,
int border,
const char *fontname =
"verdana-12" );
199 void LayoutSize(
Event *ev );
200 void LayoutRect(
Event *ev );
201 void LayoutName(
Event *ev );
202 void LayoutTitle(
Event *ev );
203 void LayoutFont(
Event *ev );
204 void LayoutBgColor(
Event *ev );
205 void LayoutFgColor(
Event *ev );
206 void LayoutBorderStyle(
Event *ev );
207 void LayoutBorderColor(
Event *ev );
208 void LayoutShader(
Event *ev );
209 void LayoutTileShader(
Event *ev );
210 void LayoutHoverShader(
Event *ev );
211 void LayoutPressedShader(
Event *ev );
212 void LayoutFadeIn(
Event *ev );
213 void LayoutStopSound(
Event *ev );
214 void LayoutClickSound(
Event *ev );
215 void LayoutStretch(
Event *ev );
216 void LayoutVirtualRes(
Event *ev );
217 void LayoutInitData(
Event *ev );
218 void LayoutDirection(
Event *ev );
219 void LayoutAlign(
Event *ev );
220 void LayoutStuffCommand(
Event *ev );
221 void LayoutLinkCvar(
Event *ev );
222 void LayoutNoParentClipping(
Event *ev );
223 void LayoutNoParentAdjustment(
Event *ev );
224 void LayoutOrderNumber(
Event *ev );
225 void TextAlignment(
Event *ev );
226 void LayoutAliasCache(
Event *ev );
227 void SetEnabledCvar(
Event *ev );
228 void SetScaleCvar(
Event *ev );
232 void SetDontLocalize(
Event *ev );
233 void EventFadeSequence(
Event *ev );
236 void SetVirtualScale(vec2_t out);
237 void SetDontLocalize();
238 void setParent( UIWidget *parent );
239 class UIWidget *getParent(
void );
240 class UIWidget *getFirstChild(
void );
241 class UIWidget *getNextSibling(
void );
242 class UIWidget *getNextChild( UIWidget *child );
243 class UIWidget *getPrevChild( UIWidget *child );
244 class UIWidget *getPrevSibling(
void );
245 class UIWidget *getPrevSibling( UIWidget *curr );
246 class UIWidget *getLastSibling(
void );
247 class UIWidget *findSibling(
str name );
250 void Disable(
void );
251 bool isEnabled(
void );
252 bool IsDying(
void );
253 class UIWidget *FindResponder(
const UIPoint2D& pos );
254 void setFont(
const char *name );
255 void setFontHorizontalAlignment( fonthorzjustify_t alignment );
256 void setFontVerticalAlignment( fontvertjustify_t alignment );
257 void setShow(
bool visible );
258 bool getShow(
void );
259 class UColor getBackgroundColor( void );
260 virtual void setBackgroundColor(
const UColor& color,
bool setbordercolor );
263 class UColor getForegroundColor( void );
264 virtual void setForegroundColor(
const UColor& color );
265 borderstyle_t getBorderStyle(
void );
266 void setBorderStyle( borderstyle_t style );
268 void setSize(
const UISize2D& newsize );
270 void setFrame(
const UIRect2D& newframe );
272 void setOrigin(
const UIPoint2D& neworigin );
273 void setName(
str name );
274 const char *getName(
void );
275 void setTitle(
str title );
276 const char *getTitle(
void );
277 void setDirection( direction_t dir );
278 direction_t getDirection(
void );
279 void setMotionType( motion_t type );
280 motion_t getMotionType(
void );
281 void setMotionTime(
float time );
282 float getMotionTime(
void );
283 void setAlign(
int align );
284 int getAlign(
void );
290 virtual void setBackgroundAlpha(
float f );
291 float getBackgroundAlpha(
void );
292 void Display(
const UIRect2D& drawframe,
float parent_alpha );
293 virtual qboolean KeyEvent(
int key,
unsigned int time );
294 virtual void CharEvent(
int ch );
295 virtual void UpdateData(
void );
296 virtual void UpdateUIElement(
void );
297 float getTitleWidth(
void );
298 float getTitleHeight(
void );
299 bool CanActivate(
void );
300 void AllowActivate(
bool canactivate );
301 bool IsActive(
void );
302 bool IsVisible(
void );
303 virtual void LinkCvar(
str cvarname );
304 void LinkCommand(
str cmd );
305 void ExecuteShowCommands(
void );
306 void ExecuteHideCommands(
void );
307 void InitializeCommandHandler(
void( *fcn) (
const char *,
void * ) );
308 class UIWidget *FindWidget(
str name );
309 void ResetMotion( motion_t type );
310 virtual void Realign(
void );
311 void BringToFrontPropogated(
void );
312 class UIWidget *IsThisOrChildActive(
void );
314 class UIRect2D getClientFrame( void );
315 void setAlwaysOnBottom(
bool b );
316 void setAlwaysOnTop(
bool b );
317 bool getAlwaysOnBottom(
void );
318 bool getAlwaysOnTop(
void );
319 bool SendSignal(
Event& event );
320 void ShowCommand(
Event *ev );
321 void HideCommand(
Event *ev );
322 void AddFlag(
int flag );
323 void SetHovermaterialActive(
bool a );
324 void SetPressedmaterialActive(
bool a );
325 int getOrderNum(
void );
326 class str getCommand( void );
327 void ActivateOrder(
void );
328 void EnableEvent(
Event *ev );
329 void DisableEvent(
Event *ev );
330 void setConfigstringIndex(
int cs );
331 int getConfigstringIndex(
void );
332 bool PassEventToWidget(
str name,
Event *ev );
336 bool isVirtual()
const;
337 const vec2_t& getVirtualScale()
const;
338 const vec2_t& getHighResScale()
const;
341class UIWidgetContainer :
public UIWidget {
343 qboolean m_fullscreen;
349 class UILayout *m_layout;
351 CLASS_PROTOTYPE( UIWidgetContainer );
354 void AlignPosition(
void )
override;
355 void Draw(
void )
override;
360 void Realign(
void )
override;
361 void SetBGFill(
Event *ev );
362 void SetFullscreen(
Event *ev );
363 void SetVidMode(
Event *ev );
364 int getVidMode(
void );
365 qboolean isFullscreen(
void );
366 UIWidget *GetNextWidgetInOrder(
void );
367 UIWidget *GetPrevWidgetInOrder(
void );
368 void SetActiveWidgetOrderNum( UIWidget *wid );
369 void SetActiveWidgetOrderNum(
int num );
370 void SetLastActiveWidgetOrderNum(
void );