-
Notifications
You must be signed in to change notification settings - Fork 452
Expand file tree
/
Copy pathDropdown.hpp
More file actions
45 lines (34 loc) · 1.07 KB
/
Dropdown.hpp
File metadata and controls
45 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include <Geode/DefaultInclude.hpp>
#include <Geode/utils/function.hpp>
#include <cocos2d.h>
#include <string>
#include <vector>
class DropdownOverlay;
namespace geode {
class GEODE_DLL Dropdown : public cocos2d::CCNode {
class Impl;
std::unique_ptr<Impl> m_impl;
friend class ::DropdownOverlay;
protected:
Dropdown();
~Dropdown() override;
bool init(
float width, std::vector<std::string> options,
Function<void(std::string const&, size_t)> callback
);
void onOpen(cocos2d::CCObject*);
public:
static Dropdown* create(
float width, std::vector<std::string> options,
Function<void(std::string const&, size_t)> callback
);
void setSelected(size_t index);
void setSelected(std::string_view value);
size_t getSelectedIndex() const;
std::string getSelectedValue() const;
void setEnabled(bool enabled);
bool isEnabled() const;
void setItems(std::vector<std::string> options);
};
}