Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | List of all members
om::graphics::gui::objects::ButtonFlags Class Reference

A class that encapsulates the different boolean flags that a button can have. More...

#include <omGraphicsGUIButtonFlags.h>

Public Types

enum  Flag {
  ENABLED = (1 << 0), TEXT = (1 << 1), IMAGE = (1 << 2), ALTERNATE = (1 << 3),
  DEFAULT = ENABLED | TEXT | IMAGE, UNDEFINED = 0
}
 An enum that specifies the different button flags. More...
 

Public Member Functions

 ButtonFlags ()
 Create a new button flags object with no flags set. More...
 
 ButtonFlags (Flag flag)
 Create a new button flags object with the specified flag value initially set. More...
 
 ButtonFlags (UInt32 newFlags)
 Create a new button flags object with the specified initial combined flags value. More...
 
 operator UInt32 () const
 Convert this button flags object to an integer value. More...
 
Bool isSet (Flag flag) const
 Return whether or not the specified flag value is set for this flags object. More...
 
Bool isSetAny (Flag flag) const
 Return whether or not the any of the specified flag's bits are set for this flags object. More...
 
void set (Flag flag, Bool newIsSet)
 Set whether or not the specified flag value is set for this flags object. More...
 

Detailed Description

A class that encapsulates the different boolean flags that a button can have.

These flags provide boolean information about a certain button. Flags are indicated by setting a single bit of a 32-bit unsigned integer to 1.

Enum values for the different flags are defined as members of the class. Typically, the user would bitwise-OR the flag enum values together to produce a final set of set flags.

Member Enumeration Documentation

An enum that specifies the different button flags.

Enumerator
ENABLED 

A flag indicating that a button is currently enabled.

TEXT 

A flag indicating that a button's text should be displayed.

IMAGE 

A flag indicating that a button's image should be displayed if it is not NULL.

ALTERNATE 

A flag indicating whether or not the alternate text/image should be shown when the button is selected.

DEFAULT 

The default flags to use for a button.

UNDEFINED 

The flag value when all flags are not set.

Constructor & Destructor Documentation

om::graphics::gui::objects::ButtonFlags::ButtonFlags ( )
inline

Create a new button flags object with no flags set.

om::graphics::gui::objects::ButtonFlags::ButtonFlags ( Flag  flag)
inline

Create a new button flags object with the specified flag value initially set.

om::graphics::gui::objects::ButtonFlags::ButtonFlags ( UInt32  newFlags)
inline

Create a new button flags object with the specified initial combined flags value.

Member Function Documentation

om::graphics::gui::objects::ButtonFlags::operator UInt32 ( ) const
inline

Convert this button flags object to an integer value.

This operator is provided so that the ButtonFlags object can be used as an integer value for bitwise logical operations.

Bool om::graphics::gui::objects::ButtonFlags::isSet ( Flag  flag) const
inline

Return whether or not the specified flag value is set for this flags object.

Bool om::graphics::gui::objects::ButtonFlags::isSetAny ( Flag  flag) const
inline

Return whether or not the any of the specified flag's bits are set for this flags object.

void om::graphics::gui::objects::ButtonFlags::set ( Flag  flag,
Bool  newIsSet 
)
inline

Set whether or not the specified flag value is set for this flags object.


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