]> git.saurik.com Git - wxWidgets.git/blame - samples/multimon/multimon_test.cpp
use wxDC::GetMultiLineTextExtent() instead of duplicating its code in wxButton::DoGet...
[wxWidgets.git] / samples / multimon / multimon_test.cpp
CommitLineData
a536e411
JS
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$
be5a51fb 8// Copyright: (c) wxWidgets team
a536e411
JS
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include <wx/wx.h>
a536e411
JS
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{
25088f1e
JS
25 bool is_use_display =
26 #if wxUSE_DISPLAY
80343f88 27 true
25088f1e 28 #else
80343f88 29 false
25088f1e
JS
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 {
a536e411 39 size_t count = wxDisplay::GetCount();
25088f1e 40 wxLogDebug ( _T("I detected %i display(s) on your system"), count );
a536e411
JS
41 size_t i = 0;
42 while ( i < count )
43 {
44 wxDisplay display ( i );
45 wxRect r = display.GetGeometry();
25088f1e 46 wxLogDebug ( _T("Display #%i \"%s\" = ( %i, %i, %i, %i ) @ %i bits"),
a536e411 47 i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(),
80343f88 48 display.GetCurrentMode().GetDepth() );
a536e411
JS
49 i++;
50 }
25088f1e
JS
51 }
52 #endif
80343f88 53 return false;
a536e411 54}