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
This commit is contained in:
@@ -681,6 +681,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
|
|||||||
*/
|
*/
|
||||||
#define wxPG_DATE_PICKER_STYLE wxS("PickerStyle")
|
#define wxPG_DATE_PICKER_STYLE wxS("PickerStyle")
|
||||||
|
|
||||||
|
#if wxUSE_SPINBTN
|
||||||
/** SpinCtrl editor, int or double. How much number changes when button is
|
/** SpinCtrl editor, int or double. How much number changes when button is
|
||||||
pressed (or up/down on keyboard).
|
pressed (or up/down on keyboard).
|
||||||
*/
|
*/
|
||||||
@@ -690,6 +691,12 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000
|
|||||||
*/
|
*/
|
||||||
#define wxPG_ATTR_SPINCTRL_WRAP wxS("Wrap")
|
#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.
|
wxMultiChoiceProperty, int.
|
||||||
If 0, no user strings allowed. If 1, user strings appear before list
|
If 0, no user strings allowed. If 1, user strings appear before list
|
||||||
|
@@ -258,7 +258,7 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP
|
|||||||
wxSpinButton* wnd2;
|
wxSpinButton* wnd2;
|
||||||
|
|
||||||
#if IS_MOTION_SPIN_SUPPORTED
|
#if IS_MOTION_SPIN_SUPPORTED
|
||||||
if ( property->GetAttributeAsLong(wxT("MotionSpin"), 0) )
|
if ( property->GetAttributeAsLong(wxPG_ATTR_SPINCTRL_MOTION, 0) )
|
||||||
{
|
{
|
||||||
wnd2 = new wxPGSpinButton();
|
wnd2 = new wxPGSpinButton();
|
||||||
}
|
}
|
||||||
@@ -319,7 +319,7 @@ bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* proper
|
|||||||
if ( evtType == wxEVT_SCROLL_LINEUP || evtType == wxEVT_SCROLL_LINEDOWN )
|
if ( evtType == wxEVT_SCROLL_LINEUP || evtType == wxEVT_SCROLL_LINEDOWN )
|
||||||
{
|
{
|
||||||
#if IS_MOTION_SPIN_SUPPORTED
|
#if IS_MOTION_SPIN_SUPPORTED
|
||||||
if ( property->GetAttributeAsLong(wxT("MotionSpin"), 0) )
|
if ( property->GetAttributeAsLong(wxPG_ATTR_SPINCTRL_MOTION, 0) )
|
||||||
{
|
{
|
||||||
wxPGSpinButton* spinButton =
|
wxPGSpinButton* spinButton =
|
||||||
(wxPGSpinButton*) propgrid->GetEditorControlSecondary();
|
(wxPGSpinButton*) propgrid->GetEditorControlSecondary();
|
||||||
|
Reference in New Issue
Block a user