GlistEngine
Loading...
Searching...
No Matches
gGUINumberBox.h
Go to the documentation of this file.
1/*
2 * gGUINumberBox.h
3 *
4 * Created on: 27 Jul 2022
5 * Author: Aliv
6 */
7
8#ifndef UI_GGUINUMBERBOX_H_
9#define UI_GGUINUMBERBOX_H_
10
11#include "gGUIContainer.h"
12#include "gGUITextbox.h"
13#include <limits>
14#include "gColor.h"
15
17public:
19 virtual ~gGUINumberBox();
20
21 virtual void set(gBaseApp* root, gBaseGUIObject* topParentGUIObject, gBaseGUIObject* parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h);
22 virtual void set(int x, int y, int w, int h);
23
24 void setText(const std::string& text);
25
26 std::string getText();
27 /*
28 * Sets type of number which will be increased or decreased
29 *
30 * @param texttype for switching between integer and float values
31 */
32 bool setType(bool isInteger = true);
33 void setSize(int width, int height);
34 void showTitle(bool isShown);
35
36 void keyPressed(int key);
37 void keyReleased(int key);
38 void charPressed(unsigned int codepoint);
39 void mousePressed(int x, int y, int button);
40 void mouseReleased(int x, int y, int button);
41 void mouseDragged(int x, int y, int button);
42 void update();
43 void draw();
44 void setMaxValue(int maxValue);
45 void setMinValue(int minValue);
46 void setMaxValue(float maxValuef);
47 void setMinValue(float minValuef);
48 void setInteger(int value);
50 void setFloat(float value);
51 float getFloat();
52 void setIntegerIncrement(int value);
54 void setFloatIncrement(float value);
56
57 friend class gGUIToolbar;
58
59 void setDisabled(bool isDisabled);
60private:
61 int boxwidth, boxheight, numboxwidth, numboxheight, smalboxwidth, smalboxheight;
62
63 bool b1ispressed, b2ispressed;
64 bool b1isdisabled, b2isdisabled;
65 bool isinteger;
66
67 int lineno, columno;
68 int castcurrtexttoint;
69 int incboxposx, incboxposy;
70 int decboxposx, decboxposy;
71 int inctriucorpx, inctriucorpy, inctrilcorpx, inctrilcorpy, inctrircorpx, inctrircorpy;
72 int dectriucorpx, dectriucorpy, dectrilcorpx, dectrilcorpy, dectrircorpx, dectrircorpy;
73
74 float castcurrtexttofloat;
75
76 std::string defintvalue, deffloatvalue;
77 std::string currenttext;
78
79 gGUITextbox textbox;
80 gGUISizer boxsizer;
81 bool istitleshown;
82 int boxtoph;
83 int smalltriangleheight;
84 int maxvalue, minvalue;
85 float maxvaluef, minvaluef;
86 int increment;
87 float incrementf;
88
89 bool isdisabled;
90 gColor disabledbcolor, disabledfcolor;
91};
92#endif /* UI_GGUINUMBERBOX_H_ */
93
Definition gBaseApp.h:16
Definition gBaseGUIObject.h:18
gBaseApp * root
Definition gBaseGUIObject.h:147
int width
Definition gBaseGUIObject.h:120
int height
Definition gBaseGUIObject.h:120
Definition gColor.h:17
Definition gGUIContainer.h:15
Definition gGUINumberBox.h:16
void setSize(int width, int height)
std::string getText()
void showTitle(bool isShown)
void mouseDragged(int x, int y, int button)
void charPressed(unsigned int codepoint)
void setText(const std::string &text)
void setMaxValue(float maxValuef)
virtual void set(int x, int y, int w, int h)
virtual void set(gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
void setIntegerIncrement(int value)
void keyPressed(int key)
bool setType(bool isInteger=true)
void mouseReleased(int x, int y, int button)
void setMinValue(int minValue)
void setMinValue(float minValuef)
void setFloatIncrement(float value)
void setFloat(float value)
int getIntegerIncrement()
float getFloatIncrement()
void setDisabled(bool isDisabled)
void keyReleased(int key)
void mousePressed(int x, int y, int button)
void setInteger(int value)
float getFloat()
void setMaxValue(int maxValue)
virtual ~gGUINumberBox()
Definition gGUISizer.h:14
Definition gGUITextbox.h:46
Definition gGUIToolbar.h:27