Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Oathl_if.cpp Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Oathl_if.cpp

Go to the documentation of this file.
00001 //Filename    : OATHL_IF.CPP
00002 //Description : Athletics (Athletics Office) class
00003 // owner                        : Kevin(Ho)
00004 // Notes:       Steps to introduce a new class of user interface
00005 //                              1.      construct the new class
00006 //                              2.      in sys.h, add the new MODE, e.g. MODE_ADMISSIONS_AND_FINANCIAL_OFFICE
00007 //                              3.      include the new header file in cc.cpp, osysdisp.cpp, osysdet.cpp
00008 //                              4.      in cc.cpp, declare a global object of the new class, with the name matching the 'extern' statement in the header file
00009 //                              5.      in osysdisp.cpp, under switch(view_mode), add the redirection to the display function
00010 //                              6.      in osysdet.cpp, under Sys::detect_view, add the redirection to the detect function
00011 //                              7.      in osysdet.cpp, under Sys::process_key, add the new hot key (optional)
00012 //                              8.      in osysdet.cpp, under Sys::detect_button, modify if necessary (see the comments there)
00013 //                              9.      the deinit function (AdmOffice::deinit()) can be called when the view_mode in 'sys' object is switched
00014 //                                      the function frees memory occupied by this object
00015 //                                      the report function would re-allocate memory when it is called (note the report_init_flag)
00016 //                                      notice the beginning section of Sys::disp_frame()
00017 // Kevin 0723
00018 
00019 #include <OSYS.H>
00020 #include <OSTR.H>
00021 #include <OGAMESET.H>
00022 #include <OWORLDMT.H>
00023 #include <OATHLETI.H>
00024 #include <OVGA.H>
00025 #include <OINFO.H>
00026 #include <OENROLL.H>
00027 #include <OIFACE.H>
00028 #include <COLOR.H>
00029 #include <OFONT.H>
00030 #include <OGAMESTR.H>
00031 #include <OMOUSE.H>
00032 #include <OBUTTON.H>
00033 #include <ORADIOV.H>
00034 #include <ORADIO.H>
00035 #include <OFINANCE.H>
00036 #include <OVALSLDR.H>
00037 #include <OSPINNER.H>
00038 #include <OGRPHYR.H>
00039 #include <OGRPAREA.H>
00040 #include <OGRPDYR.H>
00041 #include <OPSCHOOL.H>                             //#### fred 1021
00042 #include <OHELP.H>                                //#### fred 1021
00043 #include <OCHANCE.H>
00044 //------- Define constants -------//
00045 
00046 enum {                                            // the 'sub' view-modes
00047     MODE_ATHLETICS = 0,
00048     MODE_FINANCIAL = 1,
00049 };
00050 
00051 enum {                                            // the bg image id
00052     BG_PIC_ID = 2
00053 };
00054 
00055 enum {                                            // screen coordinates
00056     REPORT_X1 = ZOOM_X1+15,
00057     REPORT_Y1 = ZOOM_Y1+25,
00058     REPORT_X2 = ZOOM_X2-15,
00059     REPORT_Y2 = ZOOM_Y2-55
00060 };
00061 
00062 enum {
00063     BOTTOM_BUTTON_X1 = REPORT_X1+200,
00064     BOTTOM_BUTTON_Y1 = REPORT_Y2+15,
00065     BOTTOM_BUTTON_X2 = REPORT_X2-80,
00066     BOTTOM_BUTTON_Y2 = REPORT_Y2+40
00067 };
00068 
00069 enum {
00070     BOTTOM_BUTTON_WIDTH = 125,
00071     BOTTOM_BUTTON_HEIGHT = 25,
00072     BOTTOM_BUTTON_DISTANCE
00073     = (BOTTOM_BUTTON_X2-BOTTOM_BUTTON_X1-BOTTOM_BUTTON_WIDTH*2)/3
00074 };
00075 
00076 // begin kevin 0723
00077 enum {
00078     MODE_ATHLETICS_BOX1_HEIGHT = 120,
00079     MODE_ATHLETICS_BOX2_HEIGHT = 215,
00080     MODE_ATHLETICS_BOX_WIDTH = 650,
00081     MODE_ATHLETICS_TAB0 = 15,
00082     MODE_ATHLETICS_TAB1 = 100,
00083     MODE_ATHLETICS_TAB2 = 455,
00084 };
00085 
00086 enum {
00087     MODE_ATHLETICS_GRAPH_WIDTH = 370,
00088     MODE_ATHLETICS_GRAPH_HEIGHT = 160,
00089     MODE_ATHLETICS_LEGEND_HEIGHT = 26,
00090     MODE_ATHLETICS_LEGEND_WIDTH = 370,
00091 };
00092 
00093 // end kevin 0723
00094 
00095 enum {
00096     MODE_FINANCIAL_BOX1_HEIGHT = 125,
00097     MODE_FINANCIAL_BOX2_HEIGHT = 210,
00098     MODE_FINANCIAL_GRAPH_WIDTH = 400,
00099     MODE_FINANCIAL_GRAPH_HEIGHT = 160,
00100     MODE_FINANCIAL_LEGEND_HEIGHT = 26,
00101     MODE_FINANCIAL_LEGEND_WIDTH = 400,
00102 
00103     MODE_FINANCIAL_TAB1 = 15,
00104     MODE_FINANCIAL_TAB2 = 280,
00105     MODE_FINANCIAL_TAB3 = 360,
00106     MODE_FINANCIAL_TAB4 = 440,
00107     MODE_FINANCIAL_TAB5 = 520,
00108     MODE_FINANCIAL_TAB6 = 600,
00109 };
00110 
00111 enum {
00112     FINANCIAL_BUTTON_X1 = REPORT_X1+MODE_FINANCIAL_TAB4+30,
00113     FINANCIAL_BUTTON_Y1 = REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT+120,
00114     FINANCIAL_BUTTON_X2 = REPORT_X2,
00115     FINANCIAL_BUTTON_Y2 = REPORT_Y2
00116 };
00117 
00118 enum {
00119     FINANCIAL_BUTTON_WIDTH = 200,
00120     FINANCIAL_BUTTON_HEIGHT = 25,
00121     FINANCIAL_BUTTON_DISTANCE
00122     = (FINANCIAL_BUTTON_Y2-FINANCIAL_BUTTON_Y1-FINANCIAL_BUTTON_HEIGHT*3)/4
00123 };
00124 
00125 enum {                                            // the 'sub' view-modes
00126     MODE_FINANCIAL_IMPLEMENT = 2,
00127     MODE_FINANCIAL_ANNOUNCE = 1,
00128     MODE_FINANCIAL_CONSIDER = 0,
00129 };
00130 
00131 //-------- define static vars -----------//
00132 
00133 static char report_init_flag = 0;
00134 static char mode_init_flag = -1;                  // -1: non of the mode was init'ed
00135 
00136 static ButtonGroup bottom_button_group(2);
00137 static short *bottom_button_up_bitmap[2];
00138 static short *bottom_button_down_bitmap[2];
00139 static char *bottom_button_label[] = {
00140     "Overview", "Finance"
00141 };
00142 
00143 // Notes:       the strings could be moved to Ogamestr.cpp
00144 // Begin Athletics Mode Setting
00145 static GraphDoubleBarYear mode_athletics_graphdbar_winloss;
00146 static char *mode_athletics_graph_title="Win/loss records";
00147 static char *mode_athletics_legend_label[] = {
00148     "Wins","Losses",
00149 };
00150 static RadioButtonVert mode_athletics_radio_button_football;
00151 static RadioButton mode_athletics_radio_button_participation;
00152 static RadioButton mode_athletics_radio_button_adm_treatment;
00153 static RadioButton mode_athletics_radio_button_fin_treatment;
00154 static char *mode_athletics_str1[] = {
00155     "Division III", "Division II", "Division I"
00156 };
00157 static char *mode_athletics_str2[] = {
00158     "Low", "Medium", "High"
00159 };
00160 static char *mode_athletics_str3[] = {
00161     "Men's football team record (Fall semester)",
00162     "Women's basketball team record \r\n(Spring semester)"
00163 };
00164 
00165 static char *mode_athletics_str4[] = {
00166     "Number of top athletes currently enrolled",
00167     "Current intercollegiate level of competition",
00168     "Special admission treatment for top athletes",
00169     "Special financial aid treatment for top athletes",
00170 };
00171 
00172 static short *mode_athletics_no_top_athletes_bitmap;
00173 
00174 // End Athletics Mode Setting
00175 
00176 // Begin Financial Mode Setting
00177 static char *mode_financial_str[] = {
00178     "Intercollegiate athletic revenue",
00179     "Athletic expenditure",
00180     "Balance",
00181     "",
00182     "Change",
00183     "Change in athletic expenditure budget"
00184 };
00185 
00186 static short *mode_financial_stats_bitmap;
00187 static Spinner financial_spinner_budget;
00188 static ValueSlider mode_financial_slider_budget;
00189 static ButtonGroup financial_button_group(3);
00190 static short *financial_button_up_bitmap[3];
00191 static short *financial_button_down_bitmap[3];
00192 static char *financial_button_label[] = {
00193     "Consider for next year", "Promise for next year", "Implement now"
00194 };
00195 static char financial_current_mode = MODE_FINANCIAL_CONSIDER;
00196 
00197 static GraphArea mode_financial_graph_profitloss;
00198 static char *mode_financial_graph_title="";
00199 static char *mode_financial_legend_label[] = {
00200     "Revenue","Expenditure",
00201     "Profit","Loss",
00202 };
00203 
00204 // End Financial Mode Setting
00205 
00206 //-------- define static functions ------//
00207 
00208 // Notes:       the deinit_x functions should deallocate memory used by the
00209 //                              GraphDoubleBar, ValueSlider, RadioButton, etc. objects
00210 //                              the functions are called when a mode-switching is triggered
00211 //      Norris 0716
00212 
00213 static void report_athletics(int);
00214 static void report_financial(int);
00215 static int detect_athletics();
00216 static int detect_financial();
00217 static void deinit_athletics();
00218 static void deinit_financial();
00219 
00220 typedef void (*ReportFP)(int refreshFlag);
00221 typedef int (*DetectFP)();
00222 typedef void (*DeinitFP)();
00223 
00224 static ReportFP report_func_ptr[] = {
00225     &report_athletics,
00226     &report_financial
00227 };
00228 
00229 static DetectFP detect_func_ptr[] = {
00230     &detect_athletics,
00231     &detect_financial
00232 };
00233 
00234 static DeinitFP deinit_func_ptr[] = {
00235     &deinit_athletics,
00236     &deinit_financial,
00237 };
00238 
00239 //------- Begin of function Athletics::Athletics -----------//
00241 Athletics::Athletics() {
00242     init();
00243 }
00244 
00245 //--------- End of function Athletics::Athletics -----------//
00246 
00247 //------- Begin of function Athletics::~Athletics -----------//
00249 Athletics::~Athletics() {
00250     deinit();
00251 }
00252 
00253 //--------- End of function Athletics::~Athletics -----------//
00254 
00255 //------- Begin of function Athletics::deinit ---------------//
00257 void Athletics::deinit() {
00258     //--------- deallocate memory -------------//
00259     // ##### begin Gilbert 28/4/2001 ######//
00260     bottom_button_group.deinit_buttons();
00261     // ##### end Gilbert 28/4/2001 ######//
00262     if (*bottom_button_up_bitmap) {
00263         for (int i = 0; i < 2; i++) {
00264             mem_del(bottom_button_up_bitmap[i]);
00265             mem_del(bottom_button_down_bitmap[i]);
00266             bottom_button_up_bitmap[i] = NULL;
00267             bottom_button_down_bitmap[i] = NULL;
00268         }
00269     }
00270 
00271     (*deinit_func_ptr[current_mode])();
00272 
00273     report_init_flag = 0;
00274 }
00275 
00276 //--------- End of function Athletics::deinit ---------------//
00277 
00278 //------- Begin of function Athletics::init -----------------//
00280 void Athletics::init() {
00281 
00282     memset(this, 0, sizeof(Athletics));
00283 
00284     for (int i = 0; i < 2; i++) {
00285         bottom_button_up_bitmap[i] = NULL;
00286         bottom_button_down_bitmap[i] = NULL;
00287     }
00288 
00289     current_mode = MODE_ATHLETICS;
00290 }
00291 
00292 //--------- End of function Athletics::init -----------------//
00293 
00294 //------- Begin of function Athletics::report ---------------//
00296 void Athletics::report(int refreshFlag) {
00297     vga.use_back();
00298 
00299 #if(GAME_VERSION>=200)
00300     // fix in version 2
00301     sys.is_institution_report = 1;
00302 #endif
00303 
00304     if (refreshFlag == INFO_REPAINT) {
00305         if( report_init_flag )                        // deinit it first if it has already been initialized
00306             deinit();
00307 
00308         //------------- paint the background ----------------//
00309         user_interface.bg_img(BG_PIC_ID, &vga_back);
00310 
00311         //----- initialize the bottom sub-menus buttons -----//
00312         if (!report_init_flag) {
00313             short x = BOTTOM_BUTTON_X1;
00314             for (int i = 0; i < 2; i++, x+=BOTTOM_BUTTON_WIDTH+BOTTOM_BUTTON_DISTANCE) {
00315                 user_interface.create_button_bitmap(x, BOTTOM_BUTTON_Y1,
00316                                                     x+BOTTOM_BUTTON_WIDTH, BOTTOM_BUTTON_Y1+BOTTOM_BUTTON_HEIGHT,
00317                                                     bottom_button_label[i], &bottom_button_up_bitmap[i],
00318                                                     &bottom_button_down_bitmap[i], &vga_back);
00319 
00320                 bottom_button_group[i].create_bitmapW(x, BOTTOM_BUTTON_Y1,
00321                                                       x+BOTTOM_BUTTON_WIDTH, BOTTOM_BUTTON_Y1+BOTTOM_BUTTON_HEIGHT,
00322                                                       ((i == current_mode) ? bottom_button_down_bitmap[i] : bottom_button_up_bitmap[i])+4);
00323             }
00324             report_init_flag = 1;
00325         }
00326 
00327         //----------- paint the bottom button group ---------//
00328         bottom_button_group.paint(current_mode);
00329     }
00330 
00331     //---- repaint/refresh the display of the current mode ----//
00332     (*report_func_ptr[current_mode])(refreshFlag);
00333 
00334     // Comments:        blt buffer only if repaint, because the
00335     //                                  report_x functions would handle blt_buf
00336     //                                  when refresh
00337     //                                  equivalently, in the report_x functions,
00338     //                                  only blt buffer when refresh
00339 
00340     if (refreshFlag == INFO_REPAINT) {
00341         //------- blt the back buffer to front buffer -------//
00342         vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2);
00343     }
00344 
00345     //##trevor 2807
00346     vga.use_front();
00347     //##trevor 2807
00348 }
00349 
00350 //---------- End of function Athletics::report ------------//
00351 
00352 //-------- Begin of function Athletics::detect ------------//
00356 int Athletics::detect() {
00357     vga.use_back();
00358 
00359     int rc = detect2();
00360 
00361     vga.use_front();
00362 
00363     return rc;
00364 }
00365 
00366 //---------- End of function Athletics::detect ------------//
00367 
00368 //-------- Begin of function Athletics::detect2 ------------//
00372 int Athletics::detect2() {
00373     if (!report_init_flag)
00374         return 0;
00375 
00376     int bottomButtonGroupDetect;
00377     if ((bottomButtonGroupDetect = bottom_button_group.detect()) >= 0) {
00378         //---- deinit the modes to free memory ----//
00379         (*deinit_func_ptr[current_mode])();
00380 
00381         //-------- change display mode ------------//
00382         bottom_button_group[current_mode].body_ptr = (void *) (bottom_button_up_bitmap[current_mode] + 4);
00383         current_mode = bottomButtonGroupDetect;
00384         bottom_button_group[current_mode].body_ptr = (void *) (bottom_button_down_bitmap[current_mode] + 4);
00385 
00386         //-------- post display redraw flag -------//
00387         sys.redraw_all_flag = 1;
00388 
00389         return 1;
00390     }
00391 
00392     if ((*detect_func_ptr[current_mode])())
00393         return 1;
00394 
00395     return 0;
00396 }
00397 
00398 //---------- End of function AdmOffice::detect ------------//
00399 
00400 //-------- Begin of function report_athletics -------------//
00402 static void report_athletics(int refreshFlag) {
00403     // begin Kevin 0723
00404 
00405     //*** temporary ***//
00406     static int radioVar1 = 1, radioVar2 = 1, radioVar3 = 1, radioVar4 = 0;
00407     static int top_athletes = 99;
00408     static int numSeriesData = 8;                   //*** temporary ***//
00409     static int *dataArray;
00410 
00411     //  Communicate with Sim Engine's Output
00412 
00413     // ##### Begin MArco #### //
00414 #if(GAME_VERSION>=200)
00415     static int initial_top_athletes = 99;
00416     // marco
00417     initial_top_athletes=enroll_res.initial_matrics_top_athletes;
00418 #endif
00419     // ##### End Marco ##### //
00420 
00421     top_athletes=enroll_res.matrics_top_athletes;
00422     radioVar1 = athletics_office.ncaa_level_input;  //### fred 1021
00423     radioVar2 = enroll_res.athlete_offers_special;
00424     radioVar3 = enroll_res.athlete_aid_special;
00425 
00426     if(radioVar4==0) {
00427         dataArray = (int*)(athletics_office.football_graph);
00428         mode_athletics_graphdbar_winloss.data_array=dataArray;
00429     }
00430     else {
00431         dataArray = (int*)(athletics_office.basketball_graph);
00432         mode_athletics_graphdbar_winloss.data_array=dataArray;
00433     }
00434 
00435     //
00436 
00437     if (refreshFlag == INFO_REPAINT) {
00438         //              //--------- draw the brightened boxes ------------//
00439         user_interface.brighten(REPORT_X1, REPORT_Y1, REPORT_X2,REPORT_Y2);
00440         user_interface.rect(REPORT_X1, REPORT_Y1, REPORT_X2,
00441                             REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+3);
00442         user_interface.rect(REPORT_X1, REPORT_Y2-MODE_ATHLETICS_BOX2_HEIGHT-2,
00443                             REPORT_X2,REPORT_Y2);
00444 
00445         // top title
00446         user_interface.brighten(REPORT_X1+150,REPORT_Y1-23,REPORT_X1+575,REPORT_Y1-3);
00447         user_interface.rect(REPORT_X1+150,REPORT_Y1-23,REPORT_X1+575,REPORT_Y1-3,1);
00448         font_charts.put(REPORT_X1+290,REPORT_Y1-18,"Athletics Program");
00449 
00450         if (mode_init_flag != MODE_ATHLETICS) {
00451             //---------  initialization  -----------//
00452             mode_init_flag= MODE_ATHLETICS;
00453             mode_athletics_no_top_athletes_bitmap=NULL;
00454 
00455             image_mascot.put_back(
00456                 REPORT_X1+20,REPORT_Y1+30,player_school.mascot);
00457 
00458             mode_athletics_no_top_athletes_bitmap=
00459                 vga_back.save_area(
00460                     MODE_ATHLETICS_TAB1+320,
00461                     REPORT_Y1+15,
00462                     MODE_ATHLETICS_TAB1+320+3*font_chartsm.max_font_width,
00463                     REPORT_Y1+15+font_chartsm.max_font_height,
00464                     mode_athletics_no_top_athletes_bitmap);
00465 
00466             mode_athletics_radio_button_participation.init(
00467                 MODE_ATHLETICS_TAB2-10,
00468                 REPORT_Y1+40,
00469                 REPORT_X2,
00470                 REPORT_Y1+40+font_chartsm.max_font_height,
00471                 3, &radioVar1, mode_athletics_str1);
00472 
00473             mode_athletics_radio_button_adm_treatment.init(
00474                 MODE_ATHLETICS_TAB2-10,
00475                 REPORT_Y1+65,
00476                 REPORT_X2,
00477                 REPORT_Y1+65+font_chartsm.max_font_height,
00478                 3, &radioVar2, mode_athletics_str2);
00479 
00480             mode_athletics_radio_button_fin_treatment.init(
00481                 MODE_ATHLETICS_TAB2-10,
00482                 REPORT_Y1+90,
00483                 REPORT_X2,
00484                 REPORT_Y1+90+font_chartsm.max_font_height,
00485                 3, &radioVar3, mode_athletics_str2);
00486 
00487             mode_athletics_radio_button_football.init(
00488                 MODE_ATHLETICS_TAB2,
00489                 REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+MODE_ATHLETICS_BOX1_HEIGHT/2,
00490                 REPORT_X2,
00491                 REPORT_Y2,
00492                 2, &radioVar4, mode_athletics_str3);
00493 
00494             //-------- graph title --------------//
00495             mode_athletics_graphdbar_winloss.init(
00496                 REPORT_X1+MODE_ATHLETICS_TAB0,
00497                 REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+30,
00498                 REPORT_X1+MODE_ATHLETICS_TAB0+MODE_ATHLETICS_GRAPH_WIDTH,
00499                 REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+30+MODE_ATHLETICS_GRAPH_HEIGHT,
00500 #if(GAME_VERSION>=200)
00501                 2, &numSeriesData, dataArray, 1,          // 1 - show this indicator
00502 #else
00503                 2, &numSeriesData, dataArray, 0,          // 0 - don't show this indicator
00504 #endif
00505                 NULL, NULL, NULL, 1, 1, 0, 4);
00506             mode_athletics_graphdbar_winloss.paint();
00507         }
00508         else {
00509             //-------- repaint -----------//
00510             mode_athletics_radio_button_participation.paint();
00511             mode_athletics_radio_button_adm_treatment.paint();
00512             mode_athletics_radio_button_fin_treatment.paint();
00513             mode_athletics_radio_button_football.paint();
00514             mode_athletics_graphdbar_winloss.paint();
00515         }
00516 
00517         //-------- graph title --------------//
00518         font_chartsm.center_put(
00519             REPORT_X1+MODE_ATHLETICS_TAB0,
00520             REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+10,
00521             REPORT_X1+MODE_ATHLETICS_TAB0+MODE_ATHLETICS_GRAPH_WIDTH,
00522             REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+30,
00523             mode_athletics_graph_title);
00524 
00525         //-------- graph text --------------//
00526         font_chartsm.put(REPORT_X1+MODE_ATHLETICS_TAB1,
00527                          REPORT_Y1+15, mode_athletics_str4[0]);
00528         font_chartsm.put(REPORT_X1+MODE_ATHLETICS_TAB1,
00529                          REPORT_Y1+40, mode_athletics_str4[1]);
00530         font_chartsm.put(REPORT_X1+MODE_ATHLETICS_TAB1,
00531                          REPORT_Y1+65, mode_athletics_str4[2]);
00532         font_chartsm.put(REPORT_X1+MODE_ATHLETICS_TAB1,
00533                          REPORT_Y1+90, mode_athletics_str4[3]);
00534 
00535         //-------- draw the legend --------------//
00536         font_chartsm.put(
00537             REPORT_X1+MODE_ATHLETICS_LEGEND_WIDTH/3+25,
00538             (REPORT_Y2*2-MODE_ATHLETICS_LEGEND_HEIGHT-font_chartsm.max_font_height)/2+4,
00539             mode_athletics_legend_label[0]);
00540         font_chartsm.put(
00541             REPORT_X1+2*MODE_ATHLETICS_LEGEND_WIDTH/3+25,
00542             (REPORT_Y2*2-MODE_ATHLETICS_LEGEND_HEIGHT-font_chartsm.max_font_height)/2+4,
00543             mode_athletics_legend_label[1]);
00544         user_interface.bar(
00545             REPORT_X1+MODE_ATHLETICS_LEGEND_WIDTH/3+4,
00546             (REPORT_Y2*2-MODE_ATHLETICS_LEGEND_HEIGHT)/2-6,
00547             REPORT_X1+MODE_ATHLETICS_LEGEND_WIDTH/3+16,
00548             (REPORT_Y2*2-MODE_ATHLETICS_LEGEND_HEIGHT)/2+6,
00549             (mode_athletics_graphdbar_winloss.series_color)[0]);
00550         user_interface.bar(
00551             REPORT_X1+2*MODE_ATHLETICS_LEGEND_WIDTH/3+4,
00552             (REPORT_Y2*2-MODE_ATHLETICS_LEGEND_HEIGHT)/2-6,
00553             REPORT_X1+2*MODE_ATHLETICS_LEGEND_WIDTH/3+16,
00554             (REPORT_Y2*2-MODE_ATHLETICS_LEGEND_HEIGHT)/2+6,
00555             (mode_athletics_graphdbar_winloss.series_color)[1]);
00556     }
00557     else {                                          // refreshFlag == INFO_REFRESH
00558         // -------- refresh the stats ----------- //
00559 
00560         mode_athletics_radio_button_football.refresh();
00561         mode_athletics_radio_button_participation.refresh();
00562         mode_athletics_graphdbar_winloss.refresh();
00563 
00564         vga.blt_buf(
00565             REPORT_X1+MODE_ATHLETICS_TAB0,
00566             REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+30,
00567             REPORT_X1+MODE_ATHLETICS_TAB0+MODE_ATHLETICS_GRAPH_WIDTH,
00568             REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+30+MODE_ATHLETICS_GRAPH_HEIGHT);
00569 
00570         mode_athletics_radio_button_adm_treatment.refresh();
00571         mode_athletics_radio_button_fin_treatment.refresh();
00572 
00573     }
00574     // end Kevin 0723
00575     vga_back.rest_area(mode_athletics_no_top_athletes_bitmap,0,0);
00576     font_chartsm.center_put( MODE_ATHLETICS_TAB1+320,
00577                              REPORT_Y1+15,
00578                              MODE_ATHLETICS_TAB1+320+3*font_chartsm.max_font_width,
00579                              REPORT_Y1+15+font_chartsm.max_font_height,
00580                              m.format(top_athletes, 4));
00581 
00582     // ##### Begin Marco ##### //
00583 #if(GAME_VERSION>=200)
00584     font_chart_purple_sm.put(
00585         MODE_ATHLETICS_TAB1+380,
00586         REPORT_Y1+15,
00587         m.format(initial_top_athletes, 13));
00588 #endif
00589     // ##### End Marco ##### //
00590 
00591     vga.blt_buf(MODE_ATHLETICS_TAB1+320,
00592                 REPORT_Y1+15,
00593                 MODE_ATHLETICS_TAB1+320+3*font_chartsm.max_font_width,
00594                 REPORT_Y1+15+font_chartsm.max_font_height);
00595 }
00596 
00597 //-------- Begin of function report_FINANCIAL ---------//
00599 static void report_financial(int refreshFlag) {
00600     // Notes:   temporary variables for debugging
00601     //                          to be interfaced with game engine
00602 
00603     static int v11=1000,v12=1999,v13=8888;
00604     static double v21=663.23,v22=123.23,v23=17.23,v24=723.23,v25=13.23;
00605     static double v31=813.83,v32=888.23,v33=13.83,v34=188.23,v35=183.23;
00606     static double v41=88.28,v42=777.23,v43=166.27,v44=777.23,v45=173.23;
00607     static int sliderVar1=0;
00608     //  static float spinnerVar1=0.0;
00609     static int numSeriesData = 8;                   //*** temporary ***//
00610     static float *dataArray;                        //*** temporary ***//
00611     static int xStart = 1991, xEnd = 1998;          //*** temporary ***//
00612 
00613     // ##### Begin MArco #### //
00614 #if(GAME_VERSION>=200)
00615     static double initialv21=663.23;
00616     static double initialv31=813.83;
00617 #endif
00618     // ##### End MArco #### //
00619 
00620   //    Communicate with Sim Engine's Output
00621     dataArray = (float*)(athletics_office.history_value);
00622     xStart = (int)(info.game_year+(info.game_month-9.0)/12+2-info.graph_year);
00623     xEnd = xStart+numSeriesData-1;
00624 
00625     v12=info.financial_year();
00626     v11=v12-1;
00627     v13=v12+1;
00628     const char ix=AC_INTERCOLLEGIATE_ATHLETICS;
00629     v21=finance.revenue_array[ix].total;
00630     v22=finance.projected_revenue_array[ix].change_last_year.total;
00631     v23=finance.projected_revenue_array[ix].this_year.total;
00632     v24=finance.projected_revenue_array[ix].change_next_year.total;
00633     v25=finance.projected_revenue_array[ix].next_year.total;
00634     const char iy=AC_ATHLETICS;
00635     v31=finance.expense_array[iy].total;
00636     v32=finance.projected_expense_array[iy].change_last_year.total;
00637     v33=finance.projected_expense_array[iy].this_year.total;
00638     v34=finance.projected_expense_array[iy].change_next_year.total;
00639     v35=finance.projected_expense_array[iy].next_year.total;
00641 
00642     // ##### Begin MArco #### //
00643 #if(GAME_VERSION>=200)
00644     initialv21=finance.initial_revenue_array[AC_INTERCOLLEGIATE_ATHLETICS].total;
00645     initialv31=finance.initial_expense_array[AC_ATHLETICS].total;
00646 #endif
00647     // ##### End MArco #### //
00648 
00649     int field_space=5*font_chartsm.max_font_width;
00650 
00651     if (refreshFlag == INFO_REPAINT) {
00652         user_interface.brighten(REPORT_X1+150,REPORT_Y1-23,REPORT_X1+575,REPORT_Y1-3);
00653         user_interface.rect(REPORT_X1+150,REPORT_Y1-23,REPORT_X1+575,REPORT_Y1-3,1);
00654         font_charts.put(REPORT_X1+240,REPORT_Y1-18,"Athletics Revenue and Expenditure");
00655 
00656         if (mode_init_flag != MODE_FINANCIAL) {
00657             mode_init_flag = MODE_FINANCIAL;
00658             //                  spinnerVar1=(float)finance.get_policy_var(false, AC_ATHLETICS)->target_value;
00659             //                  spinnerVar1=0.0;
00660             for (int i = 0; i < 3; i++) {
00661                 financial_button_up_bitmap[i] = NULL;
00662                 financial_button_down_bitmap[i] = NULL;
00663             }
00664 
00665             //--------- draw the brightened boxes ------------//
00666             user_interface.brighten(REPORT_X1, REPORT_Y1, REPORT_X2, REPORT_Y2);
00667             user_interface.rect(REPORT_X1, REPORT_Y1, REPORT_X2, REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT+3);
00668             user_interface.rect(REPORT_X1, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT-3, REPORT_X1+MODE_FINANCIAL_TAB4, REPORT_Y2);
00669             user_interface.rect(REPORT_X1+MODE_FINANCIAL_TAB4-2, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT-3, REPORT_X2, REPORT_Y2);
00670 
00671             short y = FINANCIAL_BUTTON_Y1;
00672             for (i = 0; i < 3; i++, y+=FINANCIAL_BUTTON_HEIGHT+FINANCIAL_BUTTON_DISTANCE) {
00673 
00674                 user_interface.create_button_bitmap(FINANCIAL_BUTTON_X1,y,
00675                                                     FINANCIAL_BUTTON_X1+FINANCIAL_BUTTON_WIDTH,y+FINANCIAL_BUTTON_HEIGHT,
00676                                                     financial_button_label[i], &financial_button_up_bitmap[i],
00677                                                     &financial_button_down_bitmap[i], &vga_back);
00678 
00679                 financial_button_group[i].create_bitmapW(FINANCIAL_BUTTON_X1,y,
00680                                                          FINANCIAL_BUTTON_X1+FINANCIAL_BUTTON_WIDTH,y+FINANCIAL_BUTTON_HEIGHT,
00681                                                          (financial_button_up_bitmap[i])+4,0);
00682             }
00683 
00684             financial_spinner_budget.init(
00685                 REPORT_X1+MODE_FINANCIAL_TAB5-10,
00686                 REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT+70,
00687                 REPORT_X1+MODE_FINANCIAL_TAB5+110,
00688                 REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT+100,
00689                 //### begin zhoubin 02/25/99
00690                 &athletics_office.spinner_var1,
00691                 //### end zhoubin 02/25/99
00692                 //                              -100.0f,100.0f,0.1f,0,NULL,23);  //## chea 200899 the min & max val should between -5% to 5% format should in %
00693                 -5.0f,5.0f,0.1f,0,NULL,25);
00694             //-------- graph title --------------//
00695             mode_financial_graph_profitloss.init(
00696                 REPORT_X1, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT-3, REPORT_X1+MODE_FINANCIAL_TAB4, REPORT_Y2,
00697                 2, &numSeriesData, dataArray, 1,
00698                 NULL, NULL, mode_financial_legend_label, 1, 1, 1, 2);
00699             financial_spinner_budget.paint();
00700         }
00701         else {
00702             //--------- draw the brightened boxes ------------//
00703             user_interface.brighten(REPORT_X1, REPORT_Y1, REPORT_X2, REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT);
00704             user_interface.brighten(REPORT_X1, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT, REPORT_X1+MODE_FINANCIAL_TAB4-2, REPORT_Y2);
00705             user_interface.brighten(REPORT_X1+MODE_FINANCIAL_TAB4, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT, REPORT_X2, REPORT_Y2);
00706             user_interface.rect(REPORT_X1, REPORT_Y1, REPORT_X2, REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT);
00707             user_interface.rect(REPORT_X1, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT, REPORT_X1+MODE_FINANCIAL_TAB4-2, REPORT_Y2);
00708             user_interface.rect(REPORT_X1+MODE_FINANCIAL_TAB4, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT, REPORT_X2, REPORT_Y2);
00709 
00710             //-------- paint the buttons -----------//
00711             //                  mode_financial_slider_budget.paint();
00712             financial_spinner_budget.paint();
00713             mode_financial_graph_profitloss.paint();
00714         }
00715 
00716         //-------- display static strings -----------//
00717         font_chartsm.put(REPORT_X1+MODE_FINANCIAL_TAB1, REPORT_Y1+40, mode_financial_str[0]);
00718         font_chartsm.put(REPORT_X1+MODE_FINANCIAL_TAB1, REPORT_Y1+60, mode_financial_str[1]);
00719         user_interface.bar(REPORT_X1+10, REPORT_Y1+82, REPORT_X2-10, REPORT_Y1+84, V_BROWN);
00720         font_chartsm.put(REPORT_X1+MODE_FINANCIAL_TAB1, REPORT_Y1+95, mode_financial_str[2]);
00721         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00722                                 REPORT_Y1+15,
00723                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00724                                 //                                      REPORT_Y1+15+font_chartsm.max_font_height,
00725                                 mode_financial_str[4]);
00726         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00727                                 REPORT_Y1+15,
00728                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00729                                 //                                      REPORT_Y1+15+font_chartsm.max_font_height,
00730                                 mode_financial_str[4]);
00731         font_chartsm.put_paragraph(
00732             REPORT_X1+MODE_FINANCIAL_TAB4+30,
00733             REPORT_Y1+30+MODE_FINANCIAL_BOX1_HEIGHT,
00734             REPORT_X2,
00735             REPORT_Y1+60+MODE_FINANCIAL_BOX1_HEIGHT,
00736             mode_financial_str[5]);
00737         mode_financial_stats_bitmap=NULL;
00738         mode_financial_stats_bitmap=vga_back.save_area(
00739             REPORT_X1+MODE_FINANCIAL_TAB2, REPORT_Y1,
00740             REPORT_X2, REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT,
00741             mode_financial_stats_bitmap);
00742 
00743         mode_financial_graph_profitloss.paint();
00744     }
00745     else {                                          // refreshFlag == INFO_REFRESH
00746         //-------- refresh dynamic data --------------//
00747         // refresh() == 1. rest()
00748         //                                              2. draw()
00749         //                                              3. blit buffer()
00750         mode_financial_graph_profitloss.refresh();
00751 
00752         vga.blt_buf(
00753             REPORT_X1, REPORT_Y2-MODE_FINANCIAL_BOX2_HEIGHT,
00754             REPORT_X1+MODE_FINANCIAL_TAB4-2, REPORT_Y2
00755             );
00756 
00757     }
00758 
00759     financial_spinner_budget.refresh();
00760     // show buttons
00761     int pressed=finance.get_policy_var(false, AC_ATHLETICS)->applied_flag;
00762     if(pressed==P_NONE)
00763         for(int i=0;i<3;i++)
00764             financial_button_group[i].paint();
00765     else
00766         financial_button_group.paint(pressed-1);
00767     short y = FINANCIAL_BUTTON_Y1;
00768     for (int i = 0; i < 3; i++, y+=FINANCIAL_BUTTON_HEIGHT+FINANCIAL_BUTTON_DISTANCE) {
00769         vga.blt_buf(FINANCIAL_BUTTON_X1,y,
00770                     FINANCIAL_BUTTON_X1+FINANCIAL_BUTTON_WIDTH,y+FINANCIAL_BUTTON_HEIGHT
00771             );
00772     }
00773 
00774     vga_back.rest_area(mode_financial_stats_bitmap,0,0);
00775     String *s1,*s2;
00776 
00777     //show years
00778     s1=new String(m.format(v11,16));
00779     s2=new String(m.format(v11+1,16));
00780     //          (*s1)+="-";                             //## chea 061199 2.5.1
00781     //          (*s1)+=(*s2);                           //## chea 061199 2.5.1
00782 
00783     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00784                             REPORT_Y1+15,
00785                             //                                  REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00786                             //                                  REPORT_Y1+15+font_chartsm.max_font_height,
00787                             s1->str_buf);
00788 
00789     (*s1)=m.format(v12,16);
00790     (*s2)=m.format(v12+1,16);
00791     //          (*s1)+="-";                     //## chea 061199 2.5.1
00792     //          (*s1)+=(*s2);           //## chea 061199 2.5.1
00793 
00794     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00795                             REPORT_Y1+15,
00796                             //                                  REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00797                             //                                  REPORT_Y1+15+font_chartsm.max_font_height,
00798                             s1->str_buf);
00799 
00800     (*s1)=m.format(v13,16);
00801     (*s2)=m.format(v13+1,16);
00802     //          (*s1)+="-";                     //## chea 061199 2.5.1
00803     //          (*s1)+=(*s2);           //## chea 061199 2.5.1
00804     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00805                             REPORT_Y1+15,
00806                             //                                  REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00807                             //                                  REPORT_Y1+15+font_chartsm.max_font_height,
00808                             s1->str_buf);
00809     delete s1,s2;
00810 
00811   // ##### Begin Marco ##### //
00812 #if(GAME_VERSION>=200)
00813     if (info.financial_year() > 1 ) {
00814         font_chart_purple_sm.right_put( REPORT_X1+200+field_space,
00815                                         REPORT_Y1+15,
00816                                         "Yr. 0 (Initial)");
00817         font_chart_purple_sm.right_put( REPORT_X1+200+field_space,
00818                                         REPORT_Y1+40,
00819                                         m.format(initialv21, 2));
00820         font_chart_purple_sm.right_put( REPORT_X1+200+field_space,
00821                                         REPORT_Y1+60,
00822                                         m.format(initialv31, 2));
00823         font_chart_purple_sm.right_put( REPORT_X1+200+field_space,
00824                                         REPORT_Y1+95,
00825                                         m.format(initialv21-initialv31, 2));
00826     }
00827 #endif
00828     // ##### End Marco ##### //
00829 
00830     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00831                             REPORT_Y1+40,
00832                             //                                  REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00833                             //                                  REPORT_Y1+40+font_chartsm.max_font_height,
00834                             m.format(v21, 2));
00835     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00836                             REPORT_Y1+60,
00837                             //                                  REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00838                             //                                  REPORT_Y1+60+font_chartsm.max_font_height,
00839                             m.format(v31, 2));
00840     if((v21-v31)>=0)
00841         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00842                                 REPORT_Y1+95,
00843                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00844                                 //                                      REPORT_Y1+95+font_chartsm.max_font_height,
00845                                 m.format(v21-v31, 2));
00846     else
00847         font_chart_red_sm.right_put( REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00848                                      REPORT_Y1+95,
00849                                      //                                 REPORT_X1+MODE_FINANCIAL_TAB2+field_space,
00850                                      //                                 REPORT_Y1+95+font_chartsm.max_font_height,
00851                                      m.format(v21-v31, 2));
00852 
00853     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00854                             REPORT_Y1+40,
00855                             //                                  REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00856                             //                                  REPORT_Y1+40+font_chartsm.max_font_height,
00857                             m.format(v22, 24));
00858     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00859                             REPORT_Y1+60,
00860                             //                                  REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00861                             //                                  REPORT_Y1+60+font_chartsm.max_font_height,
00862                             m.format(v32, 24));
00863     if((v22-v32)>=0)
00864         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00865                                 REPORT_Y1+95,
00866                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00867                                 //                                      REPORT_Y1+95+font_chartsm.max_font_height,
00868                                 m.format(v22-v32, 24));
00869     else
00870         font_chart_red_sm.right_put( REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00871                                      REPORT_Y1+95,
00872                                      //                                 REPORT_X1+MODE_FINANCIAL_TAB3+field_space,
00873                                      //                                 REPORT_Y1+95+font_chartsm.max_font_height,
00874                                      m.format(v22-v32, 24));
00875 
00876     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00877                             REPORT_Y1+40,
00878                             //                                  REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00879                             //                                  REPORT_Y1+40+font_chartsm.max_font_height,
00880                             m.format(v23, 2));
00881     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00882                             REPORT_Y1+60,
00883                             //                                  REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00884                             //                                  REPORT_Y1+60+font_chartsm.max_font_height,
00885                             m.format(v33, 2));
00886     if((v23-v33)>=0)
00887         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00888                                 REPORT_Y1+95,
00889                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00890                                 //                                      REPORT_Y1+95+font_chartsm.max_font_height,
00891                                 m.format(v23-v33, 2));
00892     else
00893         font_chart_red_sm.right_put( REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00894                                      REPORT_Y1+95,
00895                                      //                                 REPORT_X1+MODE_FINANCIAL_TAB4+field_space,
00896                                      //                                 REPORT_Y1+95+font_chartsm.max_font_height,
00897                                      m.format(v23-v33, 2));
00898 
00899     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00900                             REPORT_Y1+40,
00901                             //                                  REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00902                             //                                  REPORT_Y1+40+font_chartsm.max_font_height,
00903                             m.format(v24, 24));
00904     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00905                             REPORT_Y1+60,
00906                             //                                  REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00907                             //                                  REPORT_Y1+60+font_chartsm.max_font_height,
00908                             m.format(v34, 24));
00909     if((v24-v34)>=0)
00910         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00911                                 REPORT_Y1+95,
00912                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00913                                 //                                      REPORT_Y1+95+font_chartsm.max_font_height,
00914                                 m.format(v24-v34, 24));
00915     else
00916         font_chart_red_sm.right_put( REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00917                                      REPORT_Y1+95,
00918                                      //                                 REPORT_X1+MODE_FINANCIAL_TAB5+field_space,
00919                                      //                                 REPORT_Y1+95+font_chartsm.max_font_height,
00920                                      m.format(v24-v34, 24));
00921 
00922     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00923                             REPORT_Y1+40,
00924                             //                                  REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00925                             //                                  REPORT_Y1+40+font_chartsm.max_font_height,
00926                             m.format(v25, 2));
00927     font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00928                             REPORT_Y1+60,
00929                             //                                  REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00930                             //                                  REPORT_Y1+60+font_chartsm.max_font_height,
00931                             m.format(v35, 2));
00932 
00933     if((v25-v35)>=0)
00934         font_chartsm.right_put( REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00935                                 REPORT_Y1+95,
00936                                 //                                      REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00937                                 //                                      REPORT_Y1+95+font_chartsm.max_font_height,
00938                                 m.format(v25-v35, 2));
00939     else
00940         font_chart_red_sm.right_put( REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00941                                      REPORT_Y1+95,
00942                                      //                                 REPORT_X1+MODE_FINANCIAL_TAB6+field_space,
00943                                      //                                 REPORT_Y1+95+font_chart_red_sm.max_font_height,
00944                                      m.format(v25-v35, 2));
00945 
00946     vga.blt_buf(REPORT_X1+MODE_FINANCIAL_TAB2, REPORT_Y1,
00947                 REPORT_X2, REPORT_Y1+MODE_FINANCIAL_BOX1_HEIGHT);
00948 
00949     for(i=0;i<3;i++) {
00950         financial_button_group[i].pop();
00951         financial_button_group[i].body_ptr=
00952             (void*)(financial_button_up_bitmap[i]+4);
00953     }
00954 }
00955 
00956 //---------- End of function report_FINANCIAL ---------//
00957 
00958 //-------- Begin of function detect_athletics ---------//
00960 static int detect_athletics() {
00961     if (mode_init_flag != MODE_ATHLETICS)
00962         return 0;
00963 
00964     vga.use_front();
00965 
00966     help.set_help(  REPORT_X1+MODE_ATHLETICS_TAB1,
00967                     REPORT_Y1+40,
00968                     REPORT_X2,
00969                     REPORT_Y1+60,"H5.1.1.");
00970 
00971     help.set_help(  REPORT_X1+MODE_ATHLETICS_TAB1,
00972                     REPORT_Y1+65,
00973                     REPORT_X2,
00974                     REPORT_Y1+85,"H5.1.2.");
00975 
00976     help.set_help(  REPORT_X1+MODE_ATHLETICS_TAB1,
00977                     REPORT_Y1+90,
00978                     REPORT_X2,
00979                     REPORT_Y1+110,"H5.1.3.");
00980 
00981     char* helpCode1[] = {                           // different ncaa level have different number of games, thus we have to separate the help file.
00982         "H5.1.4a", "H5.1.4b", "H5.1.4c"
00983     };
00984     char* helpCode2[] = { "H5.1.5a", "H5.1.5b", "H5.1.5c" };
00985 
00986     help.set_help(  MODE_ATHLETICS_TAB2,
00987                     REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+MODE_ATHLETICS_BOX1_HEIGHT/2,
00988                     REPORT_X2,
00989                     REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+MODE_ATHLETICS_BOX1_HEIGHT/2+30,
00990                     helpCode1[athletics_office.ncaa_level_input] );
00991 
00992     help.set_help(  MODE_ATHLETICS_TAB2,
00993                     REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+MODE_ATHLETICS_BOX1_HEIGHT/2+70,
00994                     REPORT_X2,
00995                     REPORT_Y1+MODE_ATHLETICS_BOX1_HEIGHT+MODE_ATHLETICS_BOX1_HEIGHT/2+100,
00996                     helpCode2[athletics_office.ncaa_level_input] );
00997 
00998     if (mode_athletics_radio_button_participation.detect()) {
00999         //### fred 1021 ####//
01000         athletics_office.input_2_ncaa_level( *(mode_athletics_radio_button_participation.sel_num) );
01001         //### fred 1021 ####//
01002         return 1;
01003     }
01004 
01005     //## chea 160699 change for chance card
01006     if(chance_event.athlete_special_ban_year<=0) {
01007         if (mode_athletics_radio_button_adm_treatment.detect()) {
01008             enroll_res.athlete_offers_special=*(mode_athletics_radio_button_adm_treatment.sel_num);
01009             return 1;
01010         }
01011 
01012         if (mode_athletics_radio_button_fin_treatment.detect()) {
01013             enroll_res.athlete_aid_special=*(mode_athletics_radio_button_fin_treatment.sel_num);
01014             return 1;
01015         }
01016     }
01017     if (mode_athletics_radio_button_football.detect()) {
01018         sys.redraw_all_flag=1;
01019         return 1;
01020     }
01021 
01022     return 0;
01023 }
01024 
01025 //---------- End of function detect_athletics ---------//
01026 
01027 //-------- Begin of function detect_FINANCIAL ---------//
01029 static int detect_financial() {
01030     if (mode_init_flag != MODE_FINANCIAL)
01031         return 0;
01032 
01033     vga.use_front();
01034 
01035     help.set_help(
01036         REPORT_X1+MODE_FINANCIAL_TAB4+30,
01037         REPORT_Y1+30+MODE_FINANCIAL_BOX1_HEIGHT,
01038         REPORT_X2,
01039         REPORT_Y1+60+MODE_FINANCIAL_BOX1_HEIGHT,
01040         "A.8.8.1."
01041         );
01042 
01043     if(financial_spinner_budget.detect())
01044         return 1;
01045 
01046     for(int i=0;i<3;i++)
01047         if(financial_button_group[i].detect()) {
01048             financial_button_group[i].body_ptr =
01049                 (void *) (financial_button_down_bitmap[i] + 4);
01050             //  Communicate with Sim Engine
01051             finance.change_budget(i,false, AC_ATHLETICS,(*financial_spinner_budget.var_ptr));
01052             //##        begin zhoubin 000329
01053             *financial_spinner_budget.var_ptr=0;
01054             //##        end zhoubin 000329
01055         }
01056     if(mode_financial_slider_budget.detect())
01057         return 1;
01058 
01059     return 0;
01060 }
01061 
01062 //---------- End of function detect_FINANCIAL ---------//
01063 
01064 //-------- Begin of function deinit_athletics ---------//
01066 static void deinit_athletics() {
01067     if (mode_init_flag == MODE_ATHLETICS) {
01068 
01069         mode_athletics_radio_button_football.deinit();
01070         mode_athletics_radio_button_participation.deinit();
01071         mode_athletics_radio_button_adm_treatment.deinit();
01072         mode_athletics_radio_button_fin_treatment.deinit();
01073         mode_athletics_graphdbar_winloss.deinit();
01074 
01075         if(mode_athletics_no_top_athletes_bitmap) {
01076             mem_del(mode_athletics_no_top_athletes_bitmap);
01077             mode_athletics_no_top_athletes_bitmap=NULL;
01078         }
01079 
01080         // reset flag
01081         mode_init_flag = -1;
01082     }
01083 }
01084 
01085 //---------- End of function deinit_athletics ---------//
01086 
01087 //-------- Begin of function deinit_financial ------//
01089 static void deinit_financial() {
01090     if (mode_init_flag == MODE_FINANCIAL) {
01091         // deallocate memory used by the radio buttons and the value sliders
01092         if(mode_financial_stats_bitmap) {
01093             mem_del(mode_financial_stats_bitmap);
01094             mode_financial_stats_bitmap=NULL;
01095         }
01096 
01097         // #### begin Gilbert 28/04/2001 #####//
01098         financial_button_group.deinit_buttons();
01099         // #### end Gilbert 28/04/2001 #####//
01100         if (*financial_button_up_bitmap) {
01101             for (int i = 0; i < 3; i++) {
01102                 mem_del(financial_button_up_bitmap[i]);
01103                 mem_del(financial_button_down_bitmap[i]);
01104                 financial_button_up_bitmap[i] = NULL;
01105                 financial_button_down_bitmap[i] = NULL;
01106             }
01107         }
01108 
01109         //              mode_financial_slider_budget.deinit();
01110         financial_spinner_budget.deinit();
01111         mode_financial_graph_profitloss.deinit();
01112 
01113         // reset flag
01114         mode_init_flag = -1;
01115     }
01116 }
01117 
01118 //---------- End of function deinit_financial ------//

Generated on Fri Aug 23 01:37:13 2002 for VirtualU by doxygen1.2.17