Changes between Version 79 and Version 80 of Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook


Ignore:
Timestamp:
07/09/25 14:50:30 (2 weeks ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook

    v79 v80  
    338338The 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 rectInpBtn rectangle that is used to define where to show the prompts and input fields. The following parameter is a value that is a percentage of the display area to set the width of the input fields.
    339339
     340Another input form style is useful when !EnableFullScreenMode is used and the form has mostly selection items and numeric inputs.
     341
     342{{{#!c++
     343        CFormRect rectInpBtn;
     344        CFormButton btnCancel, btnOk;
     345
     346        FORM_INIT(ScaleInfo, EventConfigScaleInfoShow, NULL, NULL, NULL, nFormFlgShowHelp);
     347
     348        SetupInputFormToUseFontSet(formScaleInfo, rectInpBtn, 0.18);
     349
     350        FORM_ADD_INPUT2(ScaleInfo, Threshold,   rectInpBtn, CFormRect::zero, "On Threshold:", 6, 0, 80000, NULL, &threshold_, FORM_FLOAT, NULL, NULL);
     351        rectInpBtn.AdvanceX(INPUT_BUTTON_X_MARGIN);
     352        FORM_ADD_INPUT2(ScaleInfo, Threshold2,  rectInpBtn, CFormRect::zero, "Off Threshold:", 6, 0, 80000, NULL, &lowThreshold_, FORM_FLOAT, NULL, NULL);
     353
     354        rectInpBtn += buttonAdvanceY;
     355        rectInpBtn.SetLeftAndWidthBasedOnDspArea(formScaleInfo.GetDspArea(), 0.03, 0.32);
     356
     357        FORM_ADD_INPUT2(ScaleInfo, ShowTrfLght, rectInpBtn, CFormRect::zero, "Show Traffic Light Graphic:", 4, 0, SCALEINFO_FLAG_BIT_SHOW_TRAFFIC_LIGHT, NULL, &flags_, FORM_UINT32_YESNO, NULL, NULL);
     358        rectInpBtn.AdvanceX(INPUT_BUTTON_X_MARGIN);
     359
     360        FORM_ADD_INPUT2(ScaleInfo, ManualTrf,   rectInpBtn, CFormRect::zero, "Manual Traffic Release:", 4, 0, SCALEINFO_FLAG_BIT_MANUAL_TRAFFIC_RELEASE, NULL, &flags_, FORM_UINT32_YESNO, NULL, NULL);
     361
     362        AddFormCancelOkButtons(formScaleInfo, btnCancel, btnOk);
     363
     364        formScaleInfo.SetUserData(scaleNum_);
     365
     366        FORM_SHOW(ScaleInfo);
     367        n = FORM_RUN(ScaleInfo);
     368        FORM_HIDE(ScaleInfo);
     369
     370}}}
     371In the above example the input items instead of prompt on the left and input to the right the inputs appear as buttons. The "On Threshold" and "Off Threshold" items will pressed will show the numeric input keypad directly below the selected button. 
    340372
    341373{{{#!c++