2002-07-19 16:42:34 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: multimon_test.cpp
|
|
|
|
// Purpose: tests wxDisplay class
|
|
|
|
// Author: Royce Mitchell III
|
|
|
|
// Modified by:
|
|
|
|
// Created: 06/21/02
|
|
|
|
// RCS-ID: $Id$
|
2004-05-25 07:20:37 -04:00
|
|
|
// Copyright: (c) wxWidgets team
|
2002-07-19 16:42:34 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-01-26 14:06:06 -05:00
|
|
|
#include "wx/wx.h"
|
|
|
|
#include "wx/display.h"
|
2002-07-19 16:42:34 -04:00
|
|
|
|
|
|
|
class TestApp : public wxApp
|
|
|
|
{
|
2006-01-26 14:06:06 -05:00
|
|
|
bool OnInit();
|
2002-07-19 16:42:34 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_APP(TestApp)
|
|
|
|
IMPLEMENT_APP(TestApp)
|
|
|
|
|
|
|
|
bool TestApp::OnInit()
|
|
|
|
{
|
2006-01-26 14:06:06 -05:00
|
|
|
bool is_use_display =
|
2003-09-11 06:01:27 -04:00
|
|
|
#if wxUSE_DISPLAY
|
2004-05-25 15:27:39 -04:00
|
|
|
true
|
2003-09-11 06:01:27 -04:00
|
|
|
#else
|
2004-05-25 15:27:39 -04:00
|
|
|
false
|
2003-09-11 06:01:27 -04:00
|
|
|
#endif
|
|
|
|
;
|
|
|
|
if( !is_use_display )
|
|
|
|
{
|
|
|
|
wxMessageBox( _T("This sample has to be compiled with wxUSE_DISPLAY"), _T("Building error"), wxOK);
|
|
|
|
}
|
2006-01-26 14:06:06 -05:00
|
|
|
#if wxUSE_DISPLAY
|
2003-09-11 06:01:27 -04:00
|
|
|
else
|
|
|
|
{
|
2006-01-26 14:06:06 -05:00
|
|
|
size_t count = wxDisplay::GetCount();
|
2003-09-11 06:01:27 -04:00
|
|
|
wxLogDebug ( _T("I detected %i display(s) on your system"), count );
|
2006-01-26 14:06:06 -05:00
|
|
|
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++;
|
|
|
|
}
|
2003-09-11 06:01:27 -04:00
|
|
|
}
|
2006-01-26 14:06:06 -05:00
|
|
|
#endif
|
|
|
|
return false;
|
2002-07-19 16:42:34 -04:00
|
|
|
}
|