Merge wxQT branch into the trunk.
This merges in the latest sources from GSoC 2014 wxQt project with just a few minor corrections, mostly undoing wrong changes to common files in that branch (results of a previous bad merge?) and getting rid of whitespace-only changes. Also remove debug logging from wxGrid. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
153
src/qt/mdi.cpp
Normal file
153
src/qt/mdi.cpp
Normal file
@@ -0,0 +1,153 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/qt/mdi.cpp
|
||||
// Author: Mariano Reingart, Peter Most
|
||||
// Copyright: (c) 2010 wxWidgets dev team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if wxUSE_MDI
|
||||
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
#include <QtWidgets/QMdiArea>
|
||||
|
||||
// Main MDI window helper
|
||||
|
||||
class wxQtMDIParentFrame : public wxQtEventSignalHandler< QMainWindow, wxMDIParentFrame >
|
||||
{
|
||||
public:
|
||||
wxQtMDIParentFrame( wxWindow *parent, wxMDIParentFrame *handler );
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
// Central widget helper (container to show scroll bars and receive events):
|
||||
|
||||
class wxQtMdiArea : public wxQtEventSignalHandler< QMdiArea, wxMDIClientWindow >
|
||||
{
|
||||
public:
|
||||
wxQtMdiArea( wxWindow *parent, wxMDIClientWindow *handler );
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
|
||||
|
||||
wxMDIParentFrame::wxMDIParentFrame()
|
||||
{
|
||||
}
|
||||
|
||||
wxMDIParentFrame::wxMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
(void)Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
m_qtWindow = new wxQtMDIParentFrame( parent, this );
|
||||
|
||||
if (!wxFrameBase::Create( parent, id, title, pos, size, style, name ))
|
||||
return false;
|
||||
|
||||
wxMDIClientWindow *client = OnCreateClient();
|
||||
m_clientWindow = client;
|
||||
if ( !m_clientWindow->CreateClient(this, GetWindowStyleFlag()) )
|
||||
return false;
|
||||
|
||||
GetHandle()->setCentralWidget( client->GetHandle() );
|
||||
|
||||
PostCreation();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ActivateNext()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ActivatePrevious()
|
||||
{
|
||||
}
|
||||
|
||||
//##############################################################################
|
||||
|
||||
wxMDIChildFrame::wxMDIChildFrame()
|
||||
{
|
||||
}
|
||||
|
||||
wxMDIChildFrame::wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
m_mdiParent = parent;
|
||||
bool ok = wxFrame::Create(parent->GetClientWindow(), id,
|
||||
title,
|
||||
pos, size, style, name);
|
||||
if (ok)
|
||||
{
|
||||
// Add the window to the internal MDI client area:
|
||||
static_cast<QMdiArea*>(parent->GetHandle()->centralWidget())->addSubWindow(GetHandle());
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::Activate()
|
||||
{
|
||||
}
|
||||
|
||||
//##############################################################################
|
||||
|
||||
wxMDIClientWindow::wxMDIClientWindow()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long WXUNUSED(style))
|
||||
{
|
||||
// create the MDI client area where the children window are displayed:
|
||||
m_qtWindow = new wxQtMdiArea( parent, this );
|
||||
return true;
|
||||
}
|
||||
|
||||
// Helper implementation:
|
||||
|
||||
wxQtMDIParentFrame::wxQtMDIParentFrame( wxWindow *parent, wxMDIParentFrame *handler )
|
||||
: wxQtEventSignalHandler< QMainWindow, wxMDIParentFrame >( parent, handler )
|
||||
{
|
||||
}
|
||||
|
||||
wxQtMdiArea::wxQtMdiArea(wxWindow *parent, wxMDIClientWindow *handler )
|
||||
: wxQtEventSignalHandler< QMdiArea, wxMDIClientWindow >( parent, handler )
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_MDI
|
Reference in New Issue
Block a user