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

#include <gGUISlider.h>

Inheritance diagram for gGUISlider:
Collaboration diagram for gGUISlider:

Public Member Functions

 gGUISlider ()
virtual ~gGUISlider () override
void update () override
void draw () override
void mousePressed (int x, int y, int button) override
void mouseReleased (int x, int y, int button) override
void mouseDragged (int x, int y, int button) override
float getSliderbarWidth ()
float getSliderbarHeight ()
void setTickVisibility (bool isVisible)
void setTextVisibility (bool isTextVisible)
void setDisabled (bool isDisabled)
float getMinValue ()
void setMinValue (float minValue)
float getMaxValue ()
void setMaxValue (float maxValue)
float getCurrentValue ()
void setTicknum (float tickNum)
void setDisabledColor (gColor color)
gColor * getDisabledColor ()
void setSliderbarColor (gColor color)
gColor * getSliderbarColor ()
void setSliderColor (gColor color)
gColor * getSliderColor ()
void setPressedSliderColor (gColor color)
gColor * getPressedSliderColor ()
void setTickColor (gColor color)
gColor * getTickColor ()
bool isTickVisible ()
bool isDisabled ()
bool isPressed ()
bool isSliderPressed ()
void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h) override
Public Member Functions inherited from gGUIControl
 gGUIControl ()
virtual ~gGUIControl () override
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 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)

Friends

class gGUIToolbar

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

Detailed Description

Here is the class of the gGUISlider. This class, if no given parameters, creates a default sliderbar. You can change the visibility of the ticks and texts, you can set colors and you can change the ticknum. If you don't give any min or max value, the default slider will be created between 0 and 100 with 5 ticknum.

Constructor & Destructor Documentation

◆ gGUISlider()

gGUISlider::gGUISlider ( )

◆ ~gGUISlider()

virtual gGUISlider::~gGUISlider ( )
overridevirtual

Member Function Documentation

◆ draw()

void gGUISlider::draw ( )
overridevirtual

Reimplemented from gGUIControl.

◆ getCurrentValue()

float gGUISlider::getCurrentValue ( )

Returns the value of the current position of the slider.

Returns
value of the current position of the slider.

◆ getDisabledColor()

gColor * gGUISlider::getDisabledColor ( )

Returns current color of the disabled slider.

Returns
current color of the disabled slider.

◆ getMaxValue()

float gGUISlider::getMaxValue ( )

Returns the current maximum value of the sliderbar gap.

Returns
current maximum value of the sliderbar gap..

◆ getMinValue()

float gGUISlider::getMinValue ( )

Returns the current minimum value of the sliderbar gap.

Returns
current minimum value of the sliderbar gap..

◆ getPressedSliderColor()

gColor * gGUISlider::getPressedSliderColor ( )

Returns the current color of the pressed slider.

Returns
current color of the pressed slider.

◆ getSliderbarColor()

gColor * gGUISlider::getSliderbarColor ( )

Returns current color of the sliderbar.

Returns
current color of the sliderbar.

◆ getSliderbarHeight()

float gGUISlider::getSliderbarHeight ( )

Returns the current height of the sliderbar.

Returns
height of the sliderbar.

◆ getSliderbarWidth()

float gGUISlider::getSliderbarWidth ( )

Returns the current width of the sliderbar.

Returns
width of the sliderbar.

◆ getSliderColor()

gColor * gGUISlider::getSliderColor ( )

Returns current color of the slider.

Returns
current color of the slider.

◆ getTickColor()

gColor * gGUISlider::getTickColor ( )

Returns the current color of the ticks.

Returns
current color of the ticks.

◆ isDisabled()

bool gGUISlider::isDisabled ( )

◆ isPressed()

bool gGUISlider::isPressed ( )

◆ isSliderPressed()

bool gGUISlider::isSliderPressed ( )

◆ isTickVisible()

bool gGUISlider::isTickVisible ( )

◆ mouseDragged()

void gGUISlider::mouseDragged ( int x,
int y,
int button )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ mousePressed()

void gGUISlider::mousePressed ( int x,
int y,
int button )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ mouseReleased()

void gGUISlider::mouseReleased ( int x,
int y,
int button )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ set()

void gGUISlider::set ( gBaseApp * root,
gBaseGUIObject * topParentGUIObject,
gBaseGUIObject * parentGUIObject,
int parentSlotLineNo,
int parentSlotColumnNo,
int x,
int y,
int w,
int h )
overridevirtual

Reimplemented from gGUIControl.

◆ setDisabled()

void gGUISlider::setDisabled ( bool isDisabled)

◆ setDisabledColor()

void gGUISlider::setDisabledColor ( gColor color)

Sets the color of the disabled slider.

Parameters
colorof the disabled slider. The values of the color must be between 0 and 1.

◆ setMaxValue()

void gGUISlider::setMaxValue ( float maxValue)

Sets the maximum value of the sliderbar gap.

Parameters
maximumvalue of the sliderbar gap.

◆ setMinValue()

void gGUISlider::setMinValue ( float minValue)

Sets the minimum value of the sliderbar gap.

Parameters
minimumvalue of the sliderbar gap.

◆ setPressedSliderColor()

void gGUISlider::setPressedSliderColor ( gColor color)

Sets the color of the pressed slider.

Parameters
colorof the pressed slider. The values of the color must be between 0 and 1.

◆ setSliderbarColor()

void gGUISlider::setSliderbarColor ( gColor color)

Sets the color of the sliderbar.

Parameters
colorof the sliderbar. The values of the color must be between 0 and 1.

◆ setSliderColor()

void gGUISlider::setSliderColor ( gColor color)

Sets the color of the slider.

Parameters
colorof the slider. The values of the color must be between 0 and 1.

◆ setTextVisibility()

void gGUISlider::setTextVisibility ( bool isTextVisible)

Sets the visibility of the numbers.

Parameters
visibilityinformation of the numbers.

◆ setTickColor()

void gGUISlider::setTickColor ( gColor color)

Sets the color of the ticks.

Parameters
colorof the ticks. The values of the color must be between 0 and 1.

◆ setTicknum()

void gGUISlider::setTicknum ( float tickNum)

Sets the tick number.

Parameters
tickcount. Sliderbarw / ticknum must be bigger than sliderw

◆ setTickVisibility()

void gGUISlider::setTickVisibility ( bool isVisible)

Sets the visibility of the ticks.

Parameters
visibilityinformation of the ticks.

◆ update()

void gGUISlider::update ( )
overridevirtual

Reimplemented from gGUIControl.

◆ gGUIToolbar

friend class gGUIToolbar
friend

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