initial commit
This commit is contained in:
32
NewDialogs/Scrollbar.h
Normal file
32
NewDialogs/Scrollbar.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef SCROLLBAR
|
||||
#define SCROLLBAR
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include "Item.h"
|
||||
|
||||
class Scrollbar : public Item {
|
||||
private:
|
||||
bool vertical;
|
||||
int min_value;
|
||||
int max_value;
|
||||
int value;
|
||||
int bar_size;
|
||||
int mouse_offset;
|
||||
bool pressed;
|
||||
void (*value_changed_func)(void *p);
|
||||
void *p;
|
||||
public:
|
||||
Scrollbar(int min_value, int max_value, int value, SDL_Rect pos);
|
||||
~Scrollbar();
|
||||
void drawScrollbar();
|
||||
bool onMousePress(int x, int y);
|
||||
void onMouseRelease(int x, int y);
|
||||
void onMouseMove(int x, int y);
|
||||
int getBarPos();
|
||||
void setValueByBarPos(int pos);
|
||||
void setValueChangedFunc(void (*value_changed_func)(void *p), void *p);
|
||||
int getValue();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user