GUI: Implement immediate coordinate mode for PopUp widget

This commit is contained in:
Eugene Sandulenko 2016-03-30 19:02:02 +02:00
parent f58b43b38a
commit 35a44edca1
2 changed files with 9 additions and 0 deletions

View File

@ -382,6 +382,14 @@ PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const char *toolti
_selectedItem = -1;
}
PopUpWidget::PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip)
: Widget(boss, x, y, w, h, tooltip), CommandSender(boss) {
setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_IGNORE_DRAG);
_type = kPopUpWidget;
_selectedItem = -1;
}
void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
if (isEnabled()) {
PopUpDialog popupDialog(this, x + getAbsX(), y + getAbsY());

View File

@ -58,6 +58,7 @@ protected:
public:
PopUpWidget(GuiObject *boss, const String &name, const char *tooltip = 0);
PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0);
void handleMouseDown(int x, int y, int button, int clickCount);
void handleMouseWheel(int x, int y, int direction);