MenuItem_t Struct Reference
[Menu System]

Represents a user interface component on a menu. More...

#include <menu.h>

Collaboration diagram for MenuItem_t:

Collaboration graph
[legend]

Data Fields

union {
   struct {
      Bool   active: 1
 When true, the menu item may be given the input focus.
      Bool   expandHeight: 1
 Enables expanding the height of the menu item when resized to fill the availble height.
      Bool   hasFocus: 1
 When true, the item has the input focus.
      Bool   isPlaced: 1
 True when the menu item has placed all of its graphics within its assigned region.
      Bool   lockFocus: 1
 When true, the player is not allowed to switch focus away from this item.
   } 
   Uint32   flags
 A set of flags.
}; 
void * data
 Additional application specific information about this option.
MenuItemFocus focus
 The function used to modify the menu item when it gains and loses focus.
RenderItemgraphics
 The visible things that are related to this menu item.
MenuItemInput input
 The function that responds to user input for the menu item.
int minHeight
int minWidth
 The minimum width and height the menu item requires to draw itself properly.
Uint32 numGraphics
 The number of items in graphics.
SDL_Rect region
 Defines the region over which this menu item is drawn.
MenuItemUpdate update
 The function that keeps the display of the menu item up to date.

Detailed Description

Represents a user interface component on a menu.

Author:
Jeff Jackowski

Definition at line 92 of file menu.h.


Field Documentation

union { ... }

Bool MenuItem_t::active

When true, the menu item may be given the input focus.

Definition at line 140 of file menu.h.

Referenced by NetStatInit(), and TeamSelInit().

void* MenuItem_t::data

Additional application specific information about this option.

Definition at line 169 of file menu.h.

Referenced by NetStatInit().

Bool MenuItem_t::expandHeight

Enables expanding the height of the menu item when resized to fill the availble height.

Warning:
Only one item on a menu can have this flag set.

Definition at line 156 of file menu.h.

Referenced by TeamSelInit().

Uint32 MenuItem_t::flags

A set of flags.

Only a few are defined by the menu system; the remaining bits may be used for user-defined states. The default value of flags is zero.

Definition at line 135 of file menu.h.

MenuItemFocus MenuItem_t::focus

The function used to modify the menu item when it gains and loses focus.

The value may be NULL to indicate that there is no function to call.

Definition at line 117 of file menu.h.

Referenced by NetStatInit().

RenderItem* MenuItem_t::graphics

The visible things that are related to this menu item.

This is an array.

Definition at line 108 of file menu.h.

Bool MenuItem_t::hasFocus

When true, the item has the input focus.

Definition at line 144 of file menu.h.

Referenced by MenuRun(), NetStatFocus(), NetStatUpdate(), and SetupMenu().

MenuItemInput MenuItem_t::input

The function that responds to user input for the menu item.

The value may be NULL to indicate that there is no function to call.

Definition at line 122 of file menu.h.

Referenced by NetStatInit(), and TeamSelInit().

Bool MenuItem_t::isPlaced

True when the menu item has placed all of its graphics within its assigned region.

This flag is cleared when the window is resized. The menu item's update funtion (see MenuItemUpdate) is responsible for placing the render items and clearing this flag.

Definition at line 163 of file menu.h.

Referenced by NetStatUpdate(), and TeamSelUpdate().

Bool MenuItem_t::lockFocus

When true, the player is not allowed to switch focus away from this item.

Has no effect when this item does not have input focus.

Definition at line 150 of file menu.h.

int MenuItem_t::minHeight

Definition at line 97 of file menu.h.

Referenced by NetStatInit(), ResizeMenu(), and TeamSelInit().

int MenuItem_t::minWidth

The minimum width and height the menu item requires to draw itself properly.

Definition at line 97 of file menu.h.

Referenced by NetStatInit(), ResizeMenu(), and TeamSelInit().

Uint32 MenuItem_t::numGraphics

The number of items in graphics.

Definition at line 112 of file menu.h.

SDL_Rect MenuItem_t::region

Defines the region over which this menu item is drawn.

Used by the menu system to place markers around the menu item to denote it has input focus.

Definition at line 103 of file menu.h.

Referenced by NetStatUpdate(), PlaceMarkers(), RenderLatency(), RenderLocalAddr(), RenderTSync(), and TeamSelUpdate().

MenuItemUpdate MenuItem_t::update

The function that keeps the display of the menu item up to date.

This function must be defined so that after window resizes and resolution changes the menu item will be drawn in the proper place.

Definition at line 128 of file menu.h.

Referenced by MenuRun(), NetStatInit(), ResizeMenu(), and TeamSelInit().


The documentation for this struct was generated from the following file:
Generated on Mon May 28 04:41:44 2007 for Retro Tank Super Attack by  doxygen 1.5.2