Revert MSW window classes uniquification patch.
Making the class names unique doesn't seem to be necessary so revert the patch which appended unique pointer value to their names (r57030). See #9031. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -121,13 +121,17 @@ extern void wxSetKeyboardHook(bool doIt);
|
|||||||
// see http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/110282
|
// see http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/110282
|
||||||
struct ClassRegInfo
|
struct ClassRegInfo
|
||||||
{
|
{
|
||||||
// the base name of the class: this is used to construct the unique name in
|
ClassRegInfo(const wxChar *name)
|
||||||
// wxApp::GetRegisteredClassName()
|
: regname(name),
|
||||||
wxString basename;
|
regnameNR(regname + wxApp::GetNoRedrawClassSuffix())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// the name of the registered class with and without CS_[HV]REDRAW styles
|
// the name of the registered class with and without CS_[HV]REDRAW styles
|
||||||
wxString regname,
|
const wxString regname;
|
||||||
regnameNR;
|
const wxString regnameNR;
|
||||||
|
|
||||||
|
wxDECLARE_NO_ASSIGN_CLASS(ClassRegInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@@ -650,7 +654,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
|
|||||||
const size_t count = gs_regClassesInfo.size();
|
const size_t count = gs_regClassesInfo.size();
|
||||||
for ( size_t n = 0; n < count; n++ )
|
for ( size_t n = 0; n < count; n++ )
|
||||||
{
|
{
|
||||||
if ( gs_regClassesInfo[n].basename == name )
|
if ( gs_regClassesInfo[n].regname == name )
|
||||||
return gs_regClassesInfo[n].regname.c_str();
|
return gs_regClassesInfo[n].regname.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -665,16 +669,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
|
|||||||
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles;
|
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | extraStyles;
|
||||||
|
|
||||||
|
|
||||||
ClassRegInfo regClass;
|
ClassRegInfo regClass(name);
|
||||||
regClass.basename = name;
|
|
||||||
|
|
||||||
// constuct a unique suffix to allow registering the class with the same
|
|
||||||
// base name in a main application using wxWidgets and a DLL using
|
|
||||||
// wxWidgets loaded into its address space: as gs_regClassesInfo variable
|
|
||||||
// is different in them, we're going to obtain a unique prefix by using its
|
|
||||||
// address here
|
|
||||||
regClass.regname = regClass.basename +
|
|
||||||
wxString::Format(wxT("@%p"), &gs_regClassesInfo);
|
|
||||||
wndclass.lpszClassName = regClass.regname.wx_str();
|
wndclass.lpszClassName = regClass.regname.wx_str();
|
||||||
if ( !::RegisterClass(&wndclass) )
|
if ( !::RegisterClass(&wndclass) )
|
||||||
{
|
{
|
||||||
@@ -683,10 +678,6 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NB: remember that code elsewhere supposes that no redraw class names
|
|
||||||
// use the same names as normal classes with "NR" suffix so we must put
|
|
||||||
// "NR" at the end instead of using more natural basename+"NR"+suffix
|
|
||||||
regClass.regnameNR = regClass.regname + GetNoRedrawClassSuffix();
|
|
||||||
wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
|
wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
|
||||||
wndclass.lpszClassName = regClass.regnameNR.wx_str();
|
wndclass.lpszClassName = regClass.regnameNR.wx_str();
|
||||||
if ( !::RegisterClass(&wndclass) )
|
if ( !::RegisterClass(&wndclass) )
|
||||||
|
Reference in New Issue
Block a user