pos = getElementBasePos(&v_pos);
pos -= padding;
- pos.X += stof(v_pos[0]) * spacing.X;
- pos.Y += stof(v_pos[1]) * spacing.Y + (m_btn_height * 2);
-
geom.X = (stof(v_geom[0]) * spacing.X) - (spacing.X - imgsize.X);
- geom.Y = (stof(v_geom[1]) * imgsize.Y) - (spacing.Y - imgsize.Y);
+ geom.Y = (stof(v_geom[1]) * (float)imgsize.Y) - (spacing.Y - imgsize.Y);
+ pos.Y += m_btn_height;
}
core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X + geom.X, pos.Y + geom.Y);
258 + m_fields.size()
);
- spec.ftype = f_Unknown;
+ spec.ftype = f_HyperText;
GUIHyperText *e = new GUIHyperText(spec.flabel.c_str(), Environment, this,
spec.fid, rect, m_client, m_tsrc);
e->drop();
}
#ifndef HAVE_TOUCHSCREENGUI
- if (current_cursor_icon != field.fcursor_icon)
+ if (field.ftype != f_HyperText && // Handled directly in guiHyperText
+ current_cursor_icon != field.fcursor_icon)
cursor_control->setActiveIcon(field.fcursor_icon);
#endif
(event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED) ||
(event.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED) ||
(event.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED)) {
- unsigned int btn_id = event.GUIEvent.Caller->getID();
+ s32 caller_id = event.GUIEvent.Caller->getID();
- if (btn_id == 257) {
+ if (caller_id == 257) {
if (m_allowclose) {
acceptInput(quit_mode_accept);
quitMenu();
for (GUIFormSpecMenu::FieldSpec &s : m_fields) {
// if its a button, set the send field so
// lua knows which button was pressed
- if ((s.ftype == f_Button || s.ftype == f_CheckBox) &&
- s.fid == event.GUIEvent.Caller->getID()) {
+
+ if (caller_id != s.fid)
+ continue;
+
+ if (s.ftype == f_Button || s.ftype == f_CheckBox) {
s.send = true;
if (s.is_exit) {
if (m_allowclose) {
s.send = false;
return true;
- } else if ((s.ftype == f_DropDown) &&
- (s.fid == event.GUIEvent.Caller->getID())) {
+ } else if (s.ftype == f_DropDown) {
// only send the changed dropdown
for (GUIFormSpecMenu::FieldSpec &s2 : m_fields) {
if (s2.ftype == f_DropDown) {
}
}
return true;
- } else if ((s.ftype == f_ScrollBar) &&
- (s.fid == event.GUIEvent.Caller->getID())) {
+ } else if (s.ftype == f_ScrollBar) {
s.fdefault = L"Changed";
acceptInput(quit_mode_no);
s.fdefault = L"";
- } else if ((s.ftype == f_Unknown) &&
- (s.fid == event.GUIEvent.Caller->getID())) {
+ } else if (s.ftype == f_Unknown || s.ftype == f_HyperText) {
s.send = true;
acceptInput();
s.send = false;