YCLIMP
Yandex Command Line Interface Music Player
Loading...
Searching...
No Matches
ListDialogElement.hpp
1#pragma once
2
3#include "DialogElement.hpp"
4#include "ElementSelector.hpp"
5
6#include <vector>
7
20template <typename ElementPtr>
22class ListDialogElement : public DialogElement
23{
24public:
25 enum class Type
26 {
27 ReadOnly = 0,
28 OneChoice,
29 MultipleChoice,
30 };
31
33 {
34 Recti text;
35 Recti list;
36 Recti confirm;
37 };
38
39public:
40 ListDialogElement(const Recti& bounds, std::string text,
41 std::vector<ElementPtr> elements, Type type,
42 std::vector<std::string>&& options = {CANCEL_OPTION, OK_OPTION});
43
44 virtual void Draw() const override;
45 virtual void HandleResizeEvent(const Recti& newRect) override;
46 virtual void HandleRawInput(int rawInputChar) override;
47
48 virtual void InputUp() override;
49 virtual void InputDown() override;
50 virtual void InputLeft() override;
51 virtual void InputRight() override;
52 virtual void InputEnter() override;
53 virtual void InputTab() override;
54
55private:
56 Recti mBounds;
57 LocalBounds mLBounds;
58 HorizontalOptionChoice mHorizontalChoice;
59 std::string mText;
60 ElementSelector<ElementPtr> mFileSelector;
61 Type mType;
62};
63
64#include "ListDialogElement.tpp"
The ElementSelector class - class to select & draw list of elements.
Definition ElementSelector.hpp:55
The HorizontalOptionChoice class - part of the DialogElement. Most or all of the dialogs has this hor...
Definition DialogElement.hpp:23
Definition ElementSelector.hpp:28
Definition ListDialogElement.hpp:33