// headers
// ---------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "mdi.h"
#endif
#pragma hdrstop
#endif
+#if wxUSE_MDI_ARCHITECTURE && !defined(__WXUNIVERSAL__)
+
#ifndef WX_PRECOMP
#include "wx/setup.h"
#include "wx/frame.h"
#include "wx/log.h"
#endif
-#if wxUSE_MDI_ARCHITECTURE && !defined(__WXUNIVERSAL__)
-
#include "wx/mdi.h"
#include "wx/msw/private.h"
extern const wxChar *wxMDIFrameClassName; // from app.cpp
extern const wxChar *wxMDIChildFrameClassName;
extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
-#ifdef __DIGITALMARS__
-extern "C" void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
-#else
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
-#endif
extern void wxRemoveHandleAssociation(wxWindow *win);
static HWND invalidHandle = 0;
wxMDIParentFrame::~wxMDIParentFrame()
{
- DestroyChildren();
-
- // already delete by DestroyChildren()
+ // see comment in ~wxMDIChildFrame
m_frameToolBar = NULL;
m_frameStatusBar = NULL;
+ DestroyChildren();
+
if (m_windowMenu)
{
delete m_windowMenu;
WXHICON wxMDIParentFrame::GetDefaultIcon() const
{
- return (WXHICON)(wxSTD_MDIPARENTFRAME_ICON ? wxSTD_MDIPARENTFRAME_ICON
- : wxDEFAULT_MDIPARENTFRAME_ICON);
+ // we don't have any standard icons (any more)
+ return (WXHICON)0;
}
// ---------------------------------------------------------------------------
if ( IsMdiCommandId(id) )
{
- wxWindowList::Node *node = GetChildren().GetFirst();
+ wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
while ( node )
{
wxWindow *child = node->GetData();
MDICREATESTRUCT mcs;
- mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE
- ? wxMDIChildFrameClassNameNoRedraw
- : wxMDIChildFrameClassName;
+ mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE
+ ? wxMDIChildFrameClassName
+ : wxMDIChildFrameClassNameNoRedraw;
mcs.szTitle = title;
mcs.hOwner = wxGetInstance();
if (x > -1)
else
mcs.cy = CW_USEDEFAULT;
- DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_THICKFRAME | WS_VISIBLE ;
+ DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_VISIBLE ;
if (style & wxMINIMIZE_BOX)
msflags |= WS_MINIMIZEBOX;
if (style & wxMAXIMIZE_BOX)
wxMDIChildFrame::~wxMDIChildFrame()
{
- DestroyChildren();
-
- // already deleted by DestroyChildren()
+ // will be destroyed by DestroyChildren() but reset them before calling it
+ // to avoid using dangling pointers if a callback comes in the meanwhile
m_frameToolBar = NULL;
m_frameStatusBar = NULL;
+ DestroyChildren();
+
RemoveWindowMenu(NULL, m_hMenu);
MSWDestroyWindow();
WXHICON wxMDIChildFrame::GetDefaultIcon() const
{
- return (WXHICON)(wxSTD_MDICHILDFRAME_ICON ? wxSTD_MDICHILDFRAME_ICON
- : wxDEFAULT_MDICHILDFRAME_ICON);
+ // we don't have any standard icons (any more)
+ return (WXHICON)0;
}
// ---------------------------------------------------------------------------
processed = true;
}
- return true;
+ return processed;
}
// ---------------------------------------------------------------------------
{
if (GetParent())
{
- wxWindowList::Node *node = GetParent()->GetChildren().GetFirst();
+ wxWindowList::compatibility_iterator node = GetParent()->GetChildren().GetFirst();
while (node)
{
wxWindow *child = node->GetData();