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 #include "object_viewer.h"
20 #include "nel/3d/channel_mixer.h"
22 using namespace NLMISC
;
25 /////////////////////////////////////////////////////////////////////////////
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
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
48 BEGIN_MESSAGE_MAP(CMainDlg
, CDialog
)
49 //{{AFX_MSG_MAP(CMainDlg)
55 /////////////////////////////////////////////////////////////////////////////
56 // CMainDlg message handlers
58 BOOL
CMainDlg::OnInitDialog()
60 CDialog::OnInitDialog();
66 for (uint s
=0; s
<CChannelMixer::NumAnimationSlot
; s
++)
69 BOOL initialized
=Slots
[s
].Create (IDD_SLOT
, this);
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
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
)
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)
113 // TODO: Add your specialized creation code here
118 void CMainDlg::refresh (BOOL update
)
120 for (uint s
=0; s
<CChannelMixer::NumAnimationSlot
; s
++)
121 Slots
[s
].refresh (update
);