1///////////////////////////////////////////////////////////////////////////// 2// Name: multimon_test.cpp 3// Purpose: tests wxDisplay class 4// Author: Royce Mitchell III 5// Modified by: 6// Created: 06/21/02 7// RCS-ID: $Id: multimon_test.cpp 41547 2006-10-02 05:36:31Z PC $ 8// Copyright: (c) wxWidgets team 9// Licence: wxWindows licence 10///////////////////////////////////////////////////////////////////////////// 11 12#include "wx/wx.h" 13#include "wx/display.h" 14 15class TestApp : public wxApp 16{ 17 bool OnInit(); 18}; 19 20DECLARE_APP(TestApp) 21IMPLEMENT_APP(TestApp) 22 23bool TestApp::OnInit() 24{ 25 bool is_use_display = 26 #if wxUSE_DISPLAY 27 true 28 #else 29 false 30 #endif 31 ; 32 if( !is_use_display ) 33 { 34 wxMessageBox( _T("This sample has to be compiled with wxUSE_DISPLAY"), _T("Building error"), wxOK); 35 } 36#if wxUSE_DISPLAY 37 else 38 { 39 unsigned count = wxDisplay::GetCount(); 40 wxLogDebug ( _T("I detected %u display(s) on your system"), count ); 41 for (unsigned i = 0; i < count; i++) 42 { 43 wxDisplay display ( i ); 44 wxRect r = display.GetGeometry(); 45 wxLogDebug ( _T("Display #%u \"%s\" = ( %i, %i, %i, %i ) @ %i bits"), 46 i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(), 47 display.GetCurrentMode().GetDepth() ); 48 } 49 } 50#endif 51 return false; 52} 53