From 3100258aa1ddb781f5cb2f0f943eb90f7f7b6fc3 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 21 Jan 2015 16:59:46 +0000 Subject: [PATCH] Refactor wxPGSpinCtrlEditor. Declare and use attribute constant instead of explicit string "MotionSpin". git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/propgrid/property.h | 7 +++++++ src/propgrid/advprops.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 7a34885a6d..d2657810e1 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -681,6 +681,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 */ #define wxPG_DATE_PICKER_STYLE wxS("PickerStyle") +#if wxUSE_SPINBTN /** SpinCtrl editor, int or double. How much number changes when button is pressed (or up/down on keyboard). */ @@ -690,6 +691,12 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 */ #define wxPG_ATTR_SPINCTRL_WRAP wxS("Wrap") +/** SpinCtrl editor, bool. If true, moving mouse when one of the spin + buttons is depressed rapidly changing "spin" value. +*/ +#define wxPG_ATTR_SPINCTRL_MOTION wxS("MotionSpin") +#endif // wxUSE_SPINBTN + /** wxMultiChoiceProperty, int. If 0, no user strings allowed. If 1, user strings appear before list diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 4f39b4a780..d7216abfe1 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -258,7 +258,7 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP wxSpinButton* wnd2; #if IS_MOTION_SPIN_SUPPORTED - if ( property->GetAttributeAsLong(wxT("MotionSpin"), 0) ) + if ( property->GetAttributeAsLong(wxPG_ATTR_SPINCTRL_MOTION, 0) ) { wnd2 = new wxPGSpinButton(); } @@ -319,7 +319,7 @@ bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* proper if ( evtType == wxEVT_SCROLL_LINEUP || evtType == wxEVT_SCROLL_LINEDOWN ) { #if IS_MOTION_SPIN_SUPPORTED - if ( property->GetAttributeAsLong(wxT("MotionSpin"), 0) ) + if ( property->GetAttributeAsLong(wxPG_ATTR_SPINCTRL_MOTION, 0) ) { wxPGSpinButton* spinButton = (wxPGSpinButton*) propgrid->GetEditorControlSecondary();