Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
W3DGameWindow Class Reference

#include <W3DGameWindow.h>

Inherits GameWindow.

Public Member Functions

 W3DGameWindow (void)
 
void winDrawBorder (void)
 draw borders for this window only, NO child windows or anything else
 
Int winSetPosition (Int x, Int y)
 set window position
 
Int winSetText (UnicodeString newText)
 set text string
 
void winSetFont (GameFont *font)
 set font for window
 
void getTextSize (Int *width, Int *height)
 get size of text
 
void setTextLoc (Int x, Int y)
 set text screen coord loc
 
void drawText (Color color)
 draw text in the text renderer
 
- Public Member Functions inherited from GameWindow
 GameWindow (void)
 
Int winSetWindowId (Int id)
 set id for this window
 
Int winGetWindowId (void)
 return window id for this window
 
Int winSetSize (Int width, Int height)
 set size
 
Int winGetSize (Int *width, Int *height)
 return size
 
Int winActivate (void)
 pop window to top of list and activate
 
Int winBringToTop (void)
 bring this window to the top of the win list
 
Int winEnable (Bool enable)
 
Bool winGetEnabled (void)
 Is window enabled?
 
Int winHide (Bool hide)
 hide/unhide a window
 
Bool winIsHidden (void)
 is this window hidden/
 
UnsignedInt winSetStatus (UnsignedInt status)
 set status bits
 
UnsignedInt winClearStatus (UnsignedInt status)
 clear status bits
 
UnsignedInt winGetStatus (void)
 get status bits
 
UnsignedInt winGetStyle (void)
 get style bits
 
Int winNextTab (void)
 advance focus to next window
 
Int winPrevTab (void)
 change focus to previous window
 
Int winSetPosition (Int x, Int y)
 set window position
 
Int winGetPosition (Int *x, Int *y)
 get window position
 
Int winGetScreenPosition (Int *x, Int *y)
 get screen coordinates
 
Int winGetRegion (IRegion2D *region)
 get window region
 
Int winSetCursorPosition (Int x, Int y)
 set window cursor position
 
Int winGetCursorPosition (Int *x, Int *y)
 get window cursor position
 
Int winSetEnabledImage (Int index, const Image *image)
 
Int winSetEnabledColor (Int index, Color color)
 
Int winSetEnabledBorderColor (Int index, Color color)
 
const ImagewinGetEnabledImage (Int index)
 
Color winGetEnabledColor (Int index)
 
Color winGetEnabledBorderColor (Int index)
 
Int winSetDisabledImage (Int index, const Image *image)
 
Int winSetDisabledColor (Int index, Color color)
 
Int winSetDisabledBorderColor (Int index, Color color)
 
const ImagewinGetDisabledImage (Int index)
 
Color winGetDisabledColor (Int index)
 
Color winGetDisabledBorderColor (Int index)
 
Int winSetHiliteImage (Int index, const Image *image)
 
Int winSetHiliteColor (Int index, Color color)
 
Int winSetHiliteBorderColor (Int index, Color color)
 
const ImagewinGetHiliteImage (Int index)
 
Color winGetHiliteColor (Int index)
 
Color winGetHiliteBorderColor (Int index)
 
Int winDrawWindow (void)
 draws the default background
 
void winSetDrawOffset (Int x, Int y)
 set offset for drawing background image data
 
void winGetDrawOffset (Int *x, Int *y)
 get draw offset
 
void winSetHiliteState (Bool state)
 set hilite state
 
void winSetTooltip (UnicodeString tip)
 set tooltip text
 
Int getTooltipDelay ()
 get tooltip delay
 
void setTooltipDelay (Int delay)
 set tooltip delay
 
UnicodeString winGetText (void)
 get text string
 
Int winGetTextLength ()
 get number of chars in text string
 
GameFontwinGetFont (void)
 get the font being used by this window
 
void winSetEnabledTextColors (Color color, Color borderColor)
 
void winSetDisabledTextColors (Color color, Color borderColor)
 
void winSetIMECompositeTextColors (Color color, Color borderColor)
 
void winSetHiliteTextColors (Color color, Color borderColor)
 
Color winGetEnabledTextColor (void)
 
Color winGetEnabledTextBorderColor (void)
 
Color winGetDisabledTextColor (void)
 
Color winGetDisabledTextBorderColor (void)
 
Color winGetIMECompositeTextColor (void)
 
Color winGetIMECompositeBorderColor (void)
 
Color winGetHiliteTextColor (void)
 
Color winGetHiliteTextBorderColor (void)
 
Int winSetInstanceData (WinInstanceData *data)
 copy over instance data
 
WinInstanceDatawinGetInstanceData (void)
 get instance data
 
void * winGetUserData (void)
 get the window user data
 
void winSetUserData (void *userData)
 set the user data
 
Int winSetParent (GameWindow *parent)
 set parent
 
GameWindowwinGetParent (void)
 get parent
 
Bool winIsChild (GameWindow *child)
 verifies parent
 
GameWindowwinGetChild (void)
 get the child window
 
Int winSetOwner (GameWindow *owner)
 set owner
 
GameWindowwinGetOwner (void)
 get window's owner
 
void winSetNext (GameWindow *next)
 set next pointer
 
void winSetPrev (GameWindow *prev)
 set prev pointer
 
GameWindowwinGetNext (void)
 get next window in window list
 
GameWindowwinGetPrev (void)
 get previous window in window list
 
void winSetNextInLayout (GameWindow *next)
 set next in layout
 
void winSetPrevInLayout (GameWindow *prev)
 set prev in layout
 
void winSetLayout (WindowLayout *layout)
 set layout
 
WindowLayoutwinGetLayout (void)
 get layout layout
 
GameWindowwinGetNextInLayout (void)
 get next window in layout
 
GameWindowwinGetPrevInLayout (void)
 get prev window in layout
 
Int winSetSystemFunc (GameWinSystemFunc system)
 set system
 
Int winSetInputFunc (GameWinInputFunc input)
 set input
 
Int winSetDrawFunc (GameWinDrawFunc draw)
 set draw
 
Int winSetTooltipFunc (GameWinTooltipFunc tooltip)
 set tooltip
 
Int winSetCallbacks (GameWinInputFunc input, GameWinDrawFunc draw, GameWinTooltipFunc tooltip)
 set draw, input, tooltip
 
Bool winPointInWindow (Int x, Int y)
 
GameWindowwinPointInChild (Int x, Int y, Bool ignoreEnableCheck=FALSE, Bool playDisabledSound=FALSE)
 
GameWindowwinPointInAnyChild (Int x, Int y, Bool ignoreHidden, Bool ignoreEnableCheck=FALSE)
 
GameWinInputFunc winGetInputFunc (void)
 
GameWinSystemFunc winGetSystemFunc (void)
 
GameWinDrawFunc winGetDrawFunc (void)
 
GameWinTooltipFunc winGetTooltipFunc (void)
 
void winSetEditData (GameWindowEditData *editData)
 
GameWindowEditDatawinGetEditData (void)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 

Protected Member Functions

void blitBorderRect (Int x, Int y, Int width, Int height)
 helper function to draw borders
 
- Protected Member Functions inherited from GameWindow
void freeImages (void)
 'images' should be taken care of when we hide ourselves or are destroyed
 
Bool isEnabled (void)
 see if we and our parents are enabled
 
void normalizeWindowRegion (void)
 put UL corner in window region.lo
 
GameWindowfindFirstLeaf (void)
 return first leaf of branch
 
GameWindowfindLastLeaf (void)
 return last leaf of branch
 
GameWindowfindPrevLeaf (void)
 return prev leav in tree
 
GameWindowfindNextLeaf (void)
 return next leaf in tree
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Protected Attributes

Render2DSentenceClass m_textRenderer
 for drawing text
 
ICoord2D m_textPos
 current text pos set in text renderer
 
Color m_currTextColor
 current color used in text renderer
 
Bool m_needPolyDraw
 TRUE need to redo the text polys.
 
Bool m_newTextPos
 TRUE when our window has moved and we need a new text pos.
 
- Protected Attributes inherited from GameWindow
Int m_status
 
ICoord2D m_size
 
IRegion2D m_region
 
Int m_cursorX
 
Int m_cursorY
 
void * m_userData
 
WinInstanceData m_instData
 
void * m_inputData
 
GameWinInputFunc m_input
 callback for input
 
GameWinSystemFunc m_system
 callback for system messages
 
GameWinDrawFunc m_draw
 callback for drawing
 
GameWinTooltipFunc m_tooltip
 callback for tooltip execution
 
GameWindowm_next
 
GameWindowm_prev
 
GameWindowm_parent
 
GameWindowm_child
 
GameWindowm_nextLayout
 next in layout
 
GameWindowm_prevLayout
 prev in layout
 
WindowLayoutm_layout
 layout this window is a part of
 
GameWindowEditDatam_editData
 

Detailed Description

W3D implemenation for a game window

Definition at line 64 of file W3DGameWindow.h.

Constructor & Destructor Documentation

◆ W3DGameWindow()

W3DGameWindow::W3DGameWindow ( void )

Definition at line 264 of file W3DGameWindow.cpp.

Member Function Documentation

◆ blitBorderRect()

void W3DGameWindow::blitBorderRect ( Int x,
Int y,
Int width,
Int height )
protected

helper function to draw borders

Definition at line 126 of file W3DGameWindow.cpp.

◆ drawText()

void W3DGameWindow::drawText ( Color color)

draw text in the text renderer

Draw the text in our 2d sentence renderer

Definition at line 621 of file W3DGameWindow.cpp.

◆ getTextSize()

void W3DGameWindow::getTextSize ( Int * width,
Int * height )

get size of text

Get the size of the text in our inst data

Definition at line 584 of file W3DGameWindow.cpp.

◆ setTextLoc()

void W3DGameWindow::setTextLoc ( Int x,
Int y )

set text screen coord loc

Definition at line 598 of file W3DGameWindow.cpp.

◆ winDrawBorder()

void W3DGameWindow::winDrawBorder ( void )
virtual

draw borders for this window only, NO child windows or anything else

Todo
this WinDrawBorder is the old Nox function for drawing the borders on various windows and controls. We should derive classes of game windows for the different GUI controls and move the specific pieces of code that apply for those gadgets to those classes

Implements GameWindow.

Definition at line 395 of file W3DGameWindow.cpp.

◆ winSetFont()

void W3DGameWindow::winSetFont ( GameFont * font)
virtual

set font for window

Set the font for a widow

Reimplemented from GameWindow.

Definition at line 525 of file W3DGameWindow.cpp.

◆ winSetPosition()

Int W3DGameWindow::winSetPosition ( Int x,
Int y )

set window position

Set window position

Definition at line 561 of file W3DGameWindow.cpp.

◆ winSetText()

Int W3DGameWindow::winSetText ( UnicodeString newText)
virtual

set text string

Set the text for window

Reimplemented from GameWindow.

Definition at line 542 of file W3DGameWindow.cpp.

Member Data Documentation

◆ m_currTextColor

Color W3DGameWindow::m_currTextColor
protected

current color used in text renderer

Definition at line 92 of file W3DGameWindow.h.

◆ m_needPolyDraw

Bool W3DGameWindow::m_needPolyDraw
protected

TRUE need to redo the text polys.

Definition at line 93 of file W3DGameWindow.h.

◆ m_newTextPos

Bool W3DGameWindow::m_newTextPos
protected

TRUE when our window has moved and we need a new text pos.

Definition at line 94 of file W3DGameWindow.h.

◆ m_textPos

ICoord2D W3DGameWindow::m_textPos
protected

current text pos set in text renderer

Definition at line 91 of file W3DGameWindow.h.

◆ m_textRenderer

Render2DSentenceClass W3DGameWindow::m_textRenderer
protected

for drawing text

Definition at line 90 of file W3DGameWindow.h.


The documentation for this class was generated from the following files: