home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2240.zip / wxWindows-2.4.0 / samples / multimon / multimon_test.cpp < prev   
C/C++ Source or Header  |  2002-07-19  |  1KB  |  40 lines

  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,v 1.1 2002/07/19 20:42:34 JS Exp $
  8. // Copyright:   (c) wxWindows team
  9. // Licence:     wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////////
  11.  
  12. #include <wx/wx.h>
  13. #define wxUSE_DISPLAY 1
  14. #include <wx/display.h>
  15.  
  16. class TestApp : public wxApp
  17. {
  18.     bool OnInit();
  19. };
  20.  
  21. DECLARE_APP(TestApp)
  22. IMPLEMENT_APP(TestApp)
  23.  
  24. bool TestApp::OnInit()
  25. {
  26.     size_t count = wxDisplay::GetCount();
  27.     wxLogDebug ( "I detected %i display(s) on your system", count );
  28.     size_t i = 0;
  29.     while ( i < count )
  30.     {
  31.         wxDisplay display ( i );
  32.         wxRect r = display.GetGeometry();
  33.         wxLogDebug ( "Display #%i \"%s\" = ( %i, %i, %i, %i ) @ %i bits",
  34.             i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(),
  35.             display.GetDepth() );
  36.         i++;
  37.     }
  38.     return FALSE;
  39. }
  40.