Subversion Repositories Games.Chess Giants

Rev

Rev 21 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21 Rev 124
Line 307... Line 307...
307
      // convert the status bar message to a hyperlink
307
      // convert the status bar message to a hyperlink
308
      ConvertStaticToHyperlink (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR));
308
      ConvertStaticToHyperlink (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR));
309
 
309
 
310
      // now show the window
310
      // now show the window
311
      ShowWindow (hWnd, SW_SHOW);
311
      ShowWindow (hWnd, SW_SHOW);
-
 
312
 
-
 
313
      return (0); // as MSDN says
312
   }
314
   }
313
 
315
 
314
   // else did we click the close button on the title bar ?
316
   // else did we click the close button on the title bar ?
315
   else if (message == WM_CLOSE)
317
   else if (message == WM_CLOSE)
-
 
318
   {
316
      DestroyWindow (hWnd); // close the window
319
      DestroyWindow (hWnd); // close the window
-
 
320
      return (0); // as MSDN says
-
 
321
   }
317
 
322
 
318
   // else are we destroying the window ?
323
   // else are we destroying the window ?
319
   else if (message == WM_DESTROY)
324
   else if (message == WM_DESTROY)
320
   {
325
   {
321
      KillTimer (hWnd, WINDOW_TIMER_REFRESH); // destroy the timer we used to refresh the window
326
      KillTimer (hWnd, WINDOW_TIMER_REFRESH); // destroy the timer we used to refresh the window
Line 327... Line 332...
327
 
332
 
328
      SAFE_free ((void **) &gametypes); // free the game types array
333
      SAFE_free ((void **) &gametypes); // free the game types array
329
      gametype_count = 0; // and reset its count
334
      gametype_count = 0; // and reset its count
330
 
335
 
331
      is_window_sought_validated = true; // remember we closed this window
336
      is_window_sought_validated = true; // remember we closed this window
-
 
337
      the_board.reevaluate = true; // refresh the GUI buttons if needed
-
 
338
      return (0); // as MSDN says
332
   }
339
   }
333
 
340
 
334
   // else are we resizing the window ?
341
   // else are we resizing the window ?
335
   else if (message == WM_SIZE)
342
   else if (message == WM_SIZE)
336
   {
343
   {
Line 346... Line 353...
346
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_LEVELTO),          NULL, 688, 40,  40, 16, SWP_NOZORDER);
353
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_LEVELTO),          NULL, 688, 40,  40, 16, SWP_NOZORDER);
347
      SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_LEVELTO),       NULL, 736, 38,  48, 20, SWP_NOZORDER);
354
      SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_LEVELTO),       NULL, 736, 38,  48, 20, SWP_NOZORDER);
348
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_YOUCANALSOPOSTYOURSBYCLICKINGHERE), NULL, 16, 64, client_rect.right - 32, 16, SWP_NOZORDER);
355
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_YOUCANALSOPOSTYOURSBYCLICKINGHERE), NULL, 16, 64, client_rect.right - 32, 16, SWP_NOZORDER);
349
      SetWindowPos (GetDlgItem (hWnd, WINDOW_LIST_SOUGHTGAMES), NULL, 16, 88, client_rect.right - 32, client_rect.bottom - 104, SWP_NOZORDER);
356
      SetWindowPos (GetDlgItem (hWnd, WINDOW_LIST_SOUGHTGAMES), NULL, 16, 88, client_rect.right - 32, client_rect.bottom - 104, SWP_NOZORDER);
350
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR), NULL, 0, client_rect.bottom - 16, client_rect.right, 16, SWP_NOZORDER);
357
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR), NULL, 0, client_rect.bottom - 16, client_rect.right, 16, SWP_NOZORDER);
-
 
358
 
-
 
359
      return (0); // as MSDN says
351
   }
360
   }
352
 
361
 
353
   // else are we asking how big/small we can resize ?
362
   // else are we asking how big/small we can resize ?
354
   else if (message == WM_GETMINMAXINFO)
363
   else if (message == WM_GETMINMAXINFO)
355
   {
364
   {
356
      minmax = (MINMAXINFO *) lParam; // get a pointer to the min/max info structure
365
      minmax = (MINMAXINFO *) lParam; // get a pointer to the min/max info structure
357
 
366
 
358
      minmax->ptMinTrackSize.x = WINDOW_MIN_WIDTH;
367
      minmax->ptMinTrackSize.x = WINDOW_MIN_WIDTH;
359
      minmax->ptMinTrackSize.y = WINDOW_MIN_HEIGHT;
368
      minmax->ptMinTrackSize.y = WINDOW_MIN_HEIGHT;
-
 
369
 
-
 
370
      return (0); // as MSDN says
360
   }
371
   }
361
 
372
 
362
   // else did we take action on one of the controls ?
373
   // else did we take action on one of the controls ?
363
   else if (message == WM_COMMAND)
374
   else if (message == WM_COMMAND)
364
   {
375
   {
Line 393... Line 404...
393
         DialogBox_SendSeek (); // if so, open the seek dialog box
404
         DialogBox_SendSeek (); // if so, open the seek dialog box
394
 
405
 
395
      // else was it the status bar hyperlink ?
406
      // else was it the status bar hyperlink ?
396
      else if (wParam_loword == WINDOW_TEXT_STATUSBAR)
407
      else if (wParam_loword == WINDOW_TEXT_STATUSBAR)
397
         ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the donation page in the default browser, maximized
408
         ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the donation page in the default browser, maximized
-
 
409
 
-
 
410
      return (0); // as MSDN says
398
   }
411
   }
399
 
412
 
400
   // else is it a timer event AND is it our refresh timer AND do we need to update the sought games list ?
413
   // else is it a timer event AND is it our refresh timer AND do we need to update the sought games list ?
401
   else if ((message == WM_TIMER) && (wParam == WINDOW_TIMER_REFRESH) && (soughtgames_updated))
414
   else if ((message == WM_TIMER) && (wParam == WINDOW_TIMER_REFRESH) && (soughtgames_updated))
402
   {
415
   {
Line 577... Line 590...
577
      // now that the display is finished, IF the reply is arrived, set the totals in the window title
590
      // now that the display is finished, IF the reply is arrived, set the totals in the window title
578
      if (soughtgame_count >= 0)
591
      if (soughtgame_count >= 0)
579
         SetWindowText (hWnd, LOCALIZE (L"SoughtGames_Title"));
592
         SetWindowText (hWnd, LOCALIZE (L"SoughtGames_Title"));
580
 
593
 
581
      soughtgames_updated = false; // remember we updated the list (don't do it twice)
594
      soughtgames_updated = false; // remember we updated the list (don't do it twice)
-
 
595
 
-
 
596
      return (0); // as MSDN says
582
   }
597
   }
583
 
598
 
584
   // else is it a list view message AND is it for this list view ?
599
   // else is it a list view message AND is it for this list view ?
585
   else if ((message == WM_NOTIFY) && (wParam == WINDOW_LIST_SOUGHTGAMES))
600
   else if ((message == WM_NOTIFY) && (wParam == WINDOW_LIST_SOUGHTGAMES))
586
   {
601
   {
Line 658... Line 673...
658
            }
673
            }
659
            else
674
            else
660
               DialogBox_SendSeek (); // else it's our own seek, so open the seek dialog box to modify it
675
               DialogBox_SendSeek (); // else it's our own seek, so open the seek dialog box to modify it
661
         }
676
         }
662
      }
677
      }
-
 
678
 
-
 
679
      return (0); // as MSDN says
663
   }
680
   }
664
 
681
 
665
   // call the default window message processing function to keep things going
682
   // call the default window message processing function to keep things going
666
   return (DefWindowProc (hWnd, message, wParam, lParam));
683
   return (DefWindowProc (hWnd, message, wParam, lParam));
667
}
684
}