1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // range_selector.cpp : implementation file
22 #include "object_viewer.h"
23 #include "range_selector.h"
24 #include "editable_range.h"
27 /////////////////////////////////////////////////////////////////////////////
28 // CRangeSelector dialog
31 CRangeSelector::CRangeSelector(const CString
&lowerBound
, const CString
&upperBound
, CEditableRange
*er
, CWnd
* pParent
)
32 : CDialog(CRangeSelector::IDD
, pParent
), _EditableRange(er
)
34 //{{AFX_DATA_INIT(CRangeSelector)
35 m_LowerBound
= lowerBound
;
36 m_UpperBound
= upperBound
;
41 void CRangeSelector::DoDataExchange(CDataExchange
* pDX
)
43 CDialog::DoDataExchange(pDX
);
44 //{{AFX_DATA_MAP(CRangeSelector)
45 DDX_Control(pDX
, IDC_UPPER_BOUND
, m_UpperBoundCtrl
);
46 DDX_Control(pDX
, IDC_LOWER_BOUND
, m_LowerBoundCtrl
);
47 DDX_Text(pDX
, IDC_LOWER_BOUND
, m_LowerBound
);
48 DDX_Text(pDX
, IDC_UPPER_BOUND
, m_UpperBound
);
53 BEGIN_MESSAGE_MAP(CRangeSelector
, CDialog
)
54 //{{AFX_MSG_MAP(CRangeSelector)
55 ON_EN_SETFOCUS(IDC_LOWER_BOUND
, OnSetfocusLowerBound
)
56 ON_EN_SETFOCUS(IDC_UPPER_BOUND
, OnSetfocusUpperBound
)
60 /////////////////////////////////////////////////////////////////////////////
61 // CRangeSelector message handlers
63 void CRangeSelector::OnOK()
66 if (_EditableRange
->editableRangeValueValidator(m_LowerBound
, m_UpperBound
))
72 void CRangeSelector::OnSetfocusLowerBound()
75 m_LowerBoundCtrl
.PostMessage(EM_SETSEL
, 0, -1) ;
76 m_LowerBoundCtrl
.Invalidate() ;
79 void CRangeSelector::OnSetfocusUpperBound()
81 m_UpperBoundCtrl
.PostMessage(EM_SETSEL
, 0, -1) ;
82 m_UpperBoundCtrl
.Invalidate() ;
85 BOOL
CRangeSelector::OnInitDialog()
87 CDialog::OnInitDialog();
89 m_LowerBoundCtrl
.PostMessage(EM_SETSEL
, 0, -1) ;
90 m_LowerBoundCtrl
.Invalidate() ;
92 return TRUE
; // return TRUE unless you set the focus to a control
93 // EXCEPTION: OCX Property Pages should return FALSE