Allow negative values for shadow depth, angle and spacing in the style editor

This commit is contained in:
Thomas Goyne 2013-01-09 07:29:41 -08:00
parent 7bc79b2d9f
commit 8470ffdbf0
1 changed files with 9 additions and 9 deletions

View File

@ -139,8 +139,8 @@ static wxSpinCtrl *spin_ctrl(wxWindow *parent, float value, int max_value) {
return new wxSpinCtrl(parent, -1, AegiFloatToString(value), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 0, max_value, value);
}
static wxTextCtrl *num_text_ctrl(wxWindow *parent, double value, wxSize size = wxSize(70, 20)) {
return new wxTextCtrl(parent, -1, "", wxDefaultPosition, size, 0, NumValidator(value));
static wxTextCtrl *num_text_ctrl(wxWindow *parent, double value, bool allow_negative, wxSize size = wxSize(70, 20)) {
return new wxTextCtrl(parent, -1, "", wxDefaultPosition, size, 0, NumValidator(value, allow_negative));
}
DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Context *c, AssStyleStorage *store, std::string const& new_name)
@ -186,7 +186,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
// Create controls
StyleName = new wxTextCtrl(this, -1, to_wx(style->name));
FontName = new wxComboBox(this, -1, to_wx(style->font), wxDefaultPosition, wxSize(150, -1), 0, 0, wxCB_DROPDOWN);
FontSize = num_text_ctrl(this, style->fontsize, wxSize(50, -1));
FontSize = num_text_ctrl(this, style->fontsize, false, wxSize(50, -1));
BoxBold = new wxCheckBox(this, -1, _("&Bold"));
BoxItalic = new wxCheckBox(this, -1, _("&Italic"));
BoxUnderline = new wxCheckBox(this, -1, _("&Underline"));
@ -202,13 +202,13 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
for (int i = 0; i < 3; i++)
margin[i] = spin_ctrl(this, style->Margin[i], 9999);
Alignment = new wxRadioBox(this, -1, _("Alignment"), wxDefaultPosition, wxDefaultSize, 9, alignValues, 3, wxRA_SPECIFY_COLS);
Outline = num_text_ctrl(this, style->outline_w, wxSize(50, -1));
Shadow = num_text_ctrl(this, style->shadow_w, wxSize(50, -1));
Outline = num_text_ctrl(this, style->outline_w, false, wxSize(50, -1));
Shadow = num_text_ctrl(this, style->shadow_w, true, wxSize(50, -1));
OutlineType = new wxCheckBox(this, -1, _("&Opaque box"));
ScaleX = num_text_ctrl(this, style->scalex);
ScaleY = num_text_ctrl(this, style->scaley);
Angle = num_text_ctrl(this, style->angle);
Spacing = num_text_ctrl(this, style->spacing);
ScaleX = num_text_ctrl(this, style->scalex, false);
ScaleY = num_text_ctrl(this, style->scaley, false);
Angle = num_text_ctrl(this, style->angle, true);
Spacing = num_text_ctrl(this, style->spacing, true);
Encoding = new wxComboBox(this, -1, "", wxDefaultPosition, wxDefaultSize, encodingStrings, wxCB_READONLY);
// Set control tooltips