= Weighing Functions = This is an example of a very simple weight indicator that displays the gross weight and provides a "Zero" and "Quit" button. simple_ind.h {{{ #pragma once EVENT(MainScreenShow); EVENT(MainScreenProcess); EVENT(Zero); EVENT(Quit); }}} simple_ind.cpp {{{ #include "cardinal825.h" #include "simple_ind.h" int main(int ac,char **av) { InitLCD(); ReadTouchCal(); OpenBeeper(); OpenTouch(); MnBdStartup(); FORM_INIT(Main, EventMainScreenShow, EventMainScreenProcess, NULL, NULL, nFormFlgNone); FORM_ADD_BUTTON(Main, Zero, 0, 120, "Zero", 'Z', EventZero, FORM_BUTTON_OUTLINE); FORM_ADD_BUTTON(Main, Quit, 0, 200, "Quit", 'Q', EventQuit, FORM_BUTTON_OUTLINE); FORM_SHOW(Main); FORM_RUN(Main); FORM_HIDE(Main); MnBdShutdown(); return 0; } EVENT(MainScreenShow) { ClearLCD(); DisplayText(0, 0, "Simple Weight Indicator"); return 0; } EVENT(MainScreenProcess) { int n = MnBdProcess(); if(n == mnbdProcWtRcv) { if(IsGrossWtChanged(1)) { DisplayText(0, 40, GetChangedGrossWt(1), 0, BIG_FONT); } } return 0; } EVENT(Zero) { ZeroScale(1); return 0; } EVENT(Quit) { // Return non-zero to exit the form return 1; } }}} [[TOC(inline, depth=1, noheading, Docs/Prog/Manual/ApplicationLibraries/lib825ev/Weight/*)]]