// Name: display.cpp
// Purpose: wxWindows sample showing the features of wxDisplay class
// Author: Vadim Zeitlin
-// Modified by:
+// Modified by: Ryan Norton & Brian Victor
// Created: 23.02.03
// RCS-ID: $Id$
// Copyright: (c) Vadim Zeitlin <vadim@wxwindows.org>
#pragma hdrstop
#endif
+#if !wxUSE_DISPLAY
+ #error "To compile this sample you must build the library with wxUSE_DISPLAY set to 1"
+#endif
+
// for all others, include the necessary headers explicitly
#ifndef WX_PRECOMP
#include "wx/app.h"
- #include "wx/frame.h"
-
#include "wx/stattext.h"
#include "wx/layout.h"
+ #include "wx/intl.h"
+ #include "wx/menu.h"
+ #include "wx/sizer.h"
+ #include "wx/choice.h"
+ #include "wx/msgdlg.h"
+ #include "wx/log.h"
+ #include "wx/panel.h"
+ #include "wx/button.h"
#endif
#include "wx/notebook.h"
#include "wx/display.h"
+// the application icon (under Windows and OS/2 it is in resources)
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
+ #include "../sample.xpm"
+#endif
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
// 'Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
+#ifdef __WXMSW__
+ if ( argc == 2 && !wxStricmp(argv[1], _T("/dx")) )
+ {
+ wxDisplay::UseDirectX(true);
+ }
+#endif // __WXMSW__
+
// create the main application window
MyFrame *frame = new MyFrame(_("Display wxWindows Sample"),
wxPoint(50, 50), wxSize(450, 340));
: wxFrame(NULL, -1, title, pos, size, style)
{
// set the frame icon
- SetIcon(wxICON(mondrian));
+ SetIcon(wxICON(sample));
#if wxUSE_MENUS
// create a menu bar
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxDisplay dpy(1);
- if ( !dpy.ChangeMode(wxVideoMode(800, 600)) )
- {
- wxLogError("Failed!");
- return;
- }
-
wxMessageBox(_T("Demo program for wxDisplay class.\n\n(c) 2003 Vadim Zeitlin"),
_T("About Display Sample"),
wxOK | wxICON_INFORMATION,