Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / edit_spinner.cpp
blob20fbc51d8586b039a8ce3a1468997f55bf4ef538
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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/>.
17 #include "std_afx.h"
18 #include "object_viewer.h"
19 #include "edit_spinner.h"
20 #include "direction_attr.h"
21 #include "editable_range.h"
22 #include "popup_notify.h"
26 /////////////////////////////////////////////////////////////////////////////
27 // CEditSpinner dialog
30 CEditSpinner::CEditSpinner(NL3D::CPSBasisSpinner *sf, CParticleWorkspace::CNode *ownerNode, CWnd *pParent, IPopupNotify *pn)
31 : CDialog(CEditSpinner::IDD, pParent),
32 _Node(ownerNode),
33 _DirDlg(NULL),
34 _NbSamplesDlg(NULL),
35 _Spinner(sf),
36 _PN(pn)
38 //{{AFX_DATA_INIT(CEditSpinner)
39 // NOTE: the ClassWizard will add member initialization here
40 //}}AFX_DATA_INIT
43 CEditSpinner::~CEditSpinner()
45 if (_DirDlg) { _DirDlg->DestroyWindow(); delete _DirDlg; }
46 if (_NbSamplesDlg) { _NbSamplesDlg->DestroyWindow(); delete _NbSamplesDlg; }
49 void CEditSpinner::init(CWnd *pParent)
51 CDialog::Create(IDD_EDITSPINNER, pParent);
52 ShowWindow(SW_SHOW);
55 void CEditSpinner::DoDataExchange(CDataExchange* pDX)
57 CDialog::DoDataExchange(pDX);
58 //{{AFX_DATA_MAP(CEditSpinner)
59 // NOTE: the ClassWizard will add DDX and DDV calls here
60 //}}AFX_DATA_MAP
64 BEGIN_MESSAGE_MAP(CEditSpinner, CDialog)
65 //{{AFX_MSG_MAP(CEditSpinner)
66 ON_WM_CLOSE()
67 //}}AFX_MSG_MAP
68 END_MESSAGE_MAP()
70 /////////////////////////////////////////////////////////////////////////////
71 // CEditSpinner message handlers
73 BOOL CEditSpinner::OnInitDialog()
75 CDialog::OnInitDialog();
76 _NbSampleWrapper.S = _Spinner;
77 _AxisWrapper.S = _Spinner;
79 _DirDlg = new CDirectionAttr(std::string("SPINNER DIR"));
80 _DirDlg->setWrapper(&_AxisWrapper);
81 _AxisWrapper.OwnerNode = _Node;
82 _DirDlg->init(10, 10, this);
84 _NbSamplesDlg = new CEditableRangeUInt("SPINNER NB SAMPLES", _Node, 1, 512);
85 _NbSamplesDlg->enableLowerBound(0, true); // 0 not allowed
86 _NbSamplesDlg->setWrapper(&_NbSampleWrapper);
87 _NbSamplesDlg->init(60, 50, this);
89 return TRUE; // return TRUE unless you set the focus to a control
90 // EXCEPTION: OCX Property Pages should return FALSE
93 void CEditSpinner::OnClose()
95 CDialog::OnClose();
96 if (_PN) _PN->childPopupClosed(this);