17#ifndef _FGE_C_OBJSELECTBOX_HPP_INCLUDED
18#define _FGE_C_OBJSELECTBOX_HPP_INCLUDED
20#include "FastEngine/fge_extern.hpp"
22#include "FastEngine/C_guiElement.hpp"
23#include "FastEngine/object/C_objRectangleShape.hpp"
24#include "FastEngine/object/C_objText.hpp"
25#include "FastEngine/object/C_object.hpp"
28#define FGE_OBJSELECTBOX_CLASSNAME "FGE:OBJ:SELECTBOX"
41 fge::
GuiElement* getGuiElement()
override {
return this; }
43 std::size_t getItemCount()
const;
44 tiny_utf8::string
const* getItem(std::size_t index)
const;
45 bool setItem(std::size_t index, tiny_utf8::string text);
46 void addItem(tiny_utf8::string text);
49 void setSelectedText(tiny_utf8::string
string);
50 tiny_utf8::string
const& getSelectedText()
const;
51 void clearSelectedText();
53 void setCharacterSize(fge::CharacterSize size);
55 void setActiveStat(
bool active);
56 bool getActiveStat()
const;
58 void setBoxSize(fge::Vector2f
const& size);
63 fge::CharacterSize getCharacterSize()
const;
65 fge::Vector2f
const& getBoxSize()
const;
94 void updateBoxInstances();
100 mutable std::vector<fge::ObjText> g_textList;
104 std::size_t g_cursor = std::numeric_limits<std::size_t>::max();
106 bool g_statMouseOn =
false;
107 bool g_statActive =
false;
This class is used to handle callbacks in a safe way.
Definition C_callback.hpp:189
Definition C_color.hpp:35
static Color const Black
Black predefined color.
Definition C_color.hpp:140
static Color const White
White predefined color.
Definition C_color.hpp:141
This class is a wrapper for SDL events.
Definition C_event.hpp:59
This class is a wrapper for the font manager to allow easy manipulation.
Definition C_font.hpp:35
A class to handle highest priority selection of GUI elements.
Definition C_guiElement.hpp:235
A base class for all GUI elements.
Definition C_guiElement.hpp:120
Definition C_objRectangleShape.hpp:36
Definition C_objSelectBox.hpp:34
void load(nlohmann::json &jsonObject, fge::Scene *scene) override
Load the object from a json object.
void callbackRegister(fge::Event &event, fge::GuiElementHandler *guiElementHandlerPtr) override
Ask the object to register all callbacks it needs to receive events.
FGE_OBJ_DRAW_DECLARE void save(nlohmann::json &jsonObject, fge::Scene *scene) override
Save the object to a json object.
char const * getClassName() const override
Get the unique class name of the object.
fge::RectFloat getLocalBounds() const override
Get the local bounds of the object (without any transformations)
void pack(fge::net::Packet &pck) override
Pack the object into a packet.
void unpack(fge::net::Packet const &pck) override
Unpack the object from a packet.
fge::RectFloat getGlobalBounds() const override
Get the global bounds of the object.
char const * getReadableClassName() const override
Get a readable version of the class name.
Definition C_objText.hpp:90
The Object class is the base class for all objects in the engine.
Definition C_object.hpp:102
A scene contain a collection of object and handle them.
Definition C_scene.hpp:450
This class is a useful utility to "link" multiple objects around.
Definition C_subscription.hpp:150
Definition C_packet.hpp:70
Definition C_guiElement.hpp:45