Diff for /np2/win9x/toolwin.cpp between versions 1.13 and 1.16

version 1.13, 2003/11/04 15:44:59 version 1.16, 2005/02/07 14:46:14
Line 70  typedef struct { Line 70  typedef struct {
         HWND                    hwnd;          HWND                    hwnd;
         WINLOCEX                wlex;          WINLOCEX                wlex;
         HBITMAP                 hbmp;          HBITMAP                 hbmp;
         BYTE                    fddaccess[2];          UINT8                   fddaccess[2];
         BYTE                    hddaccess;          UINT8                   hddaccess;
         BYTE                    _padding;          UINT8                   _padding;
         int                             winflg;          int                             winflg;
         int                             wingx;          int                             wingx;
         int                             wingy;          int                             wingy;
Line 103  static TOOLWIN  toolwin; Line 103  static TOOLWIN  toolwin;
   
 typedef struct {  typedef struct {
         WORD    idc;          WORD    idc;
         BYTE    *counter;          UINT8   *counter;
 } DISKACC;  } DISKACC;
   
 static const BYTE fddlist[FDDLIST_DRV] = {  static const UINT8 fddlist[FDDLIST_DRV] = {
                                         IDC_TOOLFDD1LIST, IDC_TOOLFDD2LIST};                                          IDC_TOOLFDD1LIST, IDC_TOOLFDD2LIST};
   
 static const DISKACC diskacc[3] = {  static const DISKACC diskacc[3] = {
Line 129  static HBITMAP skinload(const char *path Line 129  static HBITMAP skinload(const char *path
         toolskin.color1 = 0x600000;          toolskin.color1 = 0x600000;
         toolskin.color2 = 0xff0000;          toolskin.color2 = 0xff0000;
         if (path) {          if (path) {
                 ini_read(path, skintitle, skinini1, sizeof(skinini1)/sizeof(INITBL));                  ini_read(path, skintitle, skinini1, NELEMENTS(skinini1));
         }          }
         if (toolskin.main[0]) {          if (toolskin.main[0]) {
                 ZeroMemory(subitem, sizeof(defsubitem));                  ZeroMemory(subitem, sizeof(defsubitem));
Line 142  static HBITMAP skinload(const char *path Line 142  static HBITMAP skinload(const char *path
                 CopyMemory(subitem, defsubitem, sizeof(defsubitem));                  CopyMemory(subitem, defsubitem, sizeof(defsubitem));
         }          }
         if (path) {          if (path) {
                 ini_read(path, skintitle, skinini2, sizeof(skinini2)/sizeof(INITBL));                  ini_read(path, skintitle, skinini2, NELEMENTS(skinini2));
         }          }
         if (toolskin.main[0]) {          if (toolskin.main[0]) {
                 milstr_ncpy(fname, path, sizeof(fname));                  milstr_ncpy(fname, path, sizeof(fname));
Line 180  static void calctextsize(char *path, int Line 180  static void calctextsize(char *path, int
         file_cutname(path);          file_cutname(path);
         file_cutseparator(path);          file_cutseparator(path);
         file_cutname(path);          file_cutname(path);
           file_cutseparator(path);
         l = strlen(path);          l = strlen(path);
         if (l > 1) {          work[0] = '\0';
                 l -= 1;          if (l) {
                 if (milstr_kanji2nd(p, l - 1)) {                  milstr_ncpy(work, str_browse, sizeof(work));
                         l--;  
                 }  
         }  
         else {  
                 l = 0;  
         }          }
         milstr_ncpy(work, str_browse, sizeof(work));  
         milstr_ncat(work, p + l, sizeof(work));          milstr_ncat(work, p + l, sizeof(work));
         GetTextExtentPoint32(hdc, work, strlen(work), &tail);          GetTextExtentPoint32(hdc, work, strlen(work), &tail);
         pos = 0;          pos = 0;
Line 305  static void remakefddlist(HWND hwnd, TOO Line 300  static void remakefddlist(HWND hwnd, TOO
         setlist(hwnd, fdd, sel);          setlist(hwnd, fdd, sel);
 }  }
   
 static void accdraw(HWND hWnd, BYTE count) {  static void accdraw(HWND hWnd, UINT8 count) {
   
         HDC                     hdc;          HDC                     hdc;
         PAINTSTRUCT     ps;          PAINTSTRUCT     ps;
Line 618  const char  *p; Line 613  const char  *p;
         sysmng_update(SYS_UPDATEOSCFG);          sysmng_update(SYS_UPDATEOSCFG);
   
         wlex = np2_winlocexallwin(hWndMain);          wlex = np2_winlocexallwin(hWndMain);
           winlocex_setholdwnd(wlex, hWnd);
         toolwindestroy();          toolwindestroy();
         hbmp = skinload(np2tool.skin);          hbmp = skinload(np2tool.skin);
         if (hbmp == NULL) {          if (hbmp == NULL) {
Line 862  static LRESULT CALLBACK twproc(HWND hWnd Line 858  static LRESULT CALLBACK twproc(HWND hWnd
                 case WM_LBUTTONDBLCLK:                  case WM_LBUTTONDBLCLK:
                         np2tool.type ^= 1;                          np2tool.type ^= 1;
                         wlex = np2_winlocexallwin(hWndMain);                          wlex = np2_winlocexallwin(hWndMain);
                           winlocex_setholdwnd(wlex, hWnd);
                         np2class_windowtype(hWnd, (np2tool.type & 1) << 1);                          np2class_windowtype(hWnd, (np2tool.type & 1) << 1);
                         winlocex_move(wlex);                          winlocex_move(wlex);
                         winlocex_destroy(wlex);                          winlocex_destroy(wlex);
Line 943  HWND toolwin_gethwnd(void) { Line 940  HWND toolwin_gethwnd(void) {
         return(toolwin.hwnd);          return(toolwin.hwnd);
 }  }
   
 void toolwin_setfdd(BYTE drv, const char *name) {  void toolwin_setfdd(UINT8 drv, const char *name) {
   
         TOOLFDD *fdd;          TOOLFDD *fdd;
         char    *q;          char    *q;
Line 986  void toolwin_setfdd(BYTE drv, const char Line 983  void toolwin_setfdd(BYTE drv, const char
         }          }
 }  }
   
 static void setdiskacc(UINT num, BYTE count) {  static void setdiskacc(UINT num, UINT8 count) {
   
 const DISKACC   *acc;  const DISKACC   *acc;
         HWND            sub;          HWND            sub;
Line 994  const DISKACC *acc; Line 991  const DISKACC *acc;
         if (toolwin.hwnd == NULL) {          if (toolwin.hwnd == NULL) {
                 return;                  return;
         }          }
         if (num < (sizeof(diskacc)/sizeof(DISKACC))) {          if (num < NELEMENTS(diskacc)) {
                 acc = diskacc + num;                  acc = diskacc + num;
                 sub = NULL;                  sub = NULL;
                 if (*(acc->counter) == 0) {                  if (*(acc->counter) == 0) {
Line 1007  const DISKACC *acc; Line 1004  const DISKACC *acc;
         }          }
 }  }
   
 void toolwin_fddaccess(BYTE drv) {  void toolwin_fddaccess(UINT8 drv) {
   
         if (drv < 2) {          if (drv < 2) {
                 setdiskacc(drv, 20);                  setdiskacc(drv, 20);
         }          }
 }  }
   
 void toolwin_hddaccess(BYTE drv) {  void toolwin_hddaccess(UINT8 drv) {
   
         setdiskacc(2, 10);          setdiskacc(2, 10);
 }  }
   
 void toolwin_draw(BYTE frame) {  void toolwin_draw(UINT8 frame) {
   
 const DISKACC   *acc;  const DISKACC   *acc;
 const DISKACC   *accterm;  const DISKACC   *accterm;
         BYTE            counter;          UINT8           counter;
         HWND            sub;          HWND            sub;
   
         if (toolwin.hwnd == NULL) {          if (toolwin.hwnd == NULL) {
Line 1033  const DISKACC *accterm; Line 1030  const DISKACC *accterm;
                 frame = 1;                  frame = 1;
         }          }
         acc = diskacc;          acc = diskacc;
         accterm = acc + (sizeof(diskacc)/sizeof(DISKACC));          accterm = acc + NELEMENTS(diskacc);
         while(acc < accterm) {          while(acc < accterm) {
                 counter = *acc->counter;                  counter = *acc->counter;
                 if (counter) {                  if (counter) {
Line 1092  void toolwin_readini(void) { Line 1089  void toolwin_readini(void) {
         np2tool.posy = CW_USEDEFAULT;          np2tool.posy = CW_USEDEFAULT;
         np2tool.type = 1;          np2tool.type = 1;
         initgetfile(path, sizeof(path));          initgetfile(path, sizeof(path));
         ini_read(path, ini_title, iniitem, sizeof(iniitem)/sizeof(INITBL));          ini_read(path, ini_title, iniitem, NELEMENTS(iniitem));
 }  }
   
 void toolwin_writeini(void) {  void toolwin_writeini(void) {
Line 1100  void toolwin_writeini(void) { Line 1097  void toolwin_writeini(void) {
         char    path[MAX_PATH];          char    path[MAX_PATH];
   
         initgetfile(path, sizeof(path));          initgetfile(path, sizeof(path));
         ini_write(path, ini_title, iniitem, sizeof(iniitem)/sizeof(INITBL));          ini_write(path, ini_title, iniitem, NELEMENTS(iniitem));
 }  }
   

Removed from v.1.13  
changed lines
  Added in v.1.16


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