aboutsummaryrefslogtreecommitdiff
path: root/include/Entry.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-17 09:47:45 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-17 09:59:29 +0100
commit453eac7f1f5ef70390ec51087fc1f190811a7507 (patch)
tree21a32ef6de9a3d7c29562484104b56c12518a6f0 /include/Entry.hpp
parentfc49d40c0d2f6edbbe9dde1f1b53d6a17e9d9f7d (diff)
Replace sfml with mgl
Diffstat (limited to 'include/Entry.hpp')
-rw-r--r--include/Entry.hpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/Entry.hpp b/include/Entry.hpp
index 1ee237b..00c22a4 100644
--- a/include/Entry.hpp
+++ b/include/Entry.hpp
@@ -2,13 +2,13 @@
#include "Text.hpp"
#include "RoundedRectangle.hpp"
-#include <SFML/Graphics/Text.hpp>
+#include <mglpp/graphics/Text.hpp>
#include <functional>
-namespace sf {
+namespace mgl {
class Font;
class Event;
- class RenderWindow;
+ class Window;
class Shader;
}
@@ -18,24 +18,24 @@ namespace QuickMedia {
class Entry {
public:
- Entry(const std::string &placeholder_text, sf::Shader *rounded_rectangle_shader);
- void process_event(sf::Event &event);
- void draw(sf::RenderWindow &window);
+ Entry(const std::string &placeholder_text, mgl::Shader *rounded_rectangle_shader);
+ void process_event(mgl::Window &window, mgl::Event &event);
+ void draw(mgl::Window &window);
void set_single_line(bool single_line);
void set_editable(bool editable);
- void set_text(const std::string &text);
- void set_position(const sf::Vector2f &pos);
+ void set_text(std::string text);
+ void set_position(const mgl::vec2f &pos);
void set_max_width(float width);
void move_caret_to_end();
- void append_text(const std::string &str);
+ void insert_text_at_caret_position(const std::string &str);
- void replace(size_t start_index, size_t length, const sf::String &insert_str);
+ void replace(size_t start_index, size_t length, const std::string &insert_str);
int get_caret_index() const;
bool is_editable() const;
float get_height();
- const sf::String& get_text() const;
+ const std::string& get_text() const;
OnEntrySubmit on_submit_callback;
bool draw_background;
@@ -43,7 +43,7 @@ namespace QuickMedia {
Text text;
float width;
RoundedRectangle background;
- sf::Text placeholder;
+ mgl::Text placeholder;
bool mouse_left_inside;
};
} \ No newline at end of file