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/>.
17 // edit_follow_path.cpp : implementation file
21 #include "object_viewer.h"
22 #include "edit_follow_path.h"
23 #include "popup_notify.h"
24 #include "nel/3d/ps_plane_basis_maker.h"
28 /////////////////////////////////////////////////////////////////////////////
29 // CEditFollowPath dialog
32 CEditFollowPath::CEditFollowPath(NL3D::CPSPlaneBasisFollowSpeed
*pbfs
, CParticleWorkspace::CNode
*ownerNode
, CWnd
* pParent
, IPopupNotify
*pn
)
33 : CDialog(CEditFollowPath::IDD
, pParent
), _Node(ownerNode
), _PN(pn
)
37 //{{AFX_DATA_INIT(CEditFollowPath)
38 // NOTE: the ClassWizard will add member initialization here
42 void CEditFollowPath::init(CWnd
*pParent
)
44 CDialog::Create(CEditFollowPath::IDD
, pParent
);
48 void CEditFollowPath::DoDataExchange(CDataExchange
* pDX
)
50 CDialog::DoDataExchange(pDX
);
51 //{{AFX_DATA_MAP(CEditFollowPath)
52 // NOTE: the ClassWizard will add DDX and DDV calls here
57 BEGIN_MESSAGE_MAP(CEditFollowPath
, CDialog
)
58 //{{AFX_MSG_MAP(CEditFollowPath)
60 ON_CBN_SELCHANGE(IDC_PROJECTION_MODE
, OnSelchangeProjectionMode
)
64 /////////////////////////////////////////////////////////////////////////////
65 // CEditFollowPath message handlers
67 BOOL
CEditFollowPath::OnInitDialog()
69 CDialog::OnInitDialog();
70 nlassert(_FollowPath
);
71 ((CComboBox
*) GetDlgItem(IDC_PROJECTION_MODE
))->SetCurSel((int) _FollowPath
->getProjectionPlane());
72 return TRUE
; // return TRUE unless you set the focus to a control
73 // EXCEPTION: OCX Property Pages should return FALSE
77 void CEditFollowPath::OnClose()
80 if (_PN
) _PN
->childPopupClosed(this);
83 void CEditFollowPath::OnSelchangeProjectionMode()
85 nlassert(_FollowPath
);
86 int index
= ((CComboBox
*) GetDlgItem(IDC_PROJECTION_MODE
))->GetCurSel();
87 _FollowPath
->setProjectionPlane((NL3D::CPSPlaneBasisFollowSpeed::TProjectionPlane
) index
);
88 if (_Node
) _Node
->setModified(true);