| 295 | Following is an example input form when EnableFullScreenMode is used. |
| 296 | |
| 297 | {{{#!c++ |
| 298 | void PresetScreen(void) |
| 299 | { |
| 300 | #if ARM64 |
| 301 | CFormRect rectInpBtn; |
| 302 | CFormButton btnOk; |
| 303 | |
| 304 | FORM_INIT(Setup, EventPresetScreenShow, NULL, NULL, NULL, nFormFlgShowHelp | nFormFlgAutoPresentPopup | nFormFlgShowPopupTabKeypad); |
| 305 | |
| 306 | SetupInputFormToUseFontSet(formSetup, rectInpBtn, 0.45, 1.3); |
| 307 | |
| 308 | FORM_ADD_INPUT2(Setup, Thresh, rectInpBtn, rectKeypad, "On Threshold: ", 6, 0, 999999, NULL, &g_setup.onThresh, FORM_FLOAT, NULL, "Enter the on threshold"); |
| 309 | rectInpBtn += inputAdvanceY; |
| 310 | FORM_ADD_INPUT2(Setup, ViolTot, rectInpBtn, rectKeypad, "Total Violation: ", 6, 0, 999999, NULL, &g_setup.violWt[0], FORM_FLOAT, NULL, "Enter violation weight for total"); |
| 311 | rectInpBtn += inputAdvanceY; |
| 312 | FORM_ADD_INPUT2(Setup, Viol1, rectInpBtn, rectKeypad, "P1 Violation: ", 6, 0, 999999, NULL, &g_setup.violWt[1], FORM_FLOAT, NULL, "Violation weight for P1"); |
| 313 | |
| 314 | formSetup.LeftAlignPromptInputs(inpThres, inpViol1); |
| 315 | |
| 316 | AddFormOkButton(formSetup, btnOk); |
| 317 | #else |
| 318 | FORM_INIT(Setup, EventPresetScreenShow, NULL, NULL, NULL, nFormFlgShowHelp); |
| 319 | FORM_ADD_INPUT(Setup, Thresh, 0, FONT_HEIGHT * 2, "On Threshold: ", 6, 0, 999999, NULL, &g_setup.onThresh, FORM_FLOAT, NULL, "Enter the on threshold"); |
| 320 | FORM_ADD_INPUT(Setup, ViolTot, 0, FONT_HEIGHT * 4, "Total violation: ", 6, 0, 999999, NULL, &g_setup.violWt[0], FORM_FLOAT, NULL, "Enter violation weight for total"); |
| 321 | FORM_ADD_INPUT(Setup, Viol1, 0, FONT_HEIGHT * 6, "P1 Violation: ", 6, 0, 999999, NULL, &g_setup.violWt[1], FORM_FLOAT, NULL, "Violation weight for P1"); |
| 322 | #endif |
| 323 | FORM_SHOW(Setup); |
| 324 | int n = FORM_RUN(Setup); |
| 325 | if (n != FORM_RESULT_ESC) { |
| 326 | SaveSetup(); |
| 327 | } |
| 328 | FORM_HIDE(Setup); |
| 329 | } |
| 330 | }}} |
| 331 | |
| 332 | In the above example FORM_INIT has additional flags //nFormFlgAutoPresentPopup | nFormFlgShowPopupTabKeypad//. This is to show the popup keypad automatically and include the tab keypad. The function !SetupInputFormToUseFontSet is called. !SetupInputFormToUseFontSet is a helper function defined in apphelpers.cpp. This gives the form a pointer to the fonts that were initialized previously. The function also sets the starting positions of the rect, and rectInp rectangles that are used to define where to show the prompts and input fields. The final parameter is a string used to determine the width of the prompts. This should be the longest prompt text in the form. The !AdvanceInputRects function call is used between FORM_ADD_INPUT2 calls to move the rect and rectInp down an appropriate amount for the next input. |
| 333 | |
| 334 | |