X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef1717a963dfb76bac26b9f4277ae590b3c0a2e6..714dfaa6fb52f9cc1da268cf743dfe6d5be1b2fe:/src/mac/carbon/display.cpp diff --git a/src/mac/carbon/display.cpp b/src/mac/carbon/display.cpp index 79c727f1f1..feb556a200 100644 --- a/src/mac/carbon/display.cpp +++ b/src/mac/carbon/display.cpp @@ -25,9 +25,13 @@ #if wxUSE_DISPLAY +#include "wx/display.h" + #ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/log.h" + #include "wx/dynarray.h" + #include "wx/log.h" + #include "wx/string.h" + #include "wx/gdicmn.h" #endif #ifdef __DARWIN__ @@ -41,10 +45,7 @@ #include #endif -#include "wx/display.h" #include "wx/display_impl.h" -#include "wx/gdicmn.h" -#include "wx/string.h" // ---------------------------------------------------------------------------- // display classes implementation @@ -55,7 +56,11 @@ class wxDisplayImplMacOSX : public wxDisplayImpl { public: - wxDisplayImplMacOSX(CGDirectDisplayID id) : m_id(id) { } + wxDisplayImplMacOSX(size_t n, CGDirectDisplayID id) + : wxDisplayImpl(n), + m_id(id) + { + } virtual wxRect GetGeometry() const; virtual wxString GetName() const { return wxString(); } @@ -73,7 +78,7 @@ private: class wxDisplayFactoryMacOSX : public wxDisplayFactory { public: - wxDisplayFactoryMacOSX(); + wxDisplayFactoryMacOSX() {} virtual wxDisplayImpl *CreateDisplay(size_t n); virtual size_t GetCount(); @@ -148,7 +153,7 @@ wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(size_t n) wxASSERT( err == CGDisplayNoErr ); wxASSERT( n < theCount ); - wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(theIDs[n]); + wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]); delete [] theIDs; @@ -251,7 +256,11 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode ) class wxDisplayImplMac : public wxDisplayImpl { public: - wxDisplayImplMac(GDHandle hndl) : m_hndl(hndl) { } + wxDisplayImplMac(size_t n, GDHandle hndl) + : wxDisplayImpl(n), + m_hndl(hndl) + { + } virtual wxRect GetGeometry() const; virtual wxString GetName() const { return wxString(); } @@ -318,12 +327,14 @@ int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p) wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n) { + size_t nOrig = n; + GDHandle hndl = DMGetFirstScreenDevice(true); while(hndl) { if (n == 0) { - return new wxDisplayImplMac(hndl); + return new wxDisplayImplMac(nOrig, hndl); } n--; hndl = DMGetNextScreenDevice(hndl, true);