GlistEngine
Loading...
Searching...
No Matches
gGUIRadioButton Class Reference

#include <gGUIRadioButton.h>

Inheritance diagram for gGUIRadioButton:
Collaboration diagram for gGUIRadioButton:

Public Member Functions

 gGUIRadioButton ()
virtual ~gGUIRadioButton ()
void setTitle (std::string title)
std::string getTitle ()
void showTitle (bool command)
void setSelectedButton (int index)
int getSelectedButton ()
void setButtonRadius (float radius)
int getButtonRadius ()
void setButtonCount (int buttoncount)
int getButtonCount ()
void setRadioTitle (int index, std::string title)
std::string getRadioTitle (int index)
void setHorizontalDistance (int distance)
int getHorizontalDistance ()
void setVerticalDistance (int distance)
int getVerticalDistance ()
void setSelectedButtonColor (gColor selectedcolor)
gColor * getSelectedButtonColor ()
void setColumnCount (int columncount)
int getColumnCount ()
bool isTextVisible ()
bool isDisabled ()
void setDisabled (bool command)
void update ()
void draw ()
void updateHeightLimit ()
void mousePressed (int x, int y, int button)
void mouseReleased (int x, int y, int button)
Public Member Functions inherited from gGUIControl
 gGUIControl ()
virtual ~gGUIControl () override
virtual void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
int getCursor (int x, int y) override
virtual int calculateContentHeight ()
virtual bool countAsSpace ()
void setCountAsSpace (bool isSpace)
void setFont (gFont *font)
gFont * getFont ()
Public Member Functions inherited from gBaseGUIObject
 gBaseGUIObject ()
virtual ~gBaseGUIObject ()
int getId ()
int getType ()
void setEnabled (bool isEnabled)
bool isEnabled ()
void setVisible (bool isVisible)
bool isVisible ()
void setTitleOn (bool isTitleOn)
bool isTitleOn ()
virtual void setTopParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getTopParent ()
virtual void setParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getParent ()
void setParentSlotNo (int parentSlotLineNo, int parentSlotColumnNo)
int getParentSlotLineNo ()
int getParentSlotColumnNo ()
void setTitle (std::string title)
std::string getTitle ()
virtual void keyPressed (int key)
virtual void keyReleased (int key)
virtual void charPressed (unsigned int codepoint)
virtual void mouseMoved (int x, int y)
virtual void mouseDragged (int x, int y, int button)
virtual void mouseScrolled (int x, int y)
virtual void mouseEntered ()
virtual void mouseExited ()
virtual void windowResized (int w, int h)
virtual void onGUIEvent (int guiObjectId, int eventType, int sourceEventType, std::string value1="", std::string value2="")
void setRootApp (gBaseApp *root)
virtual void setCursorOn (bool isOn)
virtual void unfocus ()
Public Member Functions inherited from gRenderObject
 gRenderObject ()
int getScreenWidth ()
int getScreenHeight ()
void pushMatrix ()
void popMatrix ()
Public Member Functions inherited from gObject
 gObject ()
void logi (std::string message)
void logd (std::string message)
void logw (std::string message)
void loge (std::string message)
void logi (std::string tag, std::string message)
void logd (std::string tag, std::string message)
void logw (std::string tag, std::string message)
void loge (std::string tag, std::string message)

Additional Inherited Members

Public Types inherited from gBaseGUIObject
enum  { TEXTALIGNMENT_LEFT , TEXTALIGNMENT_MIDDLE , TEXTALIGNMENT_RIGHT }
Static Public Member Functions inherited from gBaseGUIObject
static void setBackgroundColor (gColor *backgroundColor)
static gColor * getBackgroundColor ()
static void setMiddlegroundColor (gColor *middlegroundColor)
static gColor * getMiddlegroundColor ()
static void setForegroundColor (gColor *foregroundColor)
static gColor * getForegroundColor ()
static void setTextBackgroundColor (gColor *textBackgroundColor)
static gColor * getTextBackgroundColor ()
static void setNavigationBackgroundColor (gColor *navigationBackgroundColor)
static gColor * getNavigationBackgroundColor ()
static void setFont (gFont *font)
static gFont * getFont ()
static void setFontColor (gColor *fontColor)
static gColor * getFontColor ()
static void setNavigationFontColor (gColor *navigationFontColor)
static gColor * getNavigationFontColor ()
static void setButtonColor (gColor *color)
static gColor * getButtonColor ()
static void setPressedButtonColor (gColor *color)
static gColor * getPressedButtonColor ()
static void setDisabledButtonColor (gColor *color)
static gColor * getDisabledButtonColor ()
static void setButtonFontColor (gColor *color)
static gColor * getButtonFontColor ()
static void setPressedButtonFontColor (gColor *color)
static gColor * getPressedButtonFontColor ()
static void setDisabledButtonFontColor (gColor *color)
static gColor * getDisabledButtonFontColor ()
Static Public Member Functions inherited from gRenderObject
static void setScreenSize (int screenWidth, int screenHeight)
static void setUnitScreenSize (int unitWidth, int unitHeight)
static void setScreenScaling (int screenScaling)
static void enableShadowMapping ()
static void disableShadowMapping ()
static bool isShadowMappingEnabled ()
static void enableExtraShaders (bool isEnabled=true)
static void disableExtraShaders ()
static bool isExtraShadersEnabled ()
static gRenderer * getRenderer ()
static void destroyRenderer ()
static void createRenderer (int renderEngine=G_RENDERER_GL)
Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
static std::string gGetAssetsDir ()
static void gSetAssetsDir (std::string assetsDir)
static std::string gGetFilesDir ()
static std::string gGetImagesDir ()
static std::string gGetFontsDir ()
static std::string gGetModelsDir ()
static std::string gGetTexturesDir ()
static std::string gGetShadersDir ()
static std::string gGetSoundsDir ()
static std::string gGetDatabasesDir ()
static std::string gGetVideosDir ()
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
Public Attributes inherited from gBaseGUIObject
int id
int type
int left
int top
int right
int bottom
int width
int height
int titlex
int titley
int titleheight
bool isfocused
bool iscursoron
bool issizer
bool iscontainer
bool isresizable
Static Public Attributes inherited from gBaseGUIObject
static const int GUIEVENT_FOCUSED = -1
static const int GUIEVENT_UNFOCUSED = -2
static const int CURSOR_ARROW = 0
static const int CURSOR_IBEAM = 1
static const int CURSOR_CROSSHAIR = 2
static const int CURSOR_HAND = 3
static const int CURSOR_HRESIZE = 4
static const int CURSOR_VRESIZE = 5
static int focusid
static int previousfocusid
Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
static const int LOGLEVEL_DEBUG
static const int LOGLEVEL_INFO
static const int LOGLEVEL_WARNING
static const int LOGLEVEL_ERROR
Protected Attributes inherited from gGUIControl
bool countasspace
int oldwidth
int oldheight
gFont * localfont
Protected Attributes inherited from gBaseGUIObject
std::string title
gBaseApp * root
gBaseGUIObject * topparent
gBaseGUIObject * parent
bool isenabled
bool isvisible
bool istitleon
int parentslotlineno
int parentslotcolumnno
Static Protected Attributes inherited from gBaseGUIObject
static gColor * backgroundcolor
static gColor * middlegroundcolor
static gColor * foregroundcolor
static gColor * textbackgroundcolor
static gColor * navigationbackgroundcolor
static gFont * font
static gColor * fontcolor
static gColor * navigationfontcolor
static gColor * buttoncolor
static gColor * pressedbuttoncolor
static gColor * disabledbuttoncolor
static gColor * buttonfontcolor
static gColor * pressedbuttonfontcolor
static gColor * disabledbuttonfontcolor
static gGUIActionManager actionmanager
static gGUIResources res
Static Protected Attributes inherited from gRenderObject
static bool isshadowmappingenabled
static bool isextrashadersenabled
Static Protected Attributes inherited from gObject
static int renderpassnum
static int renderpassno
static int releasescaling
static int releaseresolution

Constructor & Destructor Documentation

◆ gGUIRadioButton()

gGUIRadioButton::gGUIRadioButton ( )

◆ ~gGUIRadioButton()

virtual gGUIRadioButton::~gGUIRadioButton ( )
virtual

Member Function Documentation

◆ draw()

void gGUIRadioButton::draw ( )
virtual

Reimplemented from gGUIControl.

◆ getButtonCount()

int gGUIRadioButton::getButtonCount ( )

Returns the count of the radio buttons in the radio button group.

Returns
Button count.

◆ getButtonRadius()

int gGUIRadioButton::getButtonRadius ( )

Returns the current radius of the radio buttons.

Returns
Radius of the radio buttons.

◆ getColumnCount()

int gGUIRadioButton::getColumnCount ( )

Returns the column count of the radio button group.

Returns
Column count.

◆ getHorizontalDistance()

int gGUIRadioButton::getHorizontalDistance ( )

Returns the horizontal distance between the radio buttons.

Returns
Horizontal distance between the radio buttons.

◆ getRadioTitle()

std::string gGUIRadioButton::getRadioTitle ( int index)

Returns the title of a desired radio button.

Parameters
indexIndex value of the radio button to find. If index is bigger or equal to the button count, or is smaller than 0, returns an error message.
Returns
Title of the radio button with given index.

◆ getSelectedButton()

int gGUIRadioButton::getSelectedButton ( )

Returns the currently selected radio button's index value.

Returns
Index of the selected button.

◆ getSelectedButtonColor()

gColor * gGUIRadioButton::getSelectedButtonColor ( )

Returns the the color of the selected radio button.

Returns
Selected radio button color

◆ getTitle()

std::string gGUIRadioButton::getTitle ( )

Returns the title of the radio button group.

Returns
Current title of the radio button group.

◆ getVerticalDistance()

int gGUIRadioButton::getVerticalDistance ( )

Returns the vertical distance between the radio buttons.

Returns
Vertical distance between the radio buttons.

◆ isDisabled()

bool gGUIRadioButton::isDisabled ( )

◆ isTextVisible()

bool gGUIRadioButton::isTextVisible ( )

◆ mousePressed()

void gGUIRadioButton::mousePressed ( int x,
int y,
int button )
virtual

Reimplemented from gBaseGUIObject.

◆ mouseReleased()

void gGUIRadioButton::mouseReleased ( int x,
int y,
int button )
virtual

Reimplemented from gBaseGUIObject.

◆ setButtonCount()

void gGUIRadioButton::setButtonCount ( int buttoncount)

Changes the count of radio buttons to the designated value. Deletes titles of the previous radio buttons and creates new ones with default radio title "Radio Button".

Parameters
buttoncountValue that specifies how many radio buttons to have in the radio button group. If the value is smaller than 0, button count value becomes 1.

◆ setButtonRadius()

void gGUIRadioButton::setButtonRadius ( float radius)

Sets the radius of the radio buttons.

Parameters
radiusFloat value for radio button radius. When the class is initialized, the value is set to 6.5.

◆ setColumnCount()

void gGUIRadioButton::setColumnCount ( int columncount)

Changes the column count of the radio button group.

Parameters
columncountIndicates the desired amount of columns when drawing the radio buttons. If the value is smaller than 0, column count value becomes 1.

◆ setDisabled()

void gGUIRadioButton::setDisabled ( bool command)

◆ setHorizontalDistance()

void gGUIRadioButton::setHorizontalDistance ( int distance)

Changes the horizontal distance to put between the radio buttons if there are more than just one column.

Parameters
Desiredpixel distance to put between radio buttons.

◆ setRadioTitle()

void gGUIRadioButton::setRadioTitle ( int index,
std::string title )

Changes the title of a desired radio button. Updates the maximum radio button title length if the title to be set is longer that it.

Parameters
indexIndex value of the radio button with the title change. If index is bigger or equal to the button count, or is smaller than 0, nothing happens.
titleTitle to be assigned to the desired radio button.

◆ setSelectedButton()

void gGUIRadioButton::setSelectedButton ( int index)

Selects a radio button from the group.

Parameters
indexIndex value of the designated radio button to select. When the class is initialized, the value is set to 0. If index is bigger or equal to the button count, or is smaller than 0, selected button is set to 0.

◆ setSelectedButtonColor()

void gGUIRadioButton::setSelectedButtonColor ( gColor selectedcolor)

Changes the color of the selected radio button.

Parameters
selectedcolorDesired color value to set in gColor formation.

◆ setTitle()

void gGUIRadioButton::setTitle ( std::string title)

Changes the title of the radio button group.

Parameters
titleNew title value.

◆ setVerticalDistance()

void gGUIRadioButton::setVerticalDistance ( int distance)

Changes the vertical distance between the radio buttons.

Parameters
Desiredpixel distance to put between radio buttons.

◆ showTitle()

void gGUIRadioButton::showTitle ( bool command)

Shows/hides the title of the radio button group.

Parameters
commandBoolean value to set the value that controls title's visibility. If it is false, thetitle becomes invisible. If it is true, the title becomes visible.

◆ update()

void gGUIRadioButton::update ( )
virtual

Reimplemented from gGUIControl.

◆ updateHeightLimit()

void gGUIRadioButton::updateHeightLimit ( )

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