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
      ShowWindow (hWnd, SW_SHOW);
307
      ShowWindow (hWnd, SW_SHOW);
308
 
308
 
309
      // and send focus to the player name filter field (note: GetDlgItem works ALSO with windows! MSDN certified :))
309
      // and send focus to the player name filter field (note: GetDlgItem works ALSO with windows! MSDN certified :))
310
      if (GetForegroundWindow () == hWnd)
310
      if (GetForegroundWindow () == hWnd)
311
         SetFocus (GetDlgItem (hWnd, WINDOW_EDITBOX_NAMECONTAINS));
311
         SetFocus (GetDlgItem (hWnd, WINDOW_EDITBOX_NAMECONTAINS));
-
 
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 this window ?
323
   // else are we destroying this 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
322
      hThisWnd = NULL; // window is closed
327
      hThisWnd = NULL; // window is closed
323
      SetForegroundWindow (hMainWnd); // restore focus on the main window
328
      SetForegroundWindow (hMainWnd); // restore focus on the main window
324
      is_window_opponents_validated = true; // remember we closed this window
329
      is_window_opponents_validated = true; // remember we closed this window
-
 
330
      the_board.reevaluate = true; // refresh the GUI buttons if needed
-
 
331
      return (0); // as MSDN says
325
   }
332
   }
326
 
333
 
327
   // else are we resizing the window ?
334
   // else are we resizing the window ?
328
   else if (message == WM_SIZE)
335
   else if (message == WM_SIZE)
329
   {
336
   {
Line 339... Line 346...
339
      SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_LEVELFROM), NULL, 640, 38, 48, 20, SWP_NOZORDER);
346
      SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_LEVELFROM), NULL, 640, 38, 48, 20, SWP_NOZORDER);
340
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_LEVELTO), NULL, 688, 40, 40, 16, SWP_NOZORDER);
347
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_LEVELTO), NULL, 688, 40, 40, 16, SWP_NOZORDER);
341
      SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_LEVELTO), NULL, 736, 38, 48, 20, SWP_NOZORDER);
348
      SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_LEVELTO), NULL, 736, 38, 48, 20, SWP_NOZORDER);
342
      SetWindowPos (GetDlgItem (hWnd, WINDOW_LIST_OPPONENTS), NULL, 16, 64, client_rect.right - 32, client_rect.bottom - 80, SWP_NOZORDER);
349
      SetWindowPos (GetDlgItem (hWnd, WINDOW_LIST_OPPONENTS), NULL, 16, 64, client_rect.right - 32, client_rect.bottom - 80, SWP_NOZORDER);
343
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR), NULL, 0, client_rect.bottom - 16, client_rect.right, 16, SWP_NOZORDER);
350
      SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR), NULL, 0, client_rect.bottom - 16, client_rect.right, 16, SWP_NOZORDER);
-
 
351
 
-
 
352
      return (0); // as MSDN says
344
   }
353
   }
345
 
354
 
346
   // else are we asking how big/small we can resize ?
355
   // else are we asking how big/small we can resize ?
347
   else if (message == WM_GETMINMAXINFO)
356
   else if (message == WM_GETMINMAXINFO)
348
   {
357
   {
349
      minmax = (MINMAXINFO *) lParam; // get a pointer to the min/max info structure
358
      minmax = (MINMAXINFO *) lParam; // get a pointer to the min/max info structure
350
 
359
 
351
      minmax->ptMinTrackSize.x = WINDOW_MIN_WIDTH;
360
      minmax->ptMinTrackSize.x = WINDOW_MIN_WIDTH;
352
      minmax->ptMinTrackSize.y = WINDOW_MIN_HEIGHT;
361
      minmax->ptMinTrackSize.y = WINDOW_MIN_HEIGHT;
-
 
362
 
-
 
363
      return (0); // as MSDN says
353
   }
364
   }
354
 
365
 
355
   // else is it a timer event AND is it our refresh timer ?
366
   // else is it a timer event AND is it our refresh timer ?
356
   else if ((message == WM_TIMER) && (wParam == WINDOW_TIMER_REFRESH))
367
   else if ((message == WM_TIMER) && (wParam == WINDOW_TIMER_REFRESH))
357
   {
368
   {
Line 487... Line 498...
487
            SetWindowText (hWnd, window_title);
498
            SetWindowText (hWnd, window_title);
488
         }
499
         }
489
 
500
 
490
         onlineplayers_updated = false; // remember we updated the list (don't do it twice)
501
         onlineplayers_updated = false; // remember we updated the list (don't do it twice)
491
      }
502
      }
-
 
503
 
-
 
504
      return (0); // as MSDN says
492
   }
505
   }
493
 
506
 
494
   // is it a list view message ?
507
   // is it a list view message ?
495
   else if ((message == WM_NOTIFY) && (wParam == WINDOW_LIST_OPPONENTS))
508
   else if ((message == WM_NOTIFY) && (wParam == WINDOW_LIST_OPPONENTS))
496
   {
509
   {
Line 544... Line 557...
544
               Interlocutor_FindOrCreate (onlineplayer->nickname);
557
               Interlocutor_FindOrCreate (onlineplayer->nickname);
545
            else
558
            else
546
               PlayerCard_FindOrCreate (onlineplayer->nickname); // else just display his player card
559
               PlayerCard_FindOrCreate (onlineplayer->nickname); // else just display his player card
547
         }
560
         }
548
      }
561
      }
-
 
562
 
-
 
563
      return (0); // as MSDN says
549
   }
564
   }
550
 
565
 
551
   // else did we take action on one of the controls ?
566
   // else did we take action on one of the controls ?
552
   else if (message == WM_COMMAND)
567
   else if (message == WM_COMMAND)
553
   {
568
   {
Line 578... Line 593...
578
      }
593
      }
579
 
594
 
580
      // else was it the status bar hyperlink ?
595
      // else was it the status bar hyperlink ?
581
      else if (wParam_loword == WINDOW_TEXT_STATUSBAR)
596
      else if (wParam_loword == WINDOW_TEXT_STATUSBAR)
582
         ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the donation page in the default browser, maximized
597
         ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the donation page in the default browser, maximized
-
 
598
 
-
 
599
      return (0); // as MSDN says
583
   }
600
   }
584
 
601
 
585
   // call the default window message processing function to keep things going
602
   // call the default window message processing function to keep things going
586
   return (DefWindowProc (hWnd, message, wParam, lParam));
603
   return (DefWindowProc (hWnd, message, wParam, lParam));
587
}
604
}