Changes between Version 55 and Version 56 of Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook
- Timestamp:
- 04/04/25 12:47:12 (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/825gen2/Dev/UpdatingLegacyAppsToNewLook
v55 v56 56 56 }}} 57 57 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 58 4. Create a source file wght_screen.cpp in the src folder. Copy the following code into this file: 60 59 61 60 {{{#!c++ … … 168 167 5. 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. 169 168 170 For example Show Datetime will be:169 For example ShowGTN cut and pasted from the main cpp and made a member function may look like this: 171 170 {{{ 172 void CWeighingScreen::ShowDateTime(void) 173 { 174 175 } 176 171 void 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 } 177 181 }}} 178 182