summaryrefslogtreecommitdiffstats
path: root/client/SDL/dialogs/sdl_selectlist.hpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
commita9bcc81f821d7c66f623779fa5147e728eb3c388 (patch)
tree98676963bcdd537ae5908a067a8eb110b93486a6 /client/SDL/dialogs/sdl_selectlist.hpp
parentInitial commit. (diff)
downloadfreerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.tar.xz
freerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.zip
Adding upstream version 3.3.0+dfsg1.upstream/3.3.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'client/SDL/dialogs/sdl_selectlist.hpp')
-rw-r--r--client/SDL/dialogs/sdl_selectlist.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/client/SDL/dialogs/sdl_selectlist.hpp b/client/SDL/dialogs/sdl_selectlist.hpp
new file mode 100644
index 0000000..3da0e14
--- /dev/null
+++ b/client/SDL/dialogs/sdl_selectlist.hpp
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include <SDL.h>
+
+#include "sdl_select.hpp"
+#include "sdl_button.hpp"
+#include "sdl_buttons.hpp"
+
+class SdlSelectList
+{
+ public:
+ SdlSelectList(const std::string& title, const std::vector<std::string>& labels);
+ virtual ~SdlSelectList();
+
+ int run();
+
+ private:
+ SdlSelectList(const SdlSelectList& other) = delete;
+ SdlSelectList(SdlSelectList&& other) = delete;
+
+ private:
+ enum
+ {
+ INPUT_BUTTON_ACCEPT = 0,
+ INPUT_BUTTON_CANCEL = -2
+ };
+
+ private:
+ ssize_t get_index(const SDL_MouseButtonEvent& button);
+ bool update_text();
+ void reset_mouseover();
+ void reset_highlight();
+
+ private:
+ SDL_Window* _window;
+ SDL_Renderer* _renderer;
+ std::vector<SdlSelectWidget> _list;
+ SdlButtonList _buttons;
+};