By Hans Van Leemputten (hansvl)
- This patch implements a generic notebook based mdi,
due to that wxMDIChildFrame could not derive from
wxFrame some things in the samples and in the docmdi
classes needed to be adjusted... basically this comes
down to not do (wxFrame *) but instead do
(wxMDIChildFrame *), or store a pointer to the frame in a
wxWindow* instead of a wxFrame variable...
- The main reason wxMDIChildFrame cannot derive from
wxFrame is that it would take to much platform specific
functions to be overwritten (= lot of ifdef's). This then
couldn't be called generic anymore, so that's why we
need to derive from wxPanel...
- Tested on/with:
1. wxMSW (I disabled the MSW MDI implementation to
be able to test it), tested it with the MDI sample,
docvwmdi sample and docview sample and also tested it
with wxWorkshop. (test = compile and run)
2. wxX11, tested with the same set wxWin samples as
the wxMSW test. I also compiled wxWorkshop with it,
but could not run wxWorkshop due to some issue not
related to the MDI implementation.
- How to apply:
* Apply the patch
* move mdig.cpp into wxWindows/src/generic/
* move mdig.h into wxWindows/include/wx/generic/
- Some extra things that still need to be done:
* File lists, project files should be updated to include
mdig.cpp (the patch only change this on wxX11)
* The configuration script should be updated.
* Maybe wxUSE_GENERIC_MDI_ARCHITECTURE also
should be added so it is only included when wanted...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16610
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
fi
if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
- if test "$wxUSE_UNIVERSAL" = "yes"; then
- AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
- wxUSE_MDI_ARCHITECTURE=no
- fi
- if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
- AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
- fi
+dnl There is now experimental generic MDI support
+dnl if test "$wxUSE_UNIVERSAL" = "yes"; then
+dnl AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
+dnl wxUSE_MDI_ARCHITECTURE=no
+dnl fi
+
+ if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
+ AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
+ fi
fi
if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
-include/wx_cw.pch
-include/wx_cw.pch++
-include/wx_cw_d.pch
-include/wx_cw_d.pch++
+include/wx*.pch*
include/wx/wx_cw.h
include/wx/wx_cw_d.h
src/mac/morefile/*.h
src/mac/morefile/*.cpp
+include/wx_pb.h
include/wx/mac/*.h
laywin.cpp Generic
listctrl.cpp Generic NotWin32
logg.cpp Generic
+mdig.cpp Generic NotWin32,NotGTK,NotOS2,NotMac
msgdlgg.cpp Generic Generic
notebook.cpp Generic NotWin32,NotGTK,NotOS2,NotMGL,NotX11,NotMac,NotMicro
numdlgg.cpp Generic
imaglist.h GenericH
laywin.h GenericH
listctrl.h GenericH NotWin32
+mdig.cpp GenericH NotWin32,NotGTK,NotOS2,NotMac
msgdlgg.h GenericH
notebook.h GenericH
paletteg.h GenericH NotMSW,NotX,NotX11,NotOS2
- All common, generic and MSW-specific wxWindows source;
- samples;
- documentation in Windows Help format;
-- makefiles for most Windows compilers, plus BC++ and
- VC++ IDE files;
+- makefiles for most Windows compilers, plus CodeWarrior,
+ BC++ and VC++ IDE files;
- JPEG library source;
- TIFF library source;
- Object Graphics Library;
inline wxView *GetView(void) const { return m_childView; }
inline void SetDocument(wxDocument *doc) { m_childDocument = doc; }
inline void SetView(wxView *view) { m_childView = view; }
- bool Destroy() { m_childView = (wxView *)NULL; return wxFrame::Destroy(); }
+ bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); }
protected:
wxDocument* m_childDocument;
wxView* m_childView;
wxString GetViewName() const { return m_viewTypeName; }
void SetViewName(const wxString& name) { m_viewTypeName = name; };
- wxFrame *GetFrame() const { return m_viewFrame ; }
- void SetFrame(wxFrame *frame) { m_viewFrame = frame; }
+ wxWindow *GetFrame() const { return m_viewFrame ; }
+ void SetFrame(wxWindow *frame) { m_viewFrame = frame; }
virtual void OnActivateView(bool activate, wxView *activeView, wxView *deactiveView);
virtual void OnDraw(wxDC *dc) = 0;
protected:
wxDocument* m_viewDocument;
wxString m_viewTypeName;
- wxFrame* m_viewFrame;
+ wxWindow* m_viewFrame;
};
// Represents user interface (and other) properties of documents and views
#ifndef _WX_MDI_H_BASE_
#define _WX_MDI_H_BASE_
-#if defined(__WXMSW__)
+#if defined(__WXUNIVERSAL__)
+#include "wx/generic/mdig.h"
+#elif defined(__WXMSW__)
#include "wx/msw/mdi.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/mdi.h"
// Creates a canvas. Called from view.cpp when a new drawing
// view is created.
-MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent)
+MyCanvas *MyFrame::CreateCanvas(wxView *view, wxMDIChildFrame *parent)
{
int width, height;
parent->GetClientSize(&width, &height);
#ifndef __DOCVIEWSAMPLEH__
#define __DOCVIEWSAMPLEH__
+#include "wx/mdi.h"
+#include "wx/docview.h"
#include "wx/docmdi.h"
class wxDocManager;
long type);
void OnAbout(wxCommandEvent& event);
- MyCanvas *CreateCanvas(wxView *view, wxFrame *parent);
+ MyCanvas *CreateCanvas(wxView *view, wxMDIChildFrame *parent);
DECLARE_EVENT_TABLE()
};
END_EVENT_TABLE()
// Define a constructor for my canvas
-MyCanvas::MyCanvas(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style):
+MyCanvas::MyCanvas(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style):
wxScrolledWindow(frame, -1, pos, size, style)
{
view = v;
}
// Define a constructor for my text subwindow
-MyTextWindow::MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style):
+MyTextWindow::MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style):
wxTextCtrl(frame, -1, "", pos, size, style)
{
view = v;
public:
wxView *view;
- MyCanvas(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style);
+ MyCanvas(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style);
virtual void OnDraw(wxDC& dc);
void OnMouseEvent(wxMouseEvent& event);
public:
wxView *view;
- MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style);
+ MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style);
};
class DrawingView: public wxView
{
public:
- wxFrame *frame;
+ wxMDIChildFrame *frame;
MyCanvas *canvas;
- DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; }
+ DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxMDIChildFrame *) NULL; }
~DrawingView() {}
bool OnCreate(wxDocument *doc, long flags);
class TextEditView: public wxView
{
public:
- wxFrame *frame;
+ wxMDIChildFrame *frame;
MyTextWindow *textsw;
- TextEditView(): wxView() { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
+ TextEditView(): wxView() { frame = (wxMDIChildFrame *) NULL; textsw = (MyTextWindow *) NULL; }
~TextEditView() {}
bool OnCreate(wxDocument *doc, long flags);
subframe->Show(TRUE);
}
-void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
+void MyFrame::OnSize(wxSizeEvent& event)
{
int w, h;
GetClientSize(&w, &h);
textWindow->SetSize(0, 0, 200, h);
GetClientWindow()->SetSize(200, 0, w - 200, h);
+
+ event.Skip();
}
void MyFrame::InitToolBar(wxToolBar* toolBar)
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
joyInfo.dwFlags = JOY_RETURNPOV;
+ joyInfo.dwSize = sizeof(joyInfo);
MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
if (res == JOYERR_NOERROR )
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
joyInfo.dwFlags = JOY_RETURNPOVCTS;
+ joyInfo.dwSize = sizeof(joyInfo);
MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
if (res == JOYERR_NOERROR )
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
joyInfo.dwFlags = JOY_RETURNR;
+ joyInfo.dwSize = sizeof(joyInfo);
MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
if (res == JOYERR_NOERROR )
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
joyInfo.dwFlags = JOY_RETURNU;
+ joyInfo.dwSize = sizeof(joyInfo);
MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
if (res == JOYERR_NOERROR )
{
#ifndef NO_JOYGETPOSEX
JOYINFOEX joyInfo;
joyInfo.dwFlags = JOY_RETURNV;
+ joyInfo.dwSize = sizeof(joyInfo);
MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
if (res == JOYERR_NOERROR )
{
#include "wx/log.h"
#endif
+#if wxUSE_MDI_ARCHITECTURE && !defined(__WXUNIVERSAL__)
+
#include "wx/mdi.h"
#include "wx/msw/private.h"
*hwndDeact = (WXHWND)HIWORD(lParam);
#endif // Win32/Win16
}
+
+#endif
+// wxUSE_MDI_ARCHITECTURE && !defined(__WXUNIVERSAL__)
+
# End Source File
# Begin Source File
+SOURCE=.\generic\mdig.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\generic\msgdlgg.cpp
# End Source File
# Begin Source File
generic/laywin.cpp \
generic/listctrl.cpp \
generic/logg.cpp \
+ generic/mdig.cpp \
generic/msgdlgg.cpp \
generic/numdlgg.cpp \
generic/panelg.cpp \
generic/imaglist.h \
generic/laywin.h \
generic/listctrl.h \
+ generic/mdig.h \
generic/msgdlgg.h \
generic/notebook.h \
generic/paletteg.h \
laywin.o \
listctrl.o \
logg.o \
+ mdig.o \
msgdlgg.o \
numdlgg.o \
panelg.o \