| Version 3 (modified by , 15 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 strID = "";
float fVal = 0.0;
FORM_INIT(ID, EventIDShow, NULL, NULL, NULL, nFormFlgShowHelp);
FORM_ADD_INPUT(ID, ID, 0, 50, "ID: ", 10, 0, 0, NULL, strID, 0, NULL, "Enter the ID");
FORM_ADD_INPUT(ID, Val, 0, 80, "Value: ", 10, 0, 9999, NULL, fVal, 0, NULL, "Enter the value");
FORM_SHOW(ID);
FORM_RUN(ID);
FORM_HIDE(ID);
// strID and fVal now contain the entered data
}
EVENT(IDShow)
{
ClearLCD();
DisplayText(0, 0, "ID/Value Screen");
return 0;
}
See Also
Note:
See TracWiki
for help on using the wiki.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/cardinal.gif)