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

#include <gGUITextbox.h>

Inheritance diagram for gGUITextbox:
Collaboration diagram for gGUITextbox:

Public Member Functions

 gGUITextbox ()
 
virtual ~gGUITextbox ()
 
virtual void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
 
void setText (const std::string &text)
 
std::string getText ()
 
void setEditable (bool isEditable)
 
bool isEditable ()
 
void setLineCount (int linecount)
 
int getLineCount ()
 
int getCursor (int x, int y)
 
void setSize (int width, int height)
 
void setNumeric (bool isNumeric)
 
bool isNumeric ()
 
void addLeftMargin (int left)
 
void addTopMargin (int top)
 
void setLineTopMargin (int linetopmargin)
 
void setPassword (bool isPassword)
 
bool isPassword ()
 
void enableBackground (bool isEnabled)
 
void enableVerticalMargin (bool isAligned)
 
bool isBackgroundEnabled ()
 
void update ()
 
void draw ()
 
void keyPressed (int key)
 
void keyReleased (int key)
 
void charPressed (unsigned int codepoint)
 
void mousePressed (int x, int y, int button)
 
void mouseReleased (int x, int y, int button)
 
void mouseDragged (int x, int y, int button)
 
int getTextboxh ()
 
void cleanText ()
 
void setFirstX (int firstx)
 
void setFirstY (int firsty)
 
int getInitX ()
 
void setTextFont (gFont *textFont)
 
void setTextAlignment (int textAlignment, float cellW, int initX)
 
void setTextColor (gColor *textColor)
 
int getCursorPosX ()
 
void setCursorPosX (int cursorPosX, int length)
 
void setDisabled (bool isDisabled)
 
void setEditMode (bool editMode)
 
int calculateContentHeight ()
 
- Public Member Functions inherited from gGUIControl
 gGUIControl ()
 
virtual ~gGUIControl ()
 
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 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)
 
- 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 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
 

Constructor & Destructor Documentation

◆ gGUITextbox()

gGUITextbox::gGUITextbox ( )

◆ ~gGUITextbox()

virtual gGUITextbox::~gGUITextbox ( )
virtual

Member Function Documentation

◆ addLeftMargin()

void gGUITextbox::addLeftMargin ( int  left)

Shifts the left and right coordinates of the textbox by given value. Makes sure that both left and right coordinates are within the limits of the panel.

Parameters
leftDesired shift value for the left coordinate of the textbox. It can be a negative integer value.

◆ addTopMargin()

void gGUITextbox::addTopMargin ( int  top)

Shifts the top and bottom coordinates of the textbox by given value. Makes sure that both top and bottom coordinates are within the limits of the panel.

Parameters
topDesired shift value for the top coordinate of the textbox. It can be a negative integer value.

◆ calculateContentHeight()

int gGUITextbox::calculateContentHeight ( )
virtual

Reimplemented from gGUIControl.

◆ charPressed()

void gGUITextbox::charPressed ( unsigned int  codepoint)
virtual

Reimplemented from gBaseGUIObject.

◆ cleanText()

void gGUITextbox::cleanText ( )

◆ draw()

void gGUITextbox::draw ( )
virtual

Reimplemented from gGUIControl.

◆ enableBackground()

void gGUITextbox::enableBackground ( bool  isEnabled)

Enables/disable drawing a background for textbox.

Parameters
isEnabledBoolean value to enable/disable drawing a background.

◆ enableVerticalMargin()

void gGUITextbox::enableVerticalMargin ( bool  isAligned)

◆ getCursor()

int gGUITextbox::getCursor ( int  x,
int  y 
)
virtual

Returns the current position of the cursor.

Reimplemented from gGUIControl.

◆ getCursorPosX()

int gGUITextbox::getCursorPosX ( )

◆ getInitX()

int gGUITextbox::getInitX ( )

◆ getLineCount()

int gGUITextbox::getLineCount ( )

Returns the line count of the textbox.

Returns
Line count of the textbox.

◆ getText()

std::string gGUITextbox::getText ( )

Returns the text that is currently inside the textbox.

Returns
Text inside the textbox.

◆ getTextboxh()

int gGUITextbox::getTextboxh ( )

◆ isBackgroundEnabled()

bool gGUITextbox::isBackgroundEnabled ( )

◆ isEditable()

bool gGUITextbox::isEditable ( )

Returns the bool value that indicates if textbox is editable or not.

Returns
Bool value that indicates if textbox is editable or not.

◆ isNumeric()

bool gGUITextbox::isNumeric ( )

Check if the textbox only allows numeric value entry.

Returns
Bool value that indicates if textbox allows only numbers to be input into the textbox.

◆ isPassword()

bool gGUITextbox::isPassword ( )

Check if the textbox is a password box.

Returns
Bool value that indicates if textbox is a password box

◆ keyPressed()

void gGUITextbox::keyPressed ( int  key)
virtual

Reimplemented from gBaseGUIObject.

◆ keyReleased()

void gGUITextbox::keyReleased ( int  key)
virtual

Reimplemented from gBaseGUIObject.

◆ mouseDragged()

void gGUITextbox::mouseDragged ( int  x,
int  y,
int  button 
)
virtual

Reimplemented from gBaseGUIObject.

◆ mousePressed()

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

Reimplemented from gBaseGUIObject.

◆ mouseReleased()

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

Reimplemented from gBaseGUIObject.

◆ set()

virtual void gGUITextbox::set ( gBaseApp root,
gBaseGUIObject topParentGUIObject,
gBaseGUIObject parentGUIObject,
int  parentSlotLineNo,
int  parentSlotColumnNo,
int  x,
int  y,
int  w,
int  h 
)
virtual

Reimplemented from gGUIControl.

◆ setCursorPosX()

void gGUITextbox::setCursorPosX ( int  cursorPosX,
int  length 
)

◆ setDisabled()

void gGUITextbox::setDisabled ( bool  isDisabled)

◆ setEditable()

void gGUITextbox::setEditable ( bool  isEditable)

Enables/disables the textbox for editing.

Parameters
isEditableBoolean value to enable/disable the textbox for editing. If it is 'true', textbox becomes editable. If it is 'false', textbox becomes static.

◆ setEditMode()

void gGUITextbox::setEditMode ( bool  editMode)

◆ setFirstX()

void gGUITextbox::setFirstX ( int  firstx)

◆ setFirstY()

void gGUITextbox::setFirstY ( int  firsty)

◆ setLineCount()

void gGUITextbox::setLineCount ( int  linecount)

Sets the line count of the textbox.

NOTE: Currently if line count is set to a higher value than 1, editing is not functioning properly. So, if you want to use multilines in your textbox, use the setText() function.

Parameters
linecountLine count of the textbox. By default it is set to 1. It must be an integer value bigger than 1.

◆ setLineTopMargin()

void gGUITextbox::setLineTopMargin ( int  linetopmargin)

Changes the top margin between lines.

Parameters
linetopmarginDesired margin value between lines.

◆ setNumeric()

void gGUITextbox::setNumeric ( bool  isNumeric)

Enables/disables the numeric value only mode of the textbox.

Parameters
isNumericBoolean value to enable/disable entering numeric values only. If it is 'true', you can only input numeric values into the textbox, if it is 'false', it works normally.

◆ setPassword()

void gGUITextbox::setPassword ( bool  isPassword)

Converts textbox into a password box or converts password box back into a textbox.

Parameters
isPasswordBoolean value to select between password box and textbox. If it is true, password box is active. If it is false, textbox is active.

◆ setSize()

void gGUITextbox::setSize ( int  width,
int  height 
)

Changes the textbox's measurements. Makes sure that textbox's size is within the panel's limits.

Parameters
widthWidth of the textbox.
heightHeight of the textbox.

◆ setText()

void gGUITextbox::setText ( const std::string &  text)

Changes the text displayed in the textbox.

Parameters
textText you want to put in the textbox.

◆ setTextAlignment()

void gGUITextbox::setTextAlignment ( int  textAlignment,
float  cellW,
int  initX 
)

◆ setTextColor()

void gGUITextbox::setTextColor ( gColor textColor)

◆ setTextFont()

void gGUITextbox::setTextFont ( gFont textFont)

◆ update()

void gGUITextbox::update ( )
virtual

Reimplemented from gGUIControl.


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