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

Password:

ODEPTLST.CPP Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ODEPTLST.CPP

Go to the documentation of this file.
00001 #include <OSYS.H>
00002 #include <OCONFIG.H>
00003 #include <ODEPTLST.H>
00004 #include <OGAMESET.H>
00005 #include <OWORLDMT.H>
00006 #include <OVGA.H>
00007 #include <COLOR.H>
00008 #include <OFONT.H>
00009 #include <OGAMESTR.H>
00010 #include <OMOUSE.H>
00011 #include <OIFACE.H>
00012 #include <OINFO.H>
00013 #include <ODEPT.H>
00014 #include <OBUTTON.H>
00015 
00016 enum {                                            // screen coordinates
00017     REPORT_X1 = ZOOM_X1+15,
00018     REPORT_Y1 = ZOOM_Y1+25,
00019     REPORT_X2 = ZOOM_X2-15,
00020     REPORT_Y2 = ZOOM_Y2-55
00021 };
00022 
00023 enum {
00024     BUTTON_X0 = REPORT_X1+100,
00025     BOTTOM_Y1 = REPORT_Y2+25,
00026 };
00027 
00028 enum {
00029     BOTTOM_BUTTON_WIDTH = 80,
00030     BOTTOM_BUTTON_HEIGHT = 25,
00031     BOTTOM_BUTTON_DISTANCE = 10,
00032 };
00033 
00034 enum {                                            // the bg image id
00035     BG_PIC_ID = 7
00036 };
00037 
00038 static char dept_list_init_flag;
00039 static int line_spacing;
00040 //------- Begin of function DeptList::DeptList -----------//
00042 DeptList::DeptList() {
00043     init();
00044 }
00045 
00046 //--------- End of function DeptList::DeptList -----------//
00047 
00048 //------- Begin of function DeptList::~DeptList -----------//
00050 DeptList::~DeptList() {
00051     deinit();
00052 }
00053 
00054 //--------- End of function DeptList::~DeptList -----------//
00055 
00056 //------- Begin of function DeptList::deinit ---------------//
00058 void DeptList::deinit() {
00059     dept_list_init_flag = 0;
00060 }
00061 
00062 //--------- End of function DeptList::deinit ---------------//
00063 
00064 //------- Begin of function DeptList::init -----------------//
00066 void DeptList::init() {
00067     dept_list_init_flag = 0;
00068 }
00069 
00070 //--------- End of function DeptList::init -----------------//
00071 
00072 /*      
00073 static char *dept_list_labels[10]=
00074 {
00075 "ADMISSIONS AND FINANCIAL AID",
00076   "ATHLETICS",
00077   "DEVELOPMENT AND ALUMNI AFFAIRS",
00078   "FACILITIES MANAGEMENT",
00079   "LIBRARY AND INFORMANTION TECHNOLOGY",
00080   "INVESTMENT",
00081   "CRIME",
00082   "PARKING",
00083 "ENERGY",
00084 "OTHER MINOR REPORTS",
00085 };
00086 */
00087 
00088 //---------- Begin of function DeptList::eval_letter_report ------------//
00090 void DeptList::dept_list_report(int refreshFlag) {
00091     int tab1=REPORT_X1,tab2=REPORT_X1+160,
00092         tab3=REPORT_X1+200,tab4=REPORT_X1+700;
00093     int vtab1=REPORT_Y1+5,vtab2=REPORT_Y1+70,
00094         vtab3=REPORT_Y1+100,vtab4=REPORT_Y1+350;
00095 
00096     line_spacing = 340/department_array.size();
00097 
00098     vga.use_back();
00099     sys.is_institution_report=0;
00100     if (refreshFlag == INFO_REPAINT) {
00101         if(dept_list_init_flag )
00102             deinit();
00103 
00104         //------------- paint the background ----------------//
00105         if (!dept_list_init_flag) {
00106             user_interface.bg_img(BG_PIC_ID, &vga_back);
00107             info.disp_column_bitmap(&vga_back);
00108             dept_list_init_flag = 1;
00109             font_hstone.put(tab3,REPORT_Y1,"SELECT THE ACTIVE DEPARTMENT : ");
00110             for(int i=1;i<=department_array.size();i++) {
00111                 //                              image_interface.put_back( tab2,vtab1+line_spacing*i, "DSPB_UP" );
00112                 //                              vga.blt_buf(tab2,vtab1+line_spacing*i,tab2+70,vtab1+line_spacing*i+22);
00113                 //                              font_yellow_diamond.put(tab3,vtab1+line_spacing*i+2,dept_list_labels[i]);
00114                 if( department_array.is_deleted(i) )
00115                     continue;
00116                 String deptStr;
00117                 deptStr = department_array[i]->name();
00118                 String deptStrTmp=deptStr.substr(0,deptStr.len()-11);
00119 
00120                 //                              font_stone.put(tab2,vtab1+line_spacing*i+2,m.format(i,1));
00121                 //                              font_stone.put(tab2+30,vtab1+line_spacing*i+2,deptStr);
00122 
00123                 font_hstone.put
00124                     (tab2,vtab1+line_spacing*i+2,m.format(i,1));
00125                 font_hstone.put
00126                     (tab2+30,vtab1+line_spacing*i+2,deptStrTmp);
00127             }
00128         }
00129     }
00130     //------- blt the back buffer to front buffer -------//
00131     vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2);
00132 }
00133 
00134 //---------- End of function Development::eval_letter_report ------------//
00135 
00137 
00138 int DeptList::dept_list_detect() {
00139     int tab1=REPORT_X1,tab2=REPORT_X1+160,
00140         tab3=REPORT_X1+200,tab4=REPORT_X1+700;
00141     int vtab1=REPORT_Y1+5,vtab2=REPORT_Y1+70,
00142         vtab3=REPORT_Y1+100,vtab4=REPORT_Y1+350;
00143     if (!dept_list_init_flag)
00144         return 0;
00145 
00146     for(int i=1;i<=department_array.size();i++) {
00147         if( department_array.is_deleted(i) )
00148             continue;
00149         String deptStr;
00150         deptStr = department_array[i]->name();
00151         String deptStrTmp=deptStr.substr(0,deptStr.len()-11);
00152 
00153         font_stone.put(tab2,vtab1+line_spacing*i+2,m.format(i,1));
00154         font_stone.put(tab2+30,vtab1+line_spacing*i+2,deptStrTmp);
00155 
00156     }
00157 
00158     for(i=1;i<=department_array.size();i++) {
00159         if( department_array.is_deleted(i) )
00160             continue;
00161         if(mouse.in_area(tab3,vtab1+line_spacing*i,tab4,vtab1+line_spacing*i+22)) {
00162             String deptStr;
00163             deptStr = department_array[i]->name();
00164             String deptStrTmp=deptStr.substr(0,deptStr.len()-11);
00165 
00166             font_hstone.put(tab2,vtab1+line_spacing*i+2,m.format(i,1));
00167             font_hstone.put(tab2+30,vtab1+line_spacing*i+2,deptStrTmp);
00168         }
00169         if(mouse.single_click(tab3,vtab1+line_spacing*i,tab4,vtab1+line_spacing*i+22)) {
00170             department_array.selected_recno=i;
00171             sys.set_view_mode(sys.report_before_morerpt_or_deptlist);
00172             sys.redraw_all_flag=1;
00173         }
00174     }
00175     return 0;
00176 }

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