ConfigOptions: GUI type as enum, not string.

Fixing compilation error in the new Platform code.
Fixing one issue in FDM support after splitting the top/bottom
interface layers.
This commit is contained in:
Vojtech Bubnik 2021-03-11 15:01:24 +01:00
parent 051ba0e6f4
commit a9c3d270e6
10 changed files with 66 additions and 55 deletions

View file

@ -91,7 +91,7 @@ void OG_CustomCtrl::init_ctrl_lines()
height = m_bmp_blinking_sz.GetHeight() + m_v_gap;
ctrl_lines.emplace_back(CtrlLine(height, this, line, true));
}
else if (opt_group->label_width != 0 && (!line.label.IsEmpty() || option_set.front().opt.gui_type == "legend") )
else if (opt_group->label_width != 0 && (!line.label.IsEmpty() || option_set.front().opt.gui_type == ConfigOptionDef::GUIType::legend) )
{
wxSize label_sz = GetTextExtent(line.label);
height = label_sz.y * (label_sz.GetWidth() > int(opt_group->label_width * m_em_unit) ? 2 : 1) + m_v_gap;
@ -186,11 +186,11 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/)
#endif //__WXMSW__
h_pos += label_w + 1 + m_h_gap;
}
h_pos += (opt.opt.gui_type == "legend" ? 1 : 3) * blinking_button_width;
h_pos += (opt.opt.gui_type == ConfigOptionDef::GUIType::legend ? 1 : 3) * blinking_button_width;
if (field == field_in)
break;
if (opt.opt.gui_type == "legend")
if (opt.opt.gui_type == ConfigOptionDef::GUIType::legend)
h_pos += 2 * blinking_button_width;
h_pos += field->getWindow()->GetSize().x;
@ -580,7 +580,7 @@ wxCoord OG_CustomCtrl::CtrlLine::draw_mode_bmp(wxDC& dc, wxCoord v_pos)
wxBitmap bmp = create_scaled_bitmap(bmp_name, ctrl, wxOSX ? 10 : 12);
wxCoord y_draw = v_pos + lround((height - get_bitmap_size(bmp).GetHeight()) / 2);
if (og_line.get_options().front().opt.gui_type != "legend")
if (og_line.get_options().front().opt.gui_type != ConfigOptionDef::GUIType::legend)
dc.DrawBitmap(bmp, 0, y_draw);
return get_bitmap_size(bmp).GetWidth() + ctrl->m_h_gap;