initialize base class using its ctor

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-03-16 04:35:22 +00:00
parent 1003169e21
commit f37c35d717
2 changed files with 22 additions and 6 deletions

View File

@@ -55,7 +55,11 @@
class wxDisplayImplMacOSX : public wxDisplayImpl class wxDisplayImplMacOSX : public wxDisplayImpl
{ {
public: public:
wxDisplayImplMacOSX(CGDirectDisplayID id) : m_id(id) { } wxDisplayImplMacOSX(size_t n, CGDirectDisplayID id)
: wxDisplayImpl(n),
m_id(id)
{
}
virtual wxRect GetGeometry() const; virtual wxRect GetGeometry() const;
virtual wxString GetName() const { return wxString(); } virtual wxString GetName() const { return wxString(); }
@@ -148,7 +152,7 @@ wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(size_t n)
wxASSERT( err == CGDisplayNoErr ); wxASSERT( err == CGDisplayNoErr );
wxASSERT( n < theCount ); wxASSERT( n < theCount );
wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(theIDs[n]); wxDisplayImplMacOSX *display = new wxDisplayImplMacOSX(n, theIDs[n]);
delete [] theIDs; delete [] theIDs;
@@ -251,7 +255,11 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode )
class wxDisplayImplMac : public wxDisplayImpl class wxDisplayImplMac : public wxDisplayImpl
{ {
public: public:
wxDisplayImplMac(GDHandle hndl) : m_hndl(hndl) { } wxDisplayImplMac(size_t n, GDHandle hndl)
: wxDisplayImpl(n),
m_hndl(hndl)
{
}
virtual wxRect GetGeometry() const; virtual wxRect GetGeometry() const;
virtual wxString GetName() const { return wxString(); } virtual wxString GetName() const { return wxString(); }
@@ -318,12 +326,14 @@ int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p)
wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n)
{ {
size_t nOrig = n;
GDHandle hndl = DMGetFirstScreenDevice(true); GDHandle hndl = DMGetFirstScreenDevice(true);
while(hndl) while(hndl)
{ {
if (n == 0) if (n == 0)
{ {
return new wxDisplayImplMac(hndl); return new wxDisplayImplMac(nOrig, hndl);
} }
n--; n--;
hndl = DMGetNextScreenDevice(hndl, true); hndl = DMGetNextScreenDevice(hndl, true);

View File

@@ -53,7 +53,11 @@
class wxDisplayImplMac : public wxDisplayImpl class wxDisplayImplMac : public wxDisplayImpl
{ {
public: public:
wxDisplayImplMac(GDHandle hndl) : m_hndl(hndl) { } wxDisplayImplMac(size_t n, GDHandle hndl)
: wxDisplayImpl(n),
m_hndl(hndl)
{
}
virtual wxRect GetGeometry() const; virtual wxRect GetGeometry() const;
virtual wxString GetName() const { return wxString(); } virtual wxString GetName() const { return wxString(); }
@@ -120,12 +124,14 @@ int wxDisplayFactoryMac::GetFromPoint(const wxPoint &p)
wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n) wxDisplayImpl *wxDisplayFactoryMac::CreateDisplay(size_t n)
{ {
size_t nOrig = n;
GDHandle hndl = DMGetFirstScreenDevice(true); GDHandle hndl = DMGetFirstScreenDevice(true);
while(hndl) while(hndl)
{ {
if (n == 0) if (n == 0)
{ {
return new wxDisplayImplMac(hndl); return new wxDisplayImplMac(nOrig, hndl);
} }
n--; n--;
hndl = DMGetNextScreenDevice(hndl, true); hndl = DMGetNextScreenDevice(hndl, true);