/* * * Zinzala SDK Introduction (Step 2) * * File : step2.cpp * Purpose : Calorie burner calculator * Author : JLV * Creation : 04/07/03 * Last Update : 08/29/04 * * (C) hexaZen 2003-2004 * * This file is part of an example program for Zinzala. It can be * used, distributed and modified without limitation. * */ #include #include #include #include using namespace zSDK::Cincinella; using namespace zSDK::Farfalla; // Define the Application's window class class cCalcWindow : public cWindow { public: cCalcWindow(); protected: void MessageReceived(cMessage *aMessage); }; /* * Method : cCalcWindow * Purpose : Constructor * Inputs : none * Output : none * Side Effects : none * */ cCalcWindow::cCalcWindow() : cWindow(uRect(250,100),"calc",eWinNormal, 0, kCurrentWorkspace) { // Set some settings of the window SetTitle("Calories-burned Calculator"); MoveTo(10,10); } /* * Method : MessageReceived * Purpose : A message has been received by the Window * Inputs : * * cMessage *aMessage, message received * * Output : none * Side Effects : none * */ void cCalcWindow::MessageReceived(cMessage *aMessage) { switch(message->iWhat) { default: cWindow::MessageReceived(message); } } int main() { // Create the application cApplication lMyApp("hexaZen/phalorieburn",0); if(lMyApp.IsValid()) { // Start the app (and the Photon connection) lMyApp.Run(); // Create window cCalcWindow win; // show the window now win.Show(); // Wait for the end of the app lMyApp.WaitEnd(); } else fprintf(stderr,"Failed the init the application"); }