X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80343f88f29506ad465956d957d97ed207801505..e960c20e389061c0db09e03fdaf9ffe3a418779b:/samples/multimon/multimon_test.cpp diff --git a/samples/multimon/multimon_test.cpp b/samples/multimon/multimon_test.cpp index 3ddf4e93b4..2347e7fdb3 100644 --- a/samples/multimon/multimon_test.cpp +++ b/samples/multimon/multimon_test.cpp @@ -9,12 +9,12 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include -#include +#include "wx/wx.h" +#include "wx/display.h" class TestApp : public wxApp { - bool OnInit(); + bool OnInit(); }; DECLARE_APP(TestApp) @@ -22,7 +22,10 @@ IMPLEMENT_APP(TestApp) bool TestApp::OnInit() { - bool is_use_display = + if ( !wxApp::OnInit() ) + return false; + + bool is_use_display = #if wxUSE_DISPLAY true #else @@ -33,22 +36,20 @@ bool TestApp::OnInit() { wxMessageBox( _T("This sample has to be compiled with wxUSE_DISPLAY"), _T("Building error"), wxOK); } - #if wxUSE_DISPLAY +#if wxUSE_DISPLAY else { - size_t count = wxDisplay::GetCount(); - wxLogDebug ( _T("I detected %i display(s) on your system"), count ); - size_t i = 0; - while ( i < count ) - { - wxDisplay display ( i ); - wxRect r = display.GetGeometry(); - wxLogDebug ( _T("Display #%i \"%s\" = ( %i, %i, %i, %i ) @ %i bits"), - i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(), - display.GetCurrentMode().GetDepth() ); - i++; - } + unsigned count = wxDisplay::GetCount(); + wxLogDebug ( _T("I detected %u display(s) on your system"), count ); + for (unsigned i = 0; i < count; i++) + { + wxDisplay display ( i ); + wxRect r = display.GetGeometry(); + wxLogDebug ( _T("Display #%u \"%s\" = ( %i, %i, %i, %i ) @ %i bits"), + i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(), + display.GetCurrentMode().GetDepth() ); + } } - #endif - return false; +#endif + return false; }