Previous 15994 Revisions Next

r7902 Monday 26th April, 2010 at 17:26:54 UTC by Firewave
[WIMGTOOL] Some WM_COMMAND handling cleanups
[src/mess/tools/imgtool/windows]assocdlg.c attrdlg.c secview.c

src/mess/tools/imgtool/windows/assocdlg.c
r7901r7902
126126         break;
127127
128128      case WM_COMMAND:
129         if (HIWORD(wparam) == BN_CLICKED)
130         {
131            l = GetWindowLongPtr(dialog, GWLP_USERDATA);
132            dlginfo = (assocdlg_info *) l;
133            id = LOWORD(wparam);
129         id = LOWORD(wparam);
134130
135            if ((id == IDOK) || (id == IDCANCEL))
131         if ((id == IDOK) || (id == IDCANCEL))
132         {
133            if (id == IDOK)
136134            {
137               if (id == IDOK)
135               l = GetWindowLongPtr(dialog, GWLP_USERDATA);
136               dlginfo = (assocdlg_info *)l;
137
138               for (i = 0; i < dlginfo->extension_count; i++)
138139               {
139                  for (i = 0; i < dlginfo->extension_count; i++)
140                  {
141                     is_set = SendMessage(GetDlgItem(dialog, CONTROL_START + i), BM_GETCHECK, 0, 0);
140                  is_set = SendMessage(GetDlgItem(dialog, CONTROL_START + i), BM_GETCHECK, 0, 0);
142141
143                     t_extension = tstring_from_utf8(dlginfo->extensions[i]);
144                     _sntprintf(buf, ARRAY_LENGTH(buf), TEXT(".%s"), t_extension);
145                     free(t_extension);
146                     currently_set = win_is_extension_associated(&assoc_info, buf);
142                  t_extension = tstring_from_utf8(dlginfo->extensions[i]);
143                  _sntprintf(buf, ARRAY_LENGTH(buf), TEXT(".%s"), t_extension);
144                  free(t_extension);
145                  currently_set = win_is_extension_associated(&assoc_info, buf);
147146
148                     if (is_set && !currently_set)
149                        win_associate_extension(&assoc_info, buf, TRUE);
150                     else if (!is_set && currently_set)
151                        win_associate_extension(&assoc_info, buf, FALSE);
152                  }
147                  if (is_set && !currently_set)
148                     win_associate_extension(&assoc_info, buf, TRUE);
149                  else if (!is_set && currently_set)
150                     win_associate_extension(&assoc_info, buf, FALSE);
153151               }
154
155               EndDialog(dialog, id);
156152            }
153
154            EndDialog(dialog, id);
157155         }
158156         break;
159157   }
src/mess/tools/imgtool/windows/attrdlg.c
r7901r7902
417417         break;
418418
419419      case WM_COMMAND:
420         if (HIWORD(wparam) == BN_CLICKED)
420         rc = LOWORD(wparam);
421         if (rc == IDOK || rc == IDCANCEL)
421422         {
422            rc = LOWORD(wparam);
423423            if (rc == IDOK)
424424            {
425425               l = GetWindowLongPtr(dialog, GWLP_USERDATA);
src/mess/tools/imgtool/windows/secview.c
r7901r7902
326326      case WM_COMMAND:
327327         switch(HIWORD(wparam))
328328         {
329            case BN_CLICKED:
329            case EN_CHANGE:
330               change_sector(dialog);
331               break;
332
333            default:
330334               switch(LOWORD(wparam))
331335               {
332336                  case IDOK:
r7901r7902
335339                     break;
336340               }
337341               break;
338
339            case EN_CHANGE:
340               change_sector(dialog);
341               break;
342342         }
343343         break;
344344

Previous 15994 Revisions Next


© 1998-2018 The MESS Team