00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "gui/utility.h"
00019
00020 POINT getAbsLoc(component *comp)
00021 {
00022 POINT pt;
00023 window *win_ptr;
00024 frame *frm_ptr;
00025 DW _x,_y,_width,_height;
00026
00027 pt.x = 0;
00028 pt.y = 0;
00029
00030 switch(comp->cnt_type)
00031 {
00032 case WIND_TYPE :
00033 win_ptr = (window *) comp->cnt_ptr;
00034 if(win_ptr->style & W_MAXIMIZE)
00035 {
00036 _x = BORDER_WIDTH;
00037 _y = TITLE_HEIGHT + BORDER_HEIGHT + ((win_ptr->hasMenu) ? MENUBAR_HEIGHT : 0);
00038 _width = SCREEN_WIDTH;
00039 _height = SCREEN_HEIGHT;
00040 }
00041 else
00042 {
00043 _x = win_ptr->x + BORDER_WIDTH;
00044 _y = win_ptr->y + TITLE_HEIGHT + BORDER_HEIGHT + ((win_ptr->hasMenu) ? MENUBAR_HEIGHT : 0);
00045 _width = win_ptr->width;
00046 _height = win_ptr->height;
00047 }
00048
00049 if((comp->x + comp->width < _width) && (comp->y + comp->height < _height))
00050 {
00051 pt.x = comp->x+_x;
00052 pt.y = comp->y+_y;
00053 }
00054 break;
00055 }
00056
00057
00058 return pt;
00059
00060 }