]> git.saurik.com Git - wxWidgets.git/blob - samples/multimon/multimon_test.cpp
Added a new overload of wxDecToHex and used it in wxRichTextImageBlock::WriteHex
[wxWidgets.git] / samples / multimon / multimon_test.cpp
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$
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wx.h"
13 #include "wx/display.h"
14
15 class TestApp : public wxApp
16 {
17 bool OnInit();
18 };
19
20 DECLARE_APP(TestApp)
21 IMPLEMENT_APP(TestApp)
22
23 bool TestApp::OnInit()
24 {
25 if ( !wxApp::OnInit() )
26 return false;
27
28 bool is_use_display =
29 #if wxUSE_DISPLAY
30 true
31 #else
32 false
33 #endif
34 ;
35 if( !is_use_display )
36 {
37 wxMessageBox( _T("This sample has to be compiled with wxUSE_DISPLAY"), _T("Building error"), wxOK);
38 }
39 #if wxUSE_DISPLAY
40 else
41 {
42 unsigned count = wxDisplay::GetCount();
43 wxLogDebug ( _T("I detected %u display(s) on your system"), count );
44 for (unsigned i = 0; i < count; i++)
45 {
46 wxDisplay display ( i );
47 wxRect r = display.GetGeometry();
48 wxLogDebug ( _T("Display #%u \"%s\" = ( %i, %i, %i, %i ) @ %i bits"),
49 i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(),
50 display.GetCurrentMode().GetDepth() );
51 }
52 }
53 #endif
54 return false;
55 }