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

#include <gGUIProgressBar.h>

Inheritance diagram for gGUIProgressBar:
Collaboration diagram for gGUIProgressBar:

Public Types

enum  TYPE { TYPE_LINE , TYPE_CIRCULAR , TYPE_SPIN }
 
- Public Types inherited from gBaseGUIObject
enum  { TEXTALIGNMENT_LEFT , TEXTALIGNMENT_MIDDLE , TEXTALIGNMENT_RIGHT }
 

Public Member Functions

 gGUIProgressBar ()
 
virtual ~gGUIProgressBar ()
 
void draw ()
 
void setValue (float value)
 
float getValue ()
 
void setMaxValue (float value)
 
void setMinValue (float value)
 
float getMaxValue ()
 
float getMinValue ()
 
void setProgressBarColor (float r, float g, float b)
 
void setBackgroundColor (float r, float g, float b)
 
gColorgetProgressBarColor ()
 
void setBorderThickness (float thickness)
 
float getBorderThickness ()
 
void setProgressBarSize (int w, int h)
 
int getProgressBarWidth ()
 
int getProgressBarHeight ()
 
void setType (TYPE type)
 
TYPE getType ()
 
void setLineTextColor (float r, float g, float b)
 
void setSpinTextColor (float r, float g, float b)
 
void setSpinThickness (float thickness)
 
float getSpinThickness ()
 
void displayProgressText (bool display)
 
- Public Member Functions inherited from gGUIControl
 gGUIControl ()
 
virtual ~gGUIControl ()
 
virtual void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
 
virtual int getCursor (int x, int y)
 
virtual void update ()
 
virtual int calculateContentHeight ()
 
virtual bool countAsSpace ()
 
void setCountAsSpace (bool isSpace)
 
- Public Member Functions inherited from gBaseGUIObject
 gBaseGUIObject ()
 
virtual ~gBaseGUIObject ()
 
int getId ()
 
int getType ()
 
void setEnabled (bool isEnabled)
 
bool isEnabled ()
 
void setTitleOn (bool isTitleOn)
 
bool isTitleOn ()
 
virtual void setTopParent (gBaseGUIObject *parentGUIObject)
 
gBaseGUIObjectgetTopParent ()
 
virtual void setParent (gBaseGUIObject *parentGUIObject)
 
gBaseGUIObjectgetParent ()
 
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 mousePressed (int x, int y, int button)
 
virtual void mouseDragged (int x, int y, int button)
 
virtual void mouseReleased (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)
 
- 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

- Static Public Member Functions inherited from gBaseGUIObject
static void setBackgroundColor (gColor *backgroundColor)
 
static gColorgetBackgroundColor ()
 
static void setMiddlegroundColor (gColor *middlegroundColor)
 
static gColorgetMiddlegroundColor ()
 
static void setForegroundColor (gColor *foregroundColor)
 
static gColorgetForegroundColor ()
 
static void setTextBackgroundColor (gColor *textBackgroundColor)
 
static gColorgetTextBackgroundColor ()
 
static void setNavigationBackgroundColor (gColor *navigationBackgroundColor)
 
static gColorgetNavigationBackgroundColor ()
 
static void setFont (gFont *font)
 
static gFontgetFont ()
 
static void setFontColor (gColor *fontColor)
 
static gColorgetFontColor ()
 
static void setNavigationFontColor (gColor *navigationFontColor)
 
static gColorgetNavigationFontColor ()
 
static void setButtonColor (gColor *color)
 
static gColorgetButtonColor ()
 
static void setPressedButtonColor (gColor *color)
 
static gColorgetPressedButtonColor ()
 
static void setDisabledButtonColor (gColor *color)
 
static gColorgetDisabledButtonColor ()
 
static void setButtonFontColor (gColor *color)
 
static gColorgetButtonFontColor ()
 
static void setPressedButtonFontColor (gColor *color)
 
static gColorgetPressedButtonFontColor ()
 
static void setDisabledButtonFontColor (gColor *color)
 
static gColorgetDisabledButtonFontColor ()
 
- 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 gRenderergetRenderer ()
 
static void destroyRenderer ()
 
static void createRenderer ()
 
- 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
 
- Protected Attributes inherited from gBaseGUIObject
std::string title
 
gBaseApproot
 
gBaseGUIObjecttopparent
 
gBaseGUIObjectparent
 
bool isenabled
 
bool istitleon
 
int parentslotlineno
 
int parentslotcolumnno
 
- Static Protected Attributes inherited from gBaseGUIObject
static gColorbackgroundcolor
 
static gColormiddlegroundcolor
 
static gColorforegroundcolor
 
static gColortextbackgroundcolor
 
static gColornavigationbackgroundcolor
 
static gFontfont
 
static gColorfontcolor
 
static gColornavigationfontcolor
 
static gColorbuttoncolor
 
static gColorpressedbuttoncolor
 
static gColordisabledbuttoncolor
 
static gColorbuttonfontcolor
 
static gColorpressedbuttonfontcolor
 
static gColordisabledbuttonfontcolor
 
static gGUIActionManager actionmanager
 
static gGUIResources res
 
- Static Protected Attributes inherited from gRenderObject
static bool isshadowmappingenabled
 
- Static Protected Attributes inherited from gObject
static int renderpassnum
 
static int renderpassno
 
static int releasescaling
 
static int releaseresolution
 

Detailed Description

This class creates and controls a progress bar. Progress bars show the current value in the given range. They basically used for everything that can be increased or decreased.

Developers can change the current value of the progress bar according to their calculations. They can change the color of the progress bar.

(value * 180) / (valuemax - valuemin) This formula used for calculating the progress bar's current value.

Member Enumeration Documentation

◆ TYPE

Enumerator
TYPE_LINE 
TYPE_CIRCULAR 
TYPE_SPIN 

Constructor & Destructor Documentation

◆ gGUIProgressBar()

gGUIProgressBar::gGUIProgressBar ( )

◆ ~gGUIProgressBar()

virtual gGUIProgressBar::~gGUIProgressBar ( )
virtual

Member Function Documentation

◆ displayProgressText()

void gGUIProgressBar::displayProgressText ( bool  display)

◆ draw()

void gGUIProgressBar::draw ( )
virtual

Reimplemented from gGUIControl.

◆ getBorderThickness()

float gGUIProgressBar::getBorderThickness ( )

Returns the thickness of progress bar's borders.

◆ getMaxValue()

float gGUIProgressBar::getMaxValue ( )

Returns the maximum value of the progress bar.

◆ getMinValue()

float gGUIProgressBar::getMinValue ( )

Returns the maximum value of the progress bar.

◆ getProgressBarColor()

gColor * gGUIProgressBar::getProgressBarColor ( )

Returns the color of the progress bar.

◆ getProgressBarHeight()

int gGUIProgressBar::getProgressBarHeight ( )

Gets height of the progressbar's outer frame

◆ getProgressBarWidth()

int gGUIProgressBar::getProgressBarWidth ( )

Gets width of the progressbar's outer frame

◆ getSpinThickness()

float gGUIProgressBar::getSpinThickness ( )

◆ getType()

TYPE gGUIProgressBar::getType ( )

◆ getValue()

float gGUIProgressBar::getValue ( )

Returns the shown value of the progress bar.

◆ setBackgroundColor()

void gGUIProgressBar::setBackgroundColor ( float  r,
float  g,
float  b 
)

Sets the color of the background of the progressbar with the given color. Colors consist of RGB values float between 0.0f-1.0f.

Parameters
colorThe given color consist of (r, g, b) float values

◆ setBorderThickness()

void gGUIProgressBar::setBorderThickness ( float  thickness)

Sets the thickness of progress bar's borders. Borders can be between 0.0f and 25.0f.

Parameters
thicknessShould be given float type. If the given value is bigger than 25.0f than the value is silently ignored. Any value smaller and equal than 0.0f makes the borders disabled.

◆ setLineTextColor()

void gGUIProgressBar::setLineTextColor ( float  r,
float  g,
float  b 
)

◆ setMaxValue()

void gGUIProgressBar::setMaxValue ( float  value)

Sets the maximum value of the progress bar. The maximum value can be any float value between C++ float limits. The maximum value should be bigger than the minimum value. If the maximum value is lower than minimum value, the given maximum value is silently ignored.

Parameters
valueA float number bigger than the minimum value

◆ setMinValue()

void gGUIProgressBar::setMinValue ( float  value)

Sets the minimum value of the progress bar. The minimum value can be any float value between C++ float limits. The minimum value should be lower than the maximum value.If the minimum value is bigger than the maximum value, the minimum value is silently ignored.

Parameters
valueA float number lower than the maximum value

◆ setProgressBarColor()

void gGUIProgressBar::setProgressBarColor ( float  r,
float  g,
float  b 
)

Sets the color of the progress bar with the given color. Colors consist of RGB values float between 0.0f-1.0f.

Parameters
colorThe given color consist of (r, g, b) float values

◆ setProgressBarSize()

void gGUIProgressBar::setProgressBarSize ( int  w,
int  h 
)

Sets the size of the progressbar's outer frame

Parameters
wWidth of the outer frame
hHeight of the outer frame

◆ setSpinTextColor()

void gGUIProgressBar::setSpinTextColor ( float  r,
float  g,
float  b 
)

◆ setSpinThickness()

void gGUIProgressBar::setSpinThickness ( float  thickness)

◆ setType()

void gGUIProgressBar::setType ( TYPE  type)

◆ setValue()

void gGUIProgressBar::setValue ( float  value)

Sets the shown value of the progress bar. Developers can determine the shown value of the progress bar according to the minimum value and the maximum value.If the value is not between the minimum value and the maximum value, value is silently ignored.

Parameters
valueThe value should be a float number between the minimum value and the maximum value.

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