From 907221c94001493061a092324bc305d531d71cae Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 28 Jun 2007 19:11:41 +0000 Subject: [PATCH] Added spec for step in floatedit controls in Lua config dialogs and intedit spin controls seem to work properly now. Originally committed to SVN as r1307. --- aegisub/auto4_lua_dialog.cpp | 9 +++++++-- automation/v4-docs/configuration-dialogs.txt | 7 +++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/aegisub/auto4_lua_dialog.cpp b/aegisub/auto4_lua_dialog.cpp index e9b4dd66f..3d77bfc7f 100644 --- a/aegisub/auto4_lua_dialog.cpp +++ b/aegisub/auto4_lua_dialog.cpp @@ -284,9 +284,12 @@ nospin: wxControl *Create(wxWindow *parent) { if (hasspin) { - cw = new wxSpinCtrl(parent, -1, wxString::Format(_T("%d"), value), wxDefaultPosition, wxDefaultSize, min, max, value); + wxSpinCtrl *scw = new wxSpinCtrl(parent, -1, wxString::Format(_T("%d"), value), wxDefaultPosition, wxDefaultSize, min, max, value); + scw->SetRange(min, max); + scw->SetValue(value); + cw = scw; } else { - cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0); //, IntTextValidator()); + cw = new wxTextCtrl(parent, -1, wxString::Format(_T("%d"), value), wxDefaultPosition, wxDefaultSize, 0); //, IntTextValidator()); } cw->SetToolTip(hint); return cw; @@ -318,6 +321,8 @@ nospin: class FloatEdit : public Edit { public: float value; + bool hasspin; + float min, max; // FIXME: Can't support spin button atm FloatEdit(lua_State *L) diff --git a/automation/v4-docs/configuration-dialogs.txt b/automation/v4-docs/configuration-dialogs.txt index 9bc0597e8..772dc92a6 100644 --- a/automation/v4-docs/configuration-dialogs.txt +++ b/automation/v4-docs/configuration-dialogs.txt @@ -71,6 +71,13 @@ max (number or nil) If both are present, the control gets a spin button, the user can click to update the value of the control. The user won't be able to close the dialog if the value is outside the range between "min" and "max". + + +Key defined only for the "floatedit" class: + +step (number or nil) + If nil/undefined, the value 1 (one) is used instead. + Specifies the size of change when the spin buttons are clicked. Keys defined only for the "dropdown" class: