Changes between Version 11 and Version 12 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Form/FORM_ADD_INPUT
- Timestamp:
- 04/13/18 07:47:20 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/Form/FORM_ADD_INPUT
v11 v12 41 41 == Remarks == 42 42 43 FORM_ADD_INPUT is a macro to simplify the creation of inputs on forms. The preprocessor will replace this with two lines of code: The creation of the CFormInput with the specified name and then the call to the Add function of the specified form to add the input. 44 {{{ 45 #define FORM_ADD_INPUT(f, name, x, y, prompt, len, min, max, func, pval, flag, choices, help, moreargs...) \ 46 CFormInput inp##name((x),(y),(prompt),(len),(min),(max),(func),(pval),(flag),(choices),(help), ##moreargs); \ 47 form##f.Add(inp##name) 48 }}} 49 43 50 The FORM_ADD_INPUT macro should not be inserted in a condition. An entire form FORM_INIT .. FORM_HIDE may be in a condition. If any FORM_ADD_INPUT macros are in conditions the form will then have an invalid pointer for each occurrence. The reason is that the FORM_ADD_INPUT macro declares a CFormInput item and then adds the item to the specified form. The CFormInput item will go out of scope at the end of the condition. If conditional items are needed the FORM_FLAG_DISABLE may be used to make the item hidden. The [wiki:CForm CForm::EnableItem] function may then be used to conditionally show the item. 44 51