Applied patch [ 795491 ] Multimon sample compatibility with various conditions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#define wxUSE_DISPLAY 1
|
|
||||||
#include <wx/display.h>
|
#include <wx/display.h>
|
||||||
|
|
||||||
class TestApp : public wxApp
|
class TestApp : public wxApp
|
||||||
@@ -23,17 +22,33 @@ IMPLEMENT_APP(TestApp)
|
|||||||
|
|
||||||
bool TestApp::OnInit()
|
bool TestApp::OnInit()
|
||||||
{
|
{
|
||||||
|
bool is_use_display =
|
||||||
|
#if wxUSE_DISPLAY
|
||||||
|
TRUE
|
||||||
|
#else
|
||||||
|
FALSE
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
if( !is_use_display )
|
||||||
|
{
|
||||||
|
wxMessageBox( _T("This sample has to be compiled with wxUSE_DISPLAY"), _T("Building error"), wxOK);
|
||||||
|
}
|
||||||
|
#if wxUSE_DISPLAY
|
||||||
|
else
|
||||||
|
{
|
||||||
size_t count = wxDisplay::GetCount();
|
size_t count = wxDisplay::GetCount();
|
||||||
wxLogDebug ( "I detected %i display(s) on your system", count );
|
wxLogDebug ( _T("I detected %i display(s) on your system"), count );
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
while ( i < count )
|
while ( i < count )
|
||||||
{
|
{
|
||||||
wxDisplay display ( i );
|
wxDisplay display ( i );
|
||||||
wxRect r = display.GetGeometry();
|
wxRect r = display.GetGeometry();
|
||||||
wxLogDebug ( "Display #%i \"%s\" = ( %i, %i, %i, %i ) @ %i bits",
|
wxLogDebug ( _T("Display #%i \"%s\" = ( %i, %i, %i, %i ) @ %i bits"),
|
||||||
i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(),
|
i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(),
|
||||||
display.GetDepth() );
|
display.GetDepth() );
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user