Refactor code finding the name of the windows class to use in wxMSW

Determine which class name to use in MSWCreate() caller instead of doing it
partly there and partly in MSWCreate() itself, which used to add the "NR"
suffix if necessary -- now it doesn't do this any more and just really created
the window using the given class.

No real changes, just prepare for future enhancements.
This commit is contained in:
Vadim Zeitlin
2016-12-18 22:04:06 +01:00
parent aac66ea877
commit 097f8a7f14
5 changed files with 41 additions and 24 deletions

View File

@@ -53,6 +53,16 @@ public:
// variant registered without CS_[HV]REDRAW styles
static const wxChar *GetNoRedrawClassSuffix() { return wxT("NR"); }
// Flags for GetRegisteredClassName()
enum
{
// Just a symbolic name indicating absence of any special flags.
RegClass_Default = 0,
// Return the name with the GetNoRedrawClassSuffix() appended to it.
RegClass_ReturnNR = 1
};
// get the name of the registered Win32 class with the given (unique) base
// name: this function constructs the unique class name using this name as
// prefix, checks if the class is already registered and registers it if it
@@ -68,7 +78,8 @@ public:
// or (default) -1 meaning that the class paints its background itself
static const wxChar *GetRegisteredClassName(const wxChar *name,
int bgBrushCol = -1,
int extraStyles = 0);
int extraStyles = 0,
int flags = RegClass_Default);
// return true if this name corresponds to one of the classes we registered
// in the previous GetRegisteredClassName() calls