Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / main_dlg.cpp
blob5c0f4c206616341b0e3134d2a0cd49d84c5c291b
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 "main_dlg.h"
20 #include "nel/3d/channel_mixer.h"
22 using namespace NLMISC;
23 using namespace NL3D;
25 /////////////////////////////////////////////////////////////////////////////
26 // CMainDlg dialog
29 CMainDlg::CMainDlg(CObjectViewer* main, CWnd* pParent /*=NULL*/)
30 : CDialog(CMainDlg::IDD, pParent)
32 //{{AFX_DATA_INIT(CMainDlg)
33 // NOTE: the ClassWizard will add member initialization here
34 //}}AFX_DATA_INIT
35 Main=main;
39 void CMainDlg::DoDataExchange(CDataExchange* pDX)
41 CDialog::DoDataExchange(pDX);
42 //{{AFX_DATA_MAP(CMainDlg)
43 // NOTE: the ClassWizard will add DDX and DDV calls here
44 //}}AFX_DATA_MAP
48 BEGIN_MESSAGE_MAP(CMainDlg, CDialog)
49 //{{AFX_MSG_MAP(CMainDlg)
50 ON_WM_DESTROY()
51 ON_WM_CREATE()
52 //}}AFX_MSG_MAP
53 END_MESSAGE_MAP()
55 /////////////////////////////////////////////////////////////////////////////
56 // CMainDlg message handlers
58 BOOL CMainDlg::OnInitDialog()
60 CDialog::OnInitDialog();
62 // Get size
63 RECT rect;
65 // Init Slots
66 for (uint s=0; s<CChannelMixer::NumAnimationSlot; s++)
68 // Init the slot s
69 BOOL initialized=Slots[s].Create (IDD_SLOT, this);
71 // Position
72 Slots[s].init (s, Main);
73 Slots[s].GetClientRect (&rect);
74 Slots[s].SetWindowPos( NULL, 0, s*(rect.bottom-rect.top), 0, 0, SWP_NOSIZE|SWP_NOOWNERZORDER|SWP_NOZORDER|SWP_SHOWWINDOW);
77 // Resize the main window
78 RECT client;
79 RECT window;
80 GetClientRect (&client);
81 GetWindowRect (&window);
82 SetWindowPos( NULL, 0, 0, rect.right-rect.left+window.right-window.left-client.right+client.left,
83 NL3D::CChannelMixer::NumAnimationSlot*(rect.bottom-rect.top)+window.bottom-window.top-client.bottom+client.top,
84 SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER);
86 return TRUE; // return TRUE unless you set the focus to a control
87 // EXCEPTION: OCX Property Pages should return FALSE
90 void CMainDlg::setAnimTime (float animStart, float animEnd)
92 // Init Slots
93 for (uint s=0; s<CChannelMixer::NumAnimationSlot; s++)
94 Slots[s].setAnimTime (animStart, animEnd);
97 void CMainDlg::OnDestroy()
99 setRegisterWindowState (this, REGKEY_OBJ_VIEW_SLOT_DLG);
101 CDialog::OnDestroy();
103 // TODO: Add your message handler code here
107 int CMainDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
109 lpCreateStruct->style&=~WS_VISIBLE;
110 if (CDialog::OnCreate(lpCreateStruct) == -1)
111 return -1;
113 // TODO: Add your specialized creation code here
115 return 0;
118 void CMainDlg::refresh (BOOL update)
120 for (uint s=0; s<CChannelMixer::NumAnimationSlot; s++)
121 Slots[s].refresh (update);