root/Main.cpp

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. AppFileName
  2. QuitRequested
  3. MessageReceived
  4. main

   1 //#include "Monitor.h"
   2 #include "Main.h"
   3 #include "BF_Def.h"
   4 #include "BF_GUI_WinMain.h"
   5 #include "BL_Tools.h"
   6 #include <Alert.h>
   7 
   8 #include <string.h>
   9 #include <stdio.h>
  10 
  11 #include "BF_BetaTesting.h"
  12 
  13 BF_App *poApp = NULL;
  14 
  15 BF_App::BF_App(const char* pc_AppFileName) : BApplication(APP_SIGNATURE)
  16 {       
  17         ASSERT(pc_AppFileName); 
  18         
  19         poApp = this;
  20         sAppFileName = pc_AppFileName;
  21         bAskedQuit = false;
  22         //
  23         BF_BetaTesting_InitStatus();  
  24         if(BF_BETATEST_QUIT==iBetaTestingStatus){       
  25                 be_app->PostMessage(B_QUIT_REQUESTED);
  26                 return;
  27         }       
  28         BF_GUI_WinMain *po = new BF_GUI_WinMain();
  29         po->Show();             
  30 }
  31 
  32 const BString   
  33 BF_App::AppFileName()    /* [previous][next][first][last][top][bottom][index][help] */
  34 {
  35         return BString(sAppFileName);
  36 }
  37 
  38 bool BF_App::QuitRequested()    /* [previous][next][first][last][top][bottom][index][help] */
  39 {
  40         /*
  41         if(!bAskedQuit){
  42                 bAskedQuit = true;
  43                 BMessage        oMessage(BF_MSG_MAINVIEW_ASK_QUIT);
  44                 BMessenger      oMessenger(poWinView);
  45                 oMessenger.SendMessage(&oMessage);              
  46                 return false;
  47         }else{
  48                 return true;
  49         }
  50         */
  51         return true;
  52 }
  53 
  54 void
  55 BF_App::MessageReceived(BMessage * message)    /* [previous][next][first][last][top][bottom][index][help] */
  56 {
  57         switch(message->what){
  58         case BF_MSG_MAINVIEW_ANSWER_QUIT:{
  59                 int iQuit = message->FindInt32("bf_iAnswer");
  60                 if(iQuit==0) bAskedQuit = false;
  61                 if(iQuit==1) bAskedQuit = true;
  62                 break;}
  63         default:
  64                 BApplication::MessageReceived(message);
  65         }       
  66 }
  67 
  68 int
  69 main( int argc, char** argv )    /* [previous][next][first][last][top][bottom][index][help] */
  70 {
  71         BF_App app(argv[0]);
  72         app.Run();
  73         return 0;
  74 }

/* [previous][next][first][last][top][bottom][index][help] */