Version 1 (modified by 14 years ago) ( diff ) | ,
---|
FORM_ADD_INPUT
Adds an input item to a form.
void FORM_ADD_INPUT(formName name, inputName, int x, int y, const char* pszPrompt, int nLen, int nMin, int nMax, event, string& strVal, uint32 nFlag, const char* pszChoices, const char* pszHelp, int nIDVal = 0); void FORM_ADD_INPUT(formName name, inputName, int x, int y, const char* pszPrompt, int nLen, int nMin, int nMax, event, float& fVal, uint32 nFlag, const char* pszChoices, const char* pszHelp, int nIDVal = 0); void FORM_ADD_INPUT(formName name, inputName, int x, int y, const char* pszPrompt, int nLen, int nMin, int nMax, event, uint8& byVal, uint32 nFlag, const char* pszChoices, const char* pszHelp, int nIDVal = 0); void FORM_ADD_INPUT(formName name, inputName, int x, int y, const char* pszPrompt, int nLen, int nMin, int nMax, event, uint16& nVal, uint32 nFlag, const char* pszChoices, const char* pszHelp, int nIDVal = 0); void FORM_ADD_INPUT(formName name, inputName, int x, int y, const char* pszPrompt, int nLen, int nMin, int nMax, event, uint32& nVal, uint32 nFlag, const char* pszChoices, const char* pszHelp, int nIDVal = 0); void FORM_ADD_INPUT(formName name, inputName, int x, int y, const char* pszPrompt, int nLen, int nMin, int nMax, event, void* pVal, uint32 nFlag, const char* pszChoices, const char* pszHelp, int nIDVal = 0);
Parameters
- formName - name of the form, this much match the name of the FORM_INIT
- inputName - name of the input, this must be unique within this form
- x - X coordinate (0 - 639)
- y - Y coordinate (0 - 479)
- pszPrompt - Prompt text
- nLen - Maximum input length
- nMin - For numeric input minimum accepted value
- nMax - For numeric input maximum accepted value
- event - Event to be called when field is updated, may be NULL to not call event.
- strVal - String field data, when form starts will display contents of the string, when form is completed new data will be written to string
- fVal - Floating point number field data, when form starts display the value, when form is completed new data will be written to string
- nFlag - Flags such as FORM_UINT8_SEL to show selection data
- pszChoices - Character array of choices such as "COM1|COM2|COM3" for flag FORM_UINT8_SEL
- pszHelp - Help text to be displayed at the bottom of screen when field is selected
- nIDVal - Custom ID value that may be used in some cases
Return Value
This function does not return any value
Remarks
Examples
void IDScreen(void) { string strID1 = ""; string strID2 = ""; FORM_INIT(ID, EventIDShow, NULL, NULL, NULL, nFormFlgShowHelp); FORM_ADD_INPUT(ID, ID1, 0, 50, "ID 1: ", 10, 0, 0, NULL, strID1, 0, NULL, "Enter the ID 1"); FORM_ADD_INPUT(ID, ID2, 0, 80, "ID 2: ", 10, 0, 0, NULL, strID2, 0, NULL, "Enter the ID 2"); FORM_SHOW(ID); FORM_RUN(ID); FORM_HIDE(ID); // strID1 and strID2 now contain the entered data } EVENT(IDShow) { ClearLCD(); DisplayText(0, 0, "ID Input Screen"); return 0; }
See Also
- FORM_ADD_INPUT
- FORM_ADD_BUTTON
- FORM_SHOW
- FORM_RUN
Note:
See TracWiki
for help on using the wiki.