@@ -1890,12 +1890,11 @@ bool P104_data_struct::webform_load(struct EventStruct *event) {
18901890 static_cast <int >(MD_MAX72XX::moduleType_t::DR0CR1RR1_HW),
18911891 static_cast <int >(MD_MAX72XX::moduleType_t::DR1CR0RR1_HW)
18921892 };
1893- addFormSelector (F (" Hardware type" ),
1894- F (" hardware" ),
1895- P104_hardwareTypeCount,
1896- hardwareTypes,
1897- hardwareOptions,
1898- P104_CONFIG_HARDWARETYPE);
1893+ FormSelectorOptions selector (
1894+ P104_hardwareTypeCount,
1895+ hardwareTypes,
1896+ hardwareOptions);
1897+ selector.addFormSelector (F (" Hardware type" ), F (" hardware" ), P104_CONFIG_HARDWARETYPE);
18991898 # ifdef P104_ADD_SETTINGS_NOTES
19001899 addFormNote (F (" DR = Digits as Rows, CR = Column Reversed, RR = Row Reversed; 0 = no, 1 = yes." ));
19011900 # endif // ifdef P104_ADD_SETTINGS_NOTES
@@ -1929,10 +1928,9 @@ bool P104_data_struct::webform_load(struct EventStruct *event) {
19291928 P104_DATE_FORMAT_US,
19301929 P104_DATE_FORMAT_JP
19311930 };
1932- addFormSelector (F (" Date format" ), F (" datefmt" ),
1933- 3 ,
1934- dateFormats, dateFormatOptions,
1935- get4BitFromUL (P104_CONFIG_DATETIME, P104_CONFIG_DATETIME_FORMAT));
1931+ FormSelectorOptions selector (3 , dateFormats, dateFormatOptions);
1932+ selector.addFormSelector (F (" Date format" ), F (" datefmt" ),
1933+ get4BitFromUL (P104_CONFIG_DATETIME, P104_CONFIG_DATETIME_FORMAT));
19361934 }
19371935 { // Date separator
19381936 const __FlashStringHelper *dateSeparators[] = {
@@ -1947,10 +1945,9 @@ bool P104_data_struct::webform_load(struct EventStruct *event) {
19471945 P104_DATE_SEPARATOR_DASH,
19481946 P104_DATE_SEPARATOR_DOT
19491947 };
1950- addFormSelector (F (" Date separator" ), F (" datesep" ),
1951- 4 ,
1952- dateSeparators, dateSeparatorOptions,
1953- get4BitFromUL (P104_CONFIG_DATETIME, P104_CONFIG_DATETIME_SEP_CHAR));
1948+ FormSelectorOptions selector (4 , dateSeparators, dateSeparatorOptions);
1949+ selector.addFormSelector (F (" Date separator" ), F (" datesep" ),
1950+ get4BitFromUL (P104_CONFIG_DATETIME, P104_CONFIG_DATETIME_SEP_CHAR));
19541951
19551952 addFormCheckBox (F (" Year uses 4 digits" ), F (" year4dgt" ), bitRead (P104_CONFIG_DATETIME, P104_CONFIG_DATETIME_YEAR4DGT));
19561953 }
@@ -1974,24 +1971,27 @@ bool P104_data_struct::webform_load(struct EventStruct *event) {
19741971 # endif // ifdef P104_USE_ZONE_ORDERING
19751972 " will save and reload the page." );
19761973 # endif // if defined(P104_USE_TOOLTIPS) || defined(P104_ADD_SETTINGS_NOTES)
1977- addFormSelector (F (" Zones" ), F (" zonecnt" ), P104_MAX_ZONES, zonesList, zonesOptions, nullptr , P104_CONFIG_ZONE_COUNT, true
1978- # ifdef P104_USE_TOOLTIPS
1979- , zonetip
1980- # endif // ifdef P104_USE_TOOLTIPS
1981- );
1974+
1975+ FormSelectorOptions selector (P104_MAX_ZONES, zonesList, zonesOptions);
1976+ selector.reloadonchange = true ;
1977+ # ifdef P104_USE_TOOLTIPS
1978+ selector.tooltip = zonetip;
1979+ #endif
1980+ selector.addFormSelector (F (" Zones" ), F (" zonecnt" ), P104_CONFIG_ZONE_COUNT);
19821981
19831982 # ifdef P104_USE_ZONE_ORDERING
19841983 const String orderTypes[] = {
19851984 F (" Numeric order (1..n)" ),
19861985 F (" Display order (n..1)" )
19871986 };
19881987 const int orderOptions[] = { 0 , 1 };
1989- addFormSelector (F (" Zone order" ), F (" zoneorder" ), 2 , orderTypes, orderOptions, nullptr ,
1990- bitRead (P104_CONFIG_FLAGS, P104_CONFIG_FLAG_ZONE_ORDER) ? 1 : 0 , true
1991- # ifdef P104_USE_TOOLTIPS
1992- , zonetip
1993- # endif // ifdef P104_USE_TOOLTIPS
1994- );
1988+ FormSelectorOptions selector_zoneordering (2 , orderTypes, orderOptions);
1989+ selector.reloadonchange = true ;
1990+ # ifdef P104_USE_TOOLTIPS
1991+ selector.tooltip = zonetip;
1992+ #endif
1993+ selector_zoneordering.addFormSelector (F (" Zone order" ), F (" zoneorder" ),
1994+ bitRead (P104_CONFIG_FLAGS, P104_CONFIG_FLAG_ZONE_ORDER) ? 1 : 0 );
19951995 # endif // ifdef P104_USE_ZONE_ORDERING
19961996 # ifdef P104_ADD_SETTINGS_NOTES
19971997 addFormNote (zonetip);
0 commit comments