Add wxWindow::CreateUsingMSWClass() helper function
This method allows to use the Windows class to use for the window being created instead of always using "wxWindow" or "wxWindowNR". This can be useful to make it possible to handle some windows specially from outside the application, e.g. use specific class names for accessibility purposes as will be done by the next commit.
This commit is contained in:
@@ -48,6 +48,22 @@ public:
|
|||||||
virtual ~wxWindowMSW();
|
virtual ~wxWindowMSW();
|
||||||
|
|
||||||
bool Create(wxWindow *parent,
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr)
|
||||||
|
{
|
||||||
|
return CreateUsingMSWClass(GetMSWClassName(),
|
||||||
|
parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Non-portable, MSW-specific Create() variant allowing to create the
|
||||||
|
// window with a custom Windows class name. This can be useful to assign a
|
||||||
|
// custom Windows class, that can be recognized from the outside of the
|
||||||
|
// application, for windows of specific type.
|
||||||
|
bool CreateUsingMSWClass(const wxChar* classname,
|
||||||
|
wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
|
@@ -481,7 +481,8 @@ const wxChar *wxWindowMSW::GetMSWClassName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// real construction (Init() must have been called before!)
|
// real construction (Init() must have been called before!)
|
||||||
bool wxWindowMSW::Create(wxWindow *parent,
|
bool wxWindowMSW::CreateUsingMSWClass(const wxChar* classname,
|
||||||
|
wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
@@ -512,7 +513,7 @@ bool wxWindowMSW::Create(wxWindow *parent,
|
|||||||
msflags |= WS_VISIBLE;
|
msflags |= WS_VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !MSWCreate(GetMSWClassName(), NULL, pos, size, msflags, exstyle) )
|
if ( !MSWCreate(classname, NULL, pos, size, msflags, exstyle) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
InheritAttributes();
|
InheritAttributes();
|
||||||
|
Reference in New Issue
Block a user