TurtleBrains
0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tbx_interface_textbox.hpp
1
9
#ifndef TurtleBrainsExpress_InterfaceTextbox_hpp
10
#define TurtleBrainsExpress_InterfaceTextbox_hpp
11
12
#include <turtle_brains/express/interface/tbx_interface.hpp>
13
#include <turtle_brains/express/interface/tbx_interface_element.hpp>
14
#include <turtle_brains/graphics/tb_text.hpp>
15
16
#include <functional>
17
18
namespace
TurtleBrainsExpress
19
{
20
namespace
Interface
21
{
22
namespace
Unstable
23
{
24
class
InterfaceHandlerInterface;
25
29
class
Textbox
:
public
Element
30
{
31
public
:
32
Textbox
(
const
tbCore::tbString
& textString =
""
);
33
virtual
~
Textbox
(
void
) = 0;
34
35
const
tbCore::tbString
& GetTextString(
void
)
const
;
36
void
SetTextString(
const
tbCore::tbString
& textString);
37
void
SetMaximumLength(
tbCore::uint16
maximumLength);
38
void
SetAlphaNumeric(
const
bool
isAlphaNumeric);
39
40
protected
:
41
virtual
void
OnHandleUserEvent(
const
UserEvent
& userEvent)
override
;
42
virtual
void
OnHandleActiveUserEvent(
const
UserEvent
& userEvent)
override
;
43
virtual
void
OnActivate(
void
)
override
;
44
virtual
void
OnStateChange(
const
State& newState)
override
;
45
46
virtual
void
OnStringChange(
const
tbCore::tbString
& newString) = 0;
47
48
private
:
49
tbCore::tbString
mTextString;
50
tbCore::uint16
mMaximumLength;
51
bool
mIsAlphaNumeric;
52
};
53
54
class
SimpleTextbox
:
public
Textbox
55
{
56
public
:
57
SimpleTextbox
(
const
tbGraphics::PixelSpace
& width,
const
tbGraphics::PixelSpace
& height);
58
virtual
~
SimpleTextbox
(
void
);
59
60
protected
:
61
virtual
void
OnStringChange(
const
tbCore::tbString
& newString)
override
;
62
63
private
:
64
tbGraphics::Text
mText;
65
};
66
67
};
68
};
/* namespace Interface */
69
};
/* namespace TurtleBrainsExpress */
70
71
namespace
tbxInterface
=
TurtleBrainsExpress::Interface
;
72
73
#endif
/* TurtleBrainsExpress_InterfaceTextbox_hpp */
TurtleBrainsExpress::Interface::Unstable::UserEvent
Definition:
tbx_interface.hpp:66
TurtleBrains::Core::uint16
uint16_t uint16
Unsigned integer with a size of 16 bits. Supports values from 0 to 65535.
Definition:
tb_types.hpp:26
TurtleBrainsExpress
A collection of objects and functions to express games quickly.
TurtleBrainsExpress::Interface::Unstable::SimpleTextbox
Definition:
tbx_interface_textbox.hpp:54
TurtleBrainsExpress::Interface
Definition:
tbx_interface.hpp:18
TurtleBrainsExpress::Interface::Unstable::Textbox
Definition:
tbx_interface_textbox.hpp:29
TurtleBrains::Graphics::PixelSpace
tbCore::uint16 PixelSpace
Definition:
tb_texture_manager.hpp:36
TurtleBrains::Graphics::Text
Definition:
tb_text.hpp:42
TurtleBrainsExpress::Interface::Unstable::Element
Definition:
tbx_interface_element.hpp:28
TurtleBrains::Core::tbString
std::string tbString
Definition:
tb_string.hpp:335
source
turtle_brains
express
interface
tbx_interface_textbox.hpp
Generated on Sat May 21 2022 14:31:24 for TurtleBrains by
1.8.9.1