initial commit
This commit is contained in:
40
NewDialogs/DropDownList.h
Normal file
40
NewDialogs/DropDownList.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef DROP_DOWN_LIST
|
||||
#define DROP_DOWN_LIST
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "Item.h"
|
||||
#include "Dialog.h"
|
||||
|
||||
class DropDownList : public Item {
|
||||
private:
|
||||
vector<string> list;
|
||||
vector<Dialog *> *dialogs;
|
||||
int selected;
|
||||
int listbox_item_size;
|
||||
int listbox_height;
|
||||
bool pressed;
|
||||
void (*value_changed_func)(void *p, Item *i);
|
||||
void *p;
|
||||
public:
|
||||
DropDownList(vector<string> list, vector<Dialog *> *dialogs, SDL_Rect pos);
|
||||
~DropDownList();
|
||||
void drawDropDownList();
|
||||
bool onMousePress(int x, int y);
|
||||
void onMouseRelease(int x, int y);
|
||||
vector<string> getList();
|
||||
void setSelected(int selected);
|
||||
void setValueChangedFunc(void (*value_changed_func)(void *p, Item *i), void *p);
|
||||
string getString();
|
||||
void reset();
|
||||
void add(string s);
|
||||
bool select(string s);
|
||||
int getListboxItemSize();
|
||||
int getListboxHeight();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user