Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUIEditBox.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_GUI_EDIT_BOX_HPP_INCLUDED
6#define NIRT_I_GUI_EDIT_BOX_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IGUIElement.hpp>
9#include <nirtcpp/core/engine/SColor.hpp>
10
11namespace nirt
12{
13namespace gui
14{
15 class IGUIFont;
16
18
23 class IGUIEditBox : public IGUIElement
24 {
25 public:
26
28 IGUIEditBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
29 : IGUIElement(EGUIET_EDIT_BOX, environment, parent, id, rectangle) {}
30
32
34 virtual void setOverrideFont(IGUIFont* font=0) = 0;
35
37
38 virtual IGUIFont* getOverrideFont() const = 0;
39
41
43 virtual IGUIFont* getActiveFont() const = 0;
44
46
53 virtual void setOverrideColor(video::SColor color) = 0;
54
56 virtual video::SColor getOverrideColor() const = 0;
57
59
62 virtual void enableOverrideColor(bool enable) = 0;
63
65
66 virtual bool isOverrideColorEnabled(void) const = 0;
67
69 virtual void setDrawBackground(bool draw) = 0;
70
72
73 virtual bool isDrawBackgroundEnabled() const = 0;
74
76
77 virtual void setDrawBorder(bool border) = 0;
78
80
81 virtual bool isDrawBorderEnabled() const = 0;
82
84
88 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
89
91
93 virtual void setWordWrap(bool enable) = 0;
94
96
97 virtual bool isWordWrapEnabled() const = 0;
98
100
102 virtual void setMultiLine(bool enable) = 0;
103
105
106 virtual bool isMultiLineEnabled() const = 0;
107
109
110 virtual void setAutoScroll(bool enable) = 0;
111
113
114 virtual bool isAutoScrollEnabled() const = 0;
115
117
120 virtual void setPasswordBox(bool passwordBox, wchar_t passwordChar = L'*') = 0;
121
123 virtual bool isPasswordBox() const = 0;
124
126
128
130
132 virtual void setMax(u32 max) = 0;
133
135 virtual u32 getMax() const = 0;
136
138
139 virtual void setCursorChar(const wchar_t cursorChar) = 0;
140
142 virtual wchar_t getCursorChar() const = 0;
143
145 //** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */
146 virtual void setCursorBlinkTime(nirt::u32 timeMs) = 0;
147
149 virtual nirt::u32 getCursorBlinkTime() const = 0;
150 };
151
152
153} // end namespace gui
154} // end namespace nirt
155
156#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Single line edit box for editing simple text.
Definition IGUIEditBox.hpp:24
virtual wchar_t getCursorChar() const =0
Get the character used for the cursor.
virtual void setCursorChar(const wchar_t cursorChar)=0
Set the character used for the cursor.
virtual void setAutoScroll(bool enable)=0
Enables or disables automatic scrolling with cursor position.
virtual bool isOverrideColorEnabled(void) const =0
Checks if an override color is enabled.
virtual bool isMultiLineEnabled() const =0
Checks if multi line editing is enabled.
virtual bool isAutoScrollEnabled() const =0
Checks to see if automatic scrolling is enabled.
virtual void setDrawBackground(bool draw)=0
Sets whether to draw the background.
virtual void setMax(u32 max)=0
Sets the maximum amount of characters which may be entered in the box.
virtual video::SColor getOverrideColor() const =0
Gets the override color.
virtual void setCursorBlinkTime(nirt::u32 timeMs)=0
Set the blinktime for the cursor. 2x blinktime is one full cycle.
virtual bool isPasswordBox() const =0
Returns true if the edit box is currently a password box.
virtual void setOverrideFont(IGUIFont *font=0)=0
Sets another skin independent font.
virtual void setDrawBorder(bool border)=0
Turns the border on or off.
virtual void enableOverrideColor(bool enable)=0
Sets if the text should use the override color or the color in the gui skin.
virtual void setWordWrap(bool enable)=0
Enables or disables word wrap.
virtual core::dimension2du getTextDimension()=0
Gets the size area of the text in the edit box.
virtual u32 getMax() const =0
Returns maximum amount of characters, previously set by setMax();.
virtual IGUIFont * getOverrideFont() const =0
Gets the override font (if any)
virtual bool isDrawBackgroundEnabled() const =0
Checks if background drawing is enabled.
virtual void setPasswordBox(bool passwordBox, wchar_t passwordChar=L' *')=0
Sets whether the edit box is a password box. Setting this to true will.
virtual void setOverrideColor(video::SColor color)=0
Sets another color for the text.
virtual nirt::u32 getCursorBlinkTime() const =0
Get the cursor blinktime.
virtual bool isWordWrapEnabled() const =0
Checks if word wrap is enabled.
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)=0
Sets text justification mode.
virtual void setMultiLine(bool enable)=0
Enables or disables newlines.
virtual bool isDrawBorderEnabled() const =0
Checks if border drawing is enabled.
virtual IGUIFont * getActiveFont() const =0
Get the font which is used right now for drawing.
IGUIEditBox(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUIEditBox.hpp:28
Base class of all GUI elements.
Definition IGUIElement.hpp:24
virtual void draw()
Draws the element and its children.
Definition IGUIElement.hpp:331
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.hpp:73
Font interface.
Definition IGUIFont.hpp:40
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
@ EGUIET_EDIT_BOX
An edit box (IGUIEditBox)
Definition EGUIElementTypes.hpp:35
EGUI_ALIGNMENT
Definition EGUIAlignment.hpp:15
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print