cleanup the Win32 window classes registration code: remove global variables and register the window classes we use on demand to avoid registering MDI or GL classes unnecessarily

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-29 22:19:55 +00:00
parent 12b661cd1e
commit d9698bd4ac
7 changed files with 157 additions and 281 deletions

View File

@@ -52,9 +52,6 @@
extern wxMenu *wxCurrentPopupMenu;
extern const wxChar *wxMDIFrameClassName; // from app.cpp
extern const wxChar *wxMDIChildFrameClassName;
extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
extern void wxRemoveHandleAssociation(wxWindow *win);
// ---------------------------------------------------------------------------
@@ -188,7 +185,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
msflags &= ~WS_VSCROLL;
msflags &= ~WS_HSCROLL;
if ( !wxWindow::MSWCreate(wxMDIFrameClassName,
if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(_T("wxMDIFrame")),
title.wx_str(),
pos, size,
msflags,
@@ -736,9 +733,12 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
MDICREATESTRUCT mcs;
mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE
? wxMDIChildFrameClassName
: wxMDIChildFrameClassNameNoRedraw;
wxString className =
wxApp::GetRegisteredClassName(_T("wxMDIChildFrame"), COLOR_WINDOW);
if ( !(style & wxFULL_REPAINT_ON_RESIZE) )
className += wxApp::GetNoRedrawClassSuffix();
mcs.szClass = className.wx_str();
mcs.szTitle = title.wx_str();
mcs.hOwner = wxGetInstance();
if (x != wxDefaultCoord)