Changes between Version 55 and Version 56 of Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook


Ignore:
Timestamp:
04/04/25 12:47:12 (2 weeks ago)
Author:
Don Wilson
Comment:

--

Legend:

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

    v55 v56  
    5656}}}
    5757
    58 4. Create a source file wght_screen.cpp in the src folder. Do not just copy this entire file from a standard project. Copy the SetupDisplayLocations portion of the file from a standard app.
    59 
     584. Create a source file wght_screen.cpp in the src folder.  Copy the following code into this file:
    6059
    6160{{{#!c++
     
    1681675. Most older app project have almost all of the code in the a single cpp file. Most of the functions for displaying dynamic data on the main screen are named Show//XXXX// such as ShowDateTime, ShowGTN, etc...  Cut the code of these functions from the main source file and paste them into the wght_screen.cpp file. Then update the function names to be class members. It will also be necessary to add the function names to the wght_screen.h or make sure they match names already in wght_screen.h.
    169168
    170 For example ShowDatetime will be:
     169For example ShowGTN cut and pasted from the main cpp and made a member function may look like this:
    171170{{{
    172 void CWeighingScreen::ShowDateTime(void)
    173 {
    174  
    175 }
    176 
     171void CWeighingScreen::ShowGTN(void)
     172{
     173   SetCurColor(nColorGreen);
     174    SetBkColor(nColorBlack);
     175    DisplayText(GROSS_LBL_X, GROSS_LBL_Y, LANG(STR_GROSS_LABEL), 0, BIG_FONT);
     176
     177    if(curScale >= 0 && GetWtMode(curScale) == wtmode_net) {
     178        DisplayText(TARE_LBL_X, TARE_WT_Y, LANG(STR_TARE_LABEL), 0, BIG_FONT);
     179        DisplayText(NET_LBL_X, NET_WT_Y, LANG(STR_NET_LABEL), 0, BIG_FONT);
     180}
    177181}}}
    178182