Diff for /np2/embed/menubase/menudlg.c between versions 1.5 and 1.8

version 1.5, 2004/06/28 12:31:32 version 1.8, 2005/02/07 14:51:03
Line 291  static BOOL dlgbase_create(MENUDLG dlg,  Line 291  static BOOL dlgbase_create(MENUDLG dlg, 
   
         rct.right = hdl->rect.right - hdl->rect.left -          rct.right = hdl->rect.right - hdl->rect.left -
                                                                                 ((MENU_FBORDER + MENU_BORDER) * 2);                                                                                  ((MENU_FBORDER + MENU_BORDER) * 2);
         hdl->vram = vram_create(rct.right, MENUDLG_CYCAPTION, FALSE, DEFAULT_BPP);          hdl->vram = vram_create(rct.right, MENUDLG_CYCAPTION, FALSE, menubase.bpp);
         if (hdl->vram == NULL) {          if (hdl->vram == NULL) {
                 goto dbcre_err;                  goto dbcre_err;
         }          }
Line 490  static BOOL dlglist_create(MENUDLG dlg,  Line 490  static BOOL dlglist_create(MENUDLG dlg, 
   
         width = hdl->rect.right - hdl->rect.left - (MENU_LINE * 4);          width = hdl->rect.right - hdl->rect.left - (MENU_LINE * 4);
         height = hdl->rect.bottom - hdl->rect.top - (MENU_LINE * 4);          height = hdl->rect.bottom - hdl->rect.top - (MENU_LINE * 4);
         hdl->vram = vram_create(width, height, FALSE, DEFAULT_BPP);          hdl->vram = vram_create(width, height, FALSE, menubase.bpp);
         if (hdl->vram == NULL) {          if (hdl->vram == NULL) {
                 goto dlcre_err;                  goto dlcre_err;
         }          }
Line 1862  static BOOL dc_cb2(void *vpItem, void *v Line 1862  static BOOL dc_cb2(void *vpItem, void *v
         if (hdl->flag & MENU_REDRAW) {          if (hdl->flag & MENU_REDRAW) {
                 hdl->flag &= ~MENU_REDRAW;                  hdl->flag &= ~MENU_REDRAW;
                 if ((!(hdl->flag & MENU_DISABLE)) &&                  if ((!(hdl->flag & MENU_DISABLE)) &&
                         ((unsigned int)hdl->type < (sizeof(dlgpaint)/sizeof(DLGPAINT)))) {                          ((UINT)hdl->type < NELEMENTS(dlgpaint))) {
                         dlgpaint[hdl->type](dlg, hdl);                          dlgpaint[hdl->type](dlg, hdl);
                         menubase_setrect(dlg->vram, &hdl->rect);                          menubase_setrect(dlg->vram, &hdl->rect);
                 }                  }
Line 1949  BOOL menudlg_create(int width, int heigh Line 1949  BOOL menudlg_create(int width, int heigh
                                         MENUDLG_CYCAPTION + MENUDLG_BORDER;                                          MENUDLG_CYCAPTION + MENUDLG_BORDER;
         mb = &menubase;          mb = &menubase;
         dlg->font = mb->font;          dlg->font = mb->font;
         dlg->vram = vram_create(width, height, FALSE, DEFAULT_BPP);          dlg->vram = vram_create(width, height, FALSE, mb->bpp);
         if (dlg->vram == NULL) {          if (dlg->vram == NULL) {
                 goto mdcre_err;                  goto mdcre_err;
         }          }
Line 2093  BOOL menudlg_append(int type, MENUID id, Line 2093  BOOL menudlg_append(int type, MENUID id,
         dhdl.prm = NULL;          dhdl.prm = NULL;
         dhdl.prmcnt = 0;          dhdl.prmcnt = 0;
         dhdl.val = 0;          dhdl.val = 0;
         if (((unsigned int)type >= (sizeof(dlgcre)/sizeof(DLGCRE))) ||          if (((UINT)type >= NELEMENTS(dlgcre)) ||
                 (dlgcre[type](dlg, &dhdl, arg))) {                  (dlgcre[type](dlg, &dhdl, arg))) {
                 goto mda_err;                  goto mda_err;
         }          }
Line 2159  void menudlg_moving(int x, int y, int bt Line 2159  void menudlg_moving(int x, int y, int bt
                                 y -= hdl->rect.top;                                  y -= hdl->rect.top;
                                 dlg->btn = 1;                                  dlg->btn = 1;
                                 dlg->lastid = hdl->id;                                  dlg->lastid = hdl->id;
                                 if ((unsigned int)hdl->type <                                  if ((UINT)hdl->type < NELEMENTS(dlgclick)) {
                                                                         (sizeof(dlgclick)/sizeof(DLGCLICK))) {  
                                         dlgclick[hdl->type](dlg, hdl, x, y);                                          dlgclick[hdl->type](dlg, hdl, x, y);
                                 }                                  }
                         }                          }
Line 2172  void menudlg_moving(int x, int y, int bt Line 2171  void menudlg_moving(int x, int y, int bt
                         focus = rect_in(&hdl->rect, x, y);                          focus = rect_in(&hdl->rect, x, y);
                         x -= hdl->rect.left;                          x -= hdl->rect.left;
                         y -= hdl->rect.top;                          y -= hdl->rect.top;
                         if ((unsigned int)hdl->type < (sizeof(dlgmov)/sizeof(DLGMOV))) {                          if ((UINT)hdl->type < NELEMENTS(dlgmov)) {
                                 dlgmov[hdl->type](dlg, hdl, x, y, focus);                                  dlgmov[hdl->type](dlg, hdl, x, y, focus);
                         }                          }
                         if (btn == 2) {                          if (btn == 2) {
                                 dlg->btn = 0;                                  dlg->btn = 0;
                                 if ((unsigned int)hdl->type <                                  if ((UINT)hdl->type < NELEMENTS(dlgrel)) {
                                                                                 (sizeof(dlgrel)/sizeof(DLGREL))) {  
                                         dlgrel[hdl->type](dlg, hdl, focus);                                          dlgrel[hdl->type](dlg, hdl, focus);
                                 }                                  }
                         }                          }
Line 2238  void *menudlg_msg(int ctrl, MENUID id, v Line 2236  void *menudlg_msg(int ctrl, MENUID id, v
   
                 case DMSG_SETVAL:                  case DMSG_SETVAL:
                         ret = (void *)hdl->val;                          ret = (void *)hdl->val;
                         if ((unsigned int)hdl->type <                          if ((UINT)hdl->type < NELEMENTS(dlgsetval)) {
                                                                         (sizeof(dlgsetval)/sizeof(DLGSETVAL))) {  
                                 dlgsetval[hdl->type](dlg, hdl, (int)arg);                                  dlgsetval[hdl->type](dlg, hdl, (int)arg);
                         }                          }
                         break;                          break;
Line 2300  void *menudlg_msg(int ctrl, MENUID id, v Line 2297  void *menudlg_msg(int ctrl, MENUID id, v
                 case DMSG_ITEMRESET:                  case DMSG_ITEMRESET:
                         if ((dlg->btn) && (dlg->lastid == hdl->id)) {                          if ((dlg->btn) && (dlg->lastid == hdl->id)) {
                                 dlg->btn = 0;                                  dlg->btn = 0;
                                 if ((unsigned int)hdl->type <                                  if ((UINT)hdl->type < NELEMENTS(dlgrel)) {
                                                                                         (sizeof(dlgrel)/sizeof(DLGREL))) {  
                                         dlgrel[hdl->type](dlg, hdl, FALSE);                                          dlgrel[hdl->type](dlg, hdl, FALSE);
                                 }                                  }
                         }                          }

Removed from v.1.5  
changed lines
  Added in v.1.8


RetroPC.NET-CVS <cvs@retropc.net>