add extra_chars to model setup, model name text edit field
This commit is contained in:
@@ -1033,7 +1033,8 @@ void ModelSetupPage::build(FormWindow * window)
|
||||
|
||||
// Model name
|
||||
new StaticText(window, grid.getLabelSlot(), STR_MODELNAME);
|
||||
auto text = new RadioTextEdit(window, grid.getFieldSlot(), g_model.header.name, sizeof(g_model.header.name));
|
||||
auto text = new RadioTextEdit(window, grid.getFieldSlot(), g_model.header.name, sizeof(g_model.header.name),
|
||||
0, "_-.,:;<=>");
|
||||
text->setChangeHandler([=] {
|
||||
modelslist.load();
|
||||
auto model = modelslist.getCurrentModel();
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
class ModelTextEdit: public TextEdit
|
||||
{
|
||||
public:
|
||||
ModelTextEdit(Window * parent, const rect_t & rect, char * value, uint8_t length, LcdFlags windowFlags = 0):
|
||||
TextEdit(parent, rect, value, length, windowFlags)
|
||||
ModelTextEdit(Window * parent, const rect_t & rect, char * value, uint8_t length, LcdFlags windowFlags = 0, const char * extra_chars = nullptr):
|
||||
TextEdit(parent, rect, value, length, windowFlags, extra_chars)
|
||||
{
|
||||
setChangeHandler([](){
|
||||
storageDirty(EE_MODEL);
|
||||
@@ -39,11 +39,11 @@ class ModelTextEdit: public TextEdit
|
||||
class RadioTextEdit: public TextEdit
|
||||
{
|
||||
public:
|
||||
RadioTextEdit(Window * parent, const rect_t & rect, char * value, uint8_t length, LcdFlags windowFlags = 0):
|
||||
TextEdit(parent, rect, value, length, windowFlags)
|
||||
RadioTextEdit(Window * parent, const rect_t & rect, char * value, uint8_t length, LcdFlags windowFlags = 0, const char * extra_chars = nullptr):
|
||||
TextEdit(parent, rect, value, length, windowFlags, extra_chars)
|
||||
{
|
||||
setChangeHandler([](){
|
||||
storageDirty(EE_GENERAL);
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user