Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / edit_ps_light.cpp
blobc50e8a069143d36cfb5bb38374b997fb6a24e197
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 // edit_ps_light.cpp : implementation file
20 #include "std_afx.h"
21 #include "object_viewer.h"
22 #include "edit_ps_light.h"
23 #include "attrib_dlg.h"
26 /////////////////////////////////////////////////////////////////////////////
27 // CEditPSLight dialog
30 //***************************************************************************************
31 CEditPSLight::CEditPSLight(CParticleWorkspace::CNode *ownerNode, NL3D::CPSLight *light)
32 : _Node(ownerNode),
33 _ColorDlg(NULL),
34 _AttenStartDlg(NULL),
35 _AttenEndDlg(NULL)
37 //{{AFX_DATA_INIT(CEditPSLight)
38 // NOTE: the ClassWizard will add member initialization here
39 //}}AFX_DATA_INIT
40 nlassert(light);
41 _Light = light;
44 //***************************************************************************************
45 CEditPSLight::~CEditPSLight()
47 if (_ColorDlg)
49 _ColorDlg->DestroyWindow();
50 delete _ColorDlg;
52 if (_AttenStartDlg)
54 _AttenStartDlg->DestroyWindow();
55 delete _AttenStartDlg;
57 if (_AttenEndDlg)
59 _AttenEndDlg->DestroyWindow();
60 delete _AttenEndDlg;
65 //***************************************************************************************
66 void CEditPSLight::DoDataExchange(CDataExchange* pDX)
68 CDialog::DoDataExchange(pDX);
69 //{{AFX_DATA_MAP(CEditPSLight)
70 // NOTE: the ClassWizard will add DDX and DDV calls here
71 //}}AFX_DATA_MAP
74 //***************************************************************************************
75 void CEditPSLight::init(CWnd* pParent /*=NULL*/)
77 Create(IDD_PS_LIGHT, pParent);
78 nlassert(_Light);
80 RECT r;
81 HBITMAP bmh;
83 _ColorDlg = new CAttribDlgRGBA("LIGHT_COLOR", _Node);
84 _ColorWrapper.L = _Light;
85 _ColorDlg->setWrapper(&_ColorWrapper);
86 _ColorDlg->setSchemeWrapper(&_ColorWrapper);
87 GetDlgItem(IDC_COLOR_PLACEHOLDER)->GetWindowRect(&r);
88 ScreenToClient(&r);
89 bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PARTICLE_COLOR));
90 _ColorDlg->init(bmh, r.left, r.top, this);
92 _AttenStartDlg = new CAttribDlgFloat("LIGHT_ATTEN_START", _Node, 0.01f, 5.f);
93 _AttenStartDlg->enableLowerBound(0.01f, true);
94 _AttenStartWrapper.L = _Light;
95 _AttenStartDlg->setWrapper(&_AttenStartWrapper);
96 _AttenStartDlg->setSchemeWrapper(&_AttenStartWrapper);
97 GetDlgItem(IDC_ATTEN_START_PLACEHOLDER)->GetWindowRect(&r);
98 ScreenToClient(&r);
99 bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_LIGHT_ATTEN_START));
100 _AttenStartDlg->init(bmh, r.left, r.top, this);
102 _AttenEndDlg = new CAttribDlgFloat("LIGHT_ATTEN_END", _Node, 0.01f, 5.f);
103 _AttenEndDlg->enableLowerBound(0.01f, true);
104 _AttenEndWrapper.L = _Light;
105 _AttenEndDlg->setWrapper(&_AttenEndWrapper);
106 _AttenEndDlg->setSchemeWrapper(&_AttenEndWrapper);
107 GetDlgItem(IDC_ATTEN_END_PLACEHOLDER)->GetWindowRect(&r);
108 ScreenToClient(&r);
109 bmh = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_LIGHT_ATTEN_END));
110 _AttenEndDlg->init(bmh, r.left, r.top, this);
112 ShowWindow(SW_SHOW);
113 UpdateData(FALSE);
118 BEGIN_MESSAGE_MAP(CEditPSLight, CDialog)
119 //{{AFX_MSG_MAP(CEditPSLight)
120 // NOTE: the ClassWizard will add message map macros here
121 //}}AFX_MSG_MAP
122 END_MESSAGE_MAP()
124 /////////////////////////////////////////////////////////////////////////////
125 // CEditPSLight message handlers