]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/display.cpp
Added some documentation :)
[wxWidgets.git] / src / msw / display.cpp
index 1fd815e37c24d13df5bc282f1aaf16537d2fbde8..fc25e3f476503bd81f0e7e2ccaa92468eb9b8315 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ---------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "display.h"
 #endif
 
@@ -166,10 +166,10 @@ static wxDisplayInfoArray *gs_displays = NULL;
 // ----------------------------------------------------------------------------
 
 static BOOL CALLBACK wxmswMonitorEnumProc (
-  HMONITOR hMonitor,  // handle to display monitor
-  HDC hdcMonitor,     // handle to monitor-appropriate device context (NULL)
-  LPRECT lprcMonitor, // pointer to monitor intersection rectangle
-  LPARAM dwData       // data passed from EnumDisplayMonitors (unused)
+  HMONITOR hMonitor,        // handle to display monitor
+  HDC WXUNUSED(hdcMonitor), // handle to monitor-appropriate device context
+  LPRECT lprcMonitor,       // pointer to monitor intersection rectangle
+  LPARAM WXUNUSED(dwData)   // data passed from EnumDisplayMonitors (unused)
 )
 {
     wxDisplayInfo *info = new wxDisplayInfo();
@@ -193,9 +193,9 @@ static BOOL CALLBACK wxmswMonitorEnumProc (
 
 BOOL PASCAL
 wxDDEnumExCallback(GUID *pGuid,
-                   LPTSTR driverDescription,
+                   LPTSTR WXUNUSED(driverDescription),
                    LPTSTR driverName,
-                   LPVOID lpContext,
+                   LPVOID WXUNUSED(lpContext),
                    HMONITOR hmon)
 {
     if ( pGuid )
@@ -539,7 +539,7 @@ wxString wxDisplay::GetNameForEnumSettings() const
 // ----------------------------------------------------------------------------
 
 wxArrayVideoModes
-wxDisplay::DoGetModesDirectX(const wxVideoMode& modeMatch) const
+wxDisplay::DoGetModesDirectX(const wxVideoMode& WXUNUSED(modeMatch)) const
 {
     wxArrayVideoModes modes;
 
@@ -729,6 +729,18 @@ bool wxDisplay::DoChangeModeWindows(const wxVideoMode& mode)
     {
         case DISP_CHANGE_SUCCESSFUL:
             // ok
+            {
+                // If we have a top-level, full-screen frame, emulate
+                // the DirectX behavior and resize it.  This makes this
+                // API quite a bit easier to use.
+                wxWindow *winTop = wxTheApp->GetTopWindow();
+                wxFrame *frameTop = wxDynamicCast(winTop, wxFrame);
+                if (frameTop && frameTop->IsFullScreen())
+                {
+                    wxVideoMode current = GetCurrentMode();
+                    frameTop->SetClientSize(current.w, current.h);
+                }
+            }
             return true;
 
         case DISP_CHANGE_BADMODE: