Use symbolic constants instead of numeric ones to represent masks filtering window style flags in wxPG.

This commit is contained in:
Artur Wieczorek 2015-05-23 18:25:27 +02:00
parent 5c3fbc6e4d
commit 204a3d229c
3 changed files with 19 additions and 6 deletions

View File

@ -229,7 +229,14 @@ wxPG_DESCRIPTION = 0x00002000,
/** wxPropertyGridManager only: don't show an internal border around the
property grid. Recommended if you use a header.
*/
wxPG_NO_INTERNAL_BORDER = 0x00004000
wxPG_NO_INTERNAL_BORDER = 0x00004000,
/** A mask which can be used to filter (out) all styles.
*/
wxPG_WINDOW_STYLE_MASK = wxPG_AUTO_SORT|wxPG_HIDE_CATEGORIES|wxPG_BOLD_MODIFIED|
wxPG_SPLITTER_AUTO_CENTER|wxPG_TOOLTIPS|wxPG_HIDE_MARGIN|
wxPG_STATIC_SPLITTER|wxPG_LIMITED_EDITING|wxPG_TOOLBAR|
wxPG_DESCRIPTION|wxPG_NO_INTERNAL_BORDER
};
#if wxPG_COMPATIBILITY_1_4
@ -344,7 +351,11 @@ wxPG_EX_ALWAYS_ALLOW_FOCUS = 0x00100000,
/** A mask which can be used to filter (out) all extra styles.
*/
wxPG_EX_WINDOW_STYLE_MASK = 0x1FFFF000
wxPG_EX_WINDOW_STYLE_MASK = wxPG_EX_INIT_NOCAT|wxPG_EX_NO_FLAT_TOOLBAR|wxPG_EX_MODE_BUTTONS|
wxPG_EX_HELP_AS_TOOLTIPS|wxPG_EX_NATIVE_DOUBLE_BUFFERING|wxPG_EX_AUTO_UNSPECIFIED_VALUES|
wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES|wxPG_EX_HIDE_PAGE_BUTTONS|wxPG_EX_MULTIPLE_SELECTION|
wxPG_EX_ENABLE_TLP_TRACKING|wxPG_EX_NO_TOOLBAR_DIVIDER|wxPG_EX_TOOLBAR_SEPARATOR|
wxPG_EX_ALWAYS_ALLOW_FOCUS
};
#if wxPG_COMPATIBILITY_1_4

View File

@ -457,7 +457,7 @@ bool wxPropertyGridManager::Create( wxWindow *parent,
m_pPropGrid = CreatePropertyGrid();
bool res = wxPanel::Create( parent, id, pos, size,
(style&0xFFFF0000)|wxWANTS_CHARS,
(style & wxWINDOW_STYLE_MASK)|wxWANTS_CHARS,
name );
Init2(style);
@ -515,7 +515,7 @@ void wxPropertyGridManager::Init1()
wxCLIP_CHILDREN)
// Which flags can be passed to underlying wxPropertyGrid.
#define wxPG_MAN_PASS_FLAGS_MASK (0xFFF0|wxTAB_TRAVERSAL)
#define wxPG_MAN_PASS_FLAGS_MASK (wxPG_WINDOW_STYLE_MASK|wxTAB_TRAVERSAL)
//
// Initialize after parent etc. set
@ -526,7 +526,7 @@ void wxPropertyGridManager::Init2( int style )
if ( m_iFlags & wxPG_FL_INITIALIZED )
return;
m_windowStyle |= (style&0x0000FFFF);
m_windowStyle |= (style & wxPG_WINDOW_STYLE_MASK);
wxSize csz = GetClientSize();

View File

@ -327,10 +327,12 @@ bool wxPropertyGrid::Create( wxWindow *parent,
style |= wxWANTS_CHARS;
wxControl::Create(parent, id, pos, size,
style | wxScrolledWindowStyle,
(style & wxWINDOW_STYLE_MASK) | wxScrolledWindowStyle,
wxDefaultValidator,
name);
m_windowStyle |= (style & wxPG_WINDOW_STYLE_MASK);
Init2();
return true;