22 #ifndef BLADERUNNER_UI_DROPDOWN_H 23 #define BLADERUNNER_UI_DROPDOWN_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 class BladeRunnerEngine;
38 typedef void UIDropDownLineSelectedCallback(
void *callbackData,
void *source,
int data,
int mouseButton);
39 typedef void UIDropDownGenericCallback(
void *callbackData,
void *source);
43 static const int kDropDownButtonShapeWidth = 15;
44 static const int kDropDownButtonShapeHeight = 10;
45 static const uint8 kFrameRectPaddingPx = 2;
46 static const int kFurthestLeftForScrollBar = 495;
63 int _lineSelectorFrameRectColor;
64 bool _lineSelectorFrameRectHasFocus;
65 int _lineSelectorScrollBoxMaxLineWidth;
67 UIDropDownLineSelectedCallback *_ddlLineSelectedCallback;
68 UIDropDownGenericCallback *_ddlCancelledCallback;
69 UIDropDownGenericCallback *_ddlTopFrameClickCallback;
77 UIDropDownGenericCallback *ddlCancelledCallback,
78 UIDropDownGenericCallback *ddlTopFrameClickCallback,
83 int scrollBoxMaxLineCount);
88 void handleMouseMove(
int mouseX,
int mouseY)
override;
89 void handleMouseDown(
bool alternateButton)
override;
90 void handleMouseUp(
bool alternateButton)
override;
91 void handleMouseScroll(
int direction)
override;
96 bool isDropDownMenuExpanded();
103 void addLine(
const char *text,
int lineData);
108 void setControlLeft(
int controlLeftX);
113 static void mouseDownLDBCallback(
int buttonId,
void *callbackData);
114 static void scrollBoxLineSelectCallback(
void *callbackData,
void *source,
int lineData,
int mouseButton);
116 void onButtonPressed(
int buttonId);
118 void showSelectionDropdown(
bool showToggle);
Definition: ui_dropdown.h:41
Definition: ui_image_picker.h:40
Definition: ui_component.h:40
Definition: bladerunner.h:113