Set the margin controls in the style editor to the correct initial values

This commit is contained in:
Thomas Goyne 2014-06-07 06:56:05 -07:00 committed by Thomas Goyne
parent ce29d07113
commit aae82f01e9
1 changed files with 4 additions and 5 deletions

View File

@ -148,10 +148,6 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
sizer->Add(ctrl, wxSizerFlags(1).Left().Expand()); sizer->Add(ctrl, wxSizerFlags(1).Left().Expand());
}; };
auto spin_ctrl = [&](float value, int max_value) {
return new wxSpinCtrl(this, -1, std::to_wstring(value), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 0, max_value, value);
};
auto num_text_ctrl = [&](double *value, double min, double max, double step) -> wxSpinCtrlDouble * { auto num_text_ctrl = [&](double *value, double min, double max, double step) -> wxSpinCtrlDouble * {
auto scd = new wxSpinCtrlDouble(this, -1, "", wxDefaultPosition, auto scd = new wxSpinCtrlDouble(this, -1, "", wxDefaultPosition,
wxSize(75, -1), wxSP_ARROW_KEYS, min, max, *value, step); wxSize(75, -1), wxSP_ARROW_KEYS, min, max, *value, step);
@ -201,7 +197,10 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
new ColourButton(this, wxSize(55, 16), true, style->shadow, ColorValidator(&work->shadow)) new ColourButton(this, wxSize(55, 16), true, style->shadow, ColorValidator(&work->shadow))
}; };
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
margin[i] = spin_ctrl(style->Margin[i], 9999); margin[i] = new wxSpinCtrl(this, -1, std::to_wstring(style->Margin[i]),
wxDefaultPosition, wxSize(60, -1),
wxSP_ARROW_KEYS, 0, 9999, style->Margin[i]);
Alignment = new wxRadioBox(this, -1, _("Alignment"), wxDefaultPosition, wxDefaultSize, 9, alignValues, 3, wxRA_SPECIFY_COLS); Alignment = new wxRadioBox(this, -1, _("Alignment"), wxDefaultPosition, wxDefaultSize, 9, alignValues, 3, wxRA_SPECIFY_COLS);
auto Outline = num_text_ctrl(&work->outline_w, 0.0, 1000.0, 0.1); auto Outline = num_text_ctrl(&work->outline_w, 0.0, 1000.0, 0.1);
auto Shadow = num_text_ctrl(&work->shadow_w, 0.0, 1000.0, 0.1); auto Shadow = num_text_ctrl(&work->shadow_w, 0.0, 1000.0, 0.1);