22 #ifndef BLADERUNNER_UI_SCROLLBOX_H 23 #define BLADERUNNER_UI_SCROLLBOX_H 25 #include "bladerunner/color.h" 26 #include "bladerunner/ui/ui_component.h" 28 #include "common/array.h" 29 #include "common/rect.h" 30 #include "common/str.h" 34 typedef void UIScrollBoxClickedCallback(
void *callbackData,
void *source,
int lineData,
int mouseButton);
37 static const int kLineHeight = 10;
38 static const Color256 k3DFrameColors[];
39 static const Color256 kTextBackgroundColors[];
40 static const Color256 kTextColors1[];
41 static const Color256 kTextColors2[];
42 static const Color256 kTextColors3[];
43 static const Color256 kTextColors4[];
52 int _selectedLineState;
53 int _scrollUpButtonState;
54 int _scrollDownButtonState;
55 int _scrollAreaUpState;
56 int _scrollAreaDownState;
60 int _selectedLineIndex;
62 bool _scrollUpButtonHover;
63 bool _scrollDownButtonHover;
64 bool _scrollAreaUpHover;
65 bool _scrollAreaDownHover;
70 UIScrollBoxClickedCallback *_lineSelectedCallback;
77 uint32 _timeLastScroll;
78 uint32 _timeLastCheckbox;
79 uint32 _timeLastHighlight;
90 int _firstLineVisible;
96 UIScrollBoxClickedCallback *lineSelectedCallback,
108 void handleMouseMove(
int mouseX,
int mouseY)
override;
109 void handleMouseDown(
bool alternateButton)
override;
110 void handleMouseUp(
bool alternateButton)
override;
111 void handleMouseScroll(
int direction)
override;
118 void setBoxTop(
int top);
119 void setBoxLeft(
int left);
120 void setBoxWidth(uint16 width);
121 void setScrollbarTop(
int top);
122 void setScrollbarLeft(
int left);
123 void setScrollbarWidth(uint16 width);
126 uint16 getBoxWidth();
130 void addLine(
const Common::String &text,
int lineData,
int flags);
131 void addLine(
const char *text,
int lineData,
int flags);
134 int getSelectedLineData();
136 int getMaxLinesVisible();
141 void toggleCheckBox(
int lineData);
143 bool hasLine(
int lineData);
145 void resetHighlight(
int lineData);
146 void setFlags(
int lineData,
int flags);
147 void resetFlags(
int lineData,
int flags);
150 static int sortFunction(
const void *line1,
const void *line2);
157 int findLine(
int lineData);
Definition: ui_component.h:40
Definition: bladerunner.h:113