Changes between Version 75 and Version 76 of Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook
- Timestamp:
- 07/09/25 13:42:50 (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook
v75 v76 306 306 SetupInputFormToUseFontSet(formSetup, rectInpBtn, 0.45, 1.3); 307 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");308 FORM_ADD_INPUT2(Setup, Thresh, rectInpBtn, rectKeypad, "On Threshold: ", 6, 0, 999999, NULL, &g_setup.onThresh, FORM_FLOAT | FORM_POPUP_LEFT_PROMPT, NULL, "Enter the on threshold"); 309 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");310 FORM_ADD_INPUT2(Setup, ViolTot, rectInpBtn, rectKeypad, "Total Violation: ", 6, 0, 999999, NULL, &g_setup.violWt[0], FORM_FLOAT | FORM_POPUP_LEFT_PROMPT, NULL, "Enter violation weight for total"); 311 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");312 FORM_ADD_INPUT2(Setup, Viol1, rectInpBtn, rectKeypad, "P1 Violation: ", 6, 0, 999999, NULL, &g_setup.violWt[1], FORM_FLOAT | FORM_POPUP_LEFT_PROMPT, NULL, "Violation weight for P1"); 313 313 314 314 formSetup.LeftAlignPromptInputs(inpThres, inpViol1); … … 330 330 }}} 331 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. 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. 333 334 The FORM_ADD_INPUT2 statements have the rectKeypad for the second rectangle parameter. The is defined in apphelpers to specify that the keypad will be near the bottom of the screen. An additional flag //FORM_POPUP_LEFT_PROMPT//. This specifies that the prompt text for the input items will be left of the input fields. 335 336 The // formSetup.LeftAlignPromptInputs(inpThres, inpViol1)// Statement is used to align the input fields. This function scans the input fields from //Thres// through //Viol// and finds the longer prompt text. It then sets all the input field coordinates all of these inputs so that the input prompts are lined up based on the longest prompt. 337 338 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 339 334 340