635 lines
18 KiB
C++
635 lines
18 KiB
C++
/*=========================================================================
|
|
*
|
|
* SECTdMec.cpp : Mechanic Environment dialog - Implementation file
|
|
*
|
|
*
|
|
* Version 1.0
|
|
* Creation date
|
|
* Revision date
|
|
*
|
|
* Shaitan
|
|
*=======================================================================*/
|
|
/*
|
|
#include "stdafx.h"
|
|
#include "acp_base.h"
|
|
#include "SECTint.hpp"
|
|
|
|
#include "SECdMec.hpp"
|
|
|
|
#include "SECmodif.hpp"
|
|
#include "SECdEnv.hpp"
|
|
#include "SEClEnvs.hpp"
|
|
#include "SECdEnvs.hpp"
|
|
#include "SECdSrfs.hpp"
|
|
|
|
#include "..\Main\Inc\_EditID.h"
|
|
#include "TUT.h"
|
|
*/
|
|
|
|
//#################################################################################
|
|
// SECT_DialogMec dialog
|
|
//#################################################################################
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
SECT_DialogMec::SECT_DialogMec(CWnd* pParent)
|
|
: CFormView(SECT_DialogMec::IDD)
|
|
{
|
|
//{{AFX_DATA_INIT(SECT_DialogMec)
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
*/
|
|
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CFormView::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(SECT_DialogMec)
|
|
DDX_Control(pDX, SECT_IDC_MECSAVE, m_cSave);
|
|
DDX_Control(pDX, SECT_IDC_MECCANCEL, m_cCancel);
|
|
|
|
DDX_Control(pDX, SECT_IDC_MECNAME, m_cName);
|
|
DDX_Control(pDX, SECT_IDC_MECDEFAULT, m_cDefault);
|
|
|
|
DDX_Control(pDX, SECT_IDC_GRAVITY, m_cGravity);
|
|
DDX_Control(pDX, SECT_IDC_VERTICALX, m_cVectorX);
|
|
DDX_Control(pDX, SECT_IDC_VERTICALY, m_cVectorY);
|
|
DDX_Control(pDX, SECT_IDC_VERTICALZ, m_cVectorZ);
|
|
|
|
DDX_Control(pDX, SECT_IDC_VISCOSITY, m_cViscosity);
|
|
DDX_Control(pDX, SECT_IDC_DENSITY, m_cDensity);
|
|
DDX_Control(pDX, SECT_IDC_LEVEL, m_cLevel);
|
|
DDX_Control(pDX, SECT_IDC_STREAMX, m_cStreamX);
|
|
DDX_Control(pDX, SECT_IDC_STREAMY, m_cStreamY);
|
|
DDX_Control(pDX, SECT_IDC_STREAMZ, m_cStreamZ);
|
|
|
|
DDX_Control(pDX, SECT_IDC_VOLUMIC, m_cVolumic);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
*/
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
BEGIN_MESSAGE_MAP(SECT_DialogMec, CFormView)
|
|
//{{AFX_MSG_MAP(SECT_DialogMec)
|
|
ON_WM_SIZE()
|
|
ON_WM_DESTROY()
|
|
|
|
ON_BN_CLICKED(SECT_IDC_MECSAVE, OnSave)
|
|
ON_BN_CLICKED(SECT_IDC_MECCANCEL, OnCancel)
|
|
|
|
ON_EN_KILLFOCUS(SECT_IDC_MECNAME, OnChangeName)
|
|
ON_BN_CLICKED(SECT_IDC_MECDEFAULT, OnDefault)
|
|
|
|
ON_EN_KILLFOCUS(SECT_IDC_GRAVITY, OnChangeGravity)
|
|
ON_EN_KILLFOCUS(SECT_IDC_VERTICALX, OnChangeVectorX)
|
|
ON_EN_KILLFOCUS(SECT_IDC_VERTICALY, OnChangeVectorY)
|
|
ON_EN_KILLFOCUS(SECT_IDC_VERTICALZ, OnChangeVectorZ)
|
|
|
|
ON_EN_KILLFOCUS(SECT_IDC_VISCOSITY, OnChangeViscosity)
|
|
ON_EN_KILLFOCUS(SECT_IDC_DENSITY, OnChangeDensity)
|
|
ON_EN_KILLFOCUS(SECT_IDC_LEVEL, OnChangeLevel)
|
|
ON_EN_KILLFOCUS(SECT_IDC_STREAMX, OnChangeStreamX)
|
|
ON_EN_KILLFOCUS(SECT_IDC_STREAMY, OnChangeStreamY)
|
|
ON_EN_KILLFOCUS(SECT_IDC_STREAMZ, OnChangeStreamZ)
|
|
ON_CBN_SELCHANGE(SECT_IDC_VOLUMIC, OnSelChangeComboVolumic)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
*/
|
|
|
|
//#################################################################################
|
|
// SECT_DialogMec Inits
|
|
//#################################################################################
|
|
|
|
/*===========================================================================
|
|
* Description: Init dialog
|
|
* Creation date:
|
|
* Author: Shaitan
|
|
*---------------------------------------------------------------------------
|
|
* Revision date: Author:
|
|
*=========================================================================*/
|
|
/*
|
|
void SECT_DialogMec::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
|
|
{
|
|
// create the dialog
|
|
m_bInitialised = FALSE;
|
|
m_pSectorInterface = p_oDLL;
|
|
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
|
|
|
|
// init data for dialog
|
|
CFormView::UpdateData(FALSE);
|
|
|
|
// FOR TUTORIAL
|
|
TUT_M_vGetTutDll();
|
|
// environment
|
|
TUT_M_vRegisterControl(m_cName.m_hWnd, "OSC_DMEC_EDIT_NAME", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cDefault.m_hWnd, "OSC_DMEC_BUTTON_DEFAULT", TUT_e_Button);
|
|
TUT_M_vRegisterControl(m_cCancel.m_hWnd, "OSC_DMEC_BUTTON_CANCEL", TUT_e_Button);
|
|
TUT_M_vRegisterControl(m_cSave.m_hWnd, "OSC_DMEC_BUTTON_SAVE", TUT_e_Button);
|
|
// gravity
|
|
TUT_M_vRegisterControl(m_cGravity.m_hWnd, "OSC_DMEC_EDIT_GRAVITY", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cVectorX.m_hWnd, "OSC_DMEC_EDIT_VECTORX", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cVectorY.m_hWnd, "OSC_DMEC_EDIT_VECTORY", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cVectorZ.m_hWnd, "OSC_DMEC_EDIT_VECTORZ", TUT_e_TextEdit);
|
|
// fluid
|
|
TUT_M_vRegisterControl(m_cViscosity.m_hWnd, "OSC_DMEC_EDIT_VISCOSITY", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cDensity.m_hWnd, "OSC_DMEC_EDIT_DENSITY", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cLevel.m_hWnd, "OSC_DMEC_EDIT_LEVEL", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cStreamX.m_hWnd, "OSC_DMEC_EDIT_STREAMX", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cStreamY.m_hWnd, "OSC_DMEC_EDIT_STREAMY", TUT_e_TextEdit);
|
|
TUT_M_vRegisterControl(m_cStreamZ.m_hWnd, "OSC_DMEC_EDIT_STREAMZ", TUT_e_TextEdit);
|
|
// volumic environment
|
|
TUT_M_vRegisterControl(m_cVolumic.m_hWnd, "OSC_DMEC_COMBO_VOLUMIC", TUT_e_ComboBox);
|
|
// END TUTORIAL
|
|
|
|
// init volumic combo
|
|
m_cVolumic.ResetContent();
|
|
m_cVolumic.AddString(C_EntryVolumicAir);
|
|
m_cVolumic.AddString(C_EntryVolumicWater);
|
|
m_cVolumic.AddString(C_EntryVolumicLava);
|
|
// init environment values
|
|
m_pDefaultMecEnv = NULL;
|
|
fn_vInitMecEnvironment(NULL, FALSE);
|
|
|
|
m_bInitialised = TRUE;
|
|
}
|
|
*/
|
|
|
|
/*===========================================================================
|
|
* Description: Init default mec env
|
|
* Author: Shaitan
|
|
*---------------------------------------------------------------------------
|
|
* Revision date: Author:
|
|
*=========================================================================*/
|
|
/*
|
|
void SECT_DialogMec::fn_vReinitDialog (void)
|
|
{
|
|
if (!m_pDefaultMecEnv)
|
|
{
|
|
m_pDefaultMecEnv = new SECT_MecEnvironment(m_pSectorInterface, "");
|
|
m_pDefaultMecEnv->fn_bUnValidate();
|
|
m_pDefaultMecEnv->fn_vNotifyUnSave();
|
|
}
|
|
}
|
|
*/
|
|
/*===========================================================================
|
|
* Description: Init all control state
|
|
* Creation date:
|
|
* Author: Shaitan
|
|
*---------------------------------------------------------------------------
|
|
* Revision date: Author:
|
|
*=========================================================================*/
|
|
/*
|
|
void SECT_DialogMec::fn_vInitControls (BOOL bEnable)
|
|
{
|
|
// init button states
|
|
m_cSave.EnableWindow(bEnable);
|
|
m_cCancel.EnableWindow(bEnable);
|
|
|
|
// init name
|
|
m_cName.SetReadOnly(!bEnable);
|
|
m_cDefault.EnableWindow(bEnable);
|
|
// init gravity controls
|
|
m_cGravity.SetReadOnly(!bEnable);
|
|
m_cVectorX.SetReadOnly(!bEnable);
|
|
m_cVectorY.SetReadOnly(!bEnable);
|
|
m_cVectorZ.SetReadOnly(!bEnable);
|
|
// init fluid controls
|
|
m_cDensity.SetReadOnly(!bEnable);
|
|
m_cViscosity.SetReadOnly(!bEnable);
|
|
m_cLevel.SetReadOnly(!bEnable);
|
|
m_cStreamX.SetReadOnly(!bEnable);
|
|
m_cStreamY.SetReadOnly(!bEnable);
|
|
m_cStreamZ.SetReadOnly(!bEnable);
|
|
// init volumic control
|
|
m_cVolumic.EnableWindow(bEnable);
|
|
}
|
|
*/
|
|
/*===========================================================================
|
|
* Description: register initial values
|
|
* Creation date:
|
|
* Author: Shaitan
|
|
*---------------------------------------------------------------------------
|
|
* Revision date: Author:
|
|
*=========================================================================*/
|
|
/*
|
|
void SECT_DialogMec::fn_vInitMecEnvironment (SECT_MecEnvironment *pMecEnv, BOOL bEnable)
|
|
{
|
|
int iInd;
|
|
char szVal[256];
|
|
|
|
// update or create mec env
|
|
if ((!pMecEnv) && bEnable)
|
|
m_pMecEnv = m_pDefaultMecEnv;
|
|
else
|
|
m_pMecEnv = pMecEnv;
|
|
// update all controls
|
|
fn_vInitControls(bEnable);
|
|
|
|
// init name
|
|
m_csName = (m_pMecEnv) ? m_pMecEnv->GetName() : "";
|
|
// init gravity
|
|
m_xGravity = (m_pMecEnv) ? (float) m_pMecEnv->GetGravity() : (float) 0.0;
|
|
m_pVertical = (m_pMecEnv) ? m_pMecEnv->GetVertical() : NULL;
|
|
// init fluid
|
|
m_xViscosity = (m_pMecEnv) ? (float) m_pMecEnv->GetFluidViscosity() : (float) 0.0;
|
|
m_xDensity = (m_pMecEnv) ? (float) m_pMecEnv->GetFluidDensity() : (float) 0.0;
|
|
m_xLevel = (m_pMecEnv) ? (float) m_pMecEnv->GetFluidLevel() : (float) 0.0;
|
|
m_pStream = (m_pMecEnv) ? m_pMecEnv->GetFluidStream() : NULL;
|
|
// init volumic
|
|
m_csVolumic = (m_pMecEnv) ? m_pMecEnv->GetVolumicEnvironment() : "";
|
|
|
|
// init text
|
|
if (!m_pMecEnv)
|
|
{
|
|
m_cName.SetWindowText("");
|
|
m_cGravity.SetWindowText("");
|
|
m_cVectorX.SetWindowText("");
|
|
m_cVectorY.SetWindowText("");
|
|
m_cVectorZ.SetWindowText("");
|
|
m_cDensity.SetWindowText("");
|
|
m_cViscosity.SetWindowText("");
|
|
m_cLevel.SetWindowText("");
|
|
m_cStreamX.SetWindowText("");
|
|
m_cStreamY.SetWindowText("");
|
|
m_cStreamZ.SetWindowText("");
|
|
m_cVolumic.SetCurSel(-1);
|
|
}
|
|
else
|
|
{
|
|
// name
|
|
m_cName.SetWindowText(m_csName);
|
|
// gravity
|
|
sprintf(szVal, "%5.2f", m_xGravity);
|
|
m_cGravity.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_pVertical->m_xX);
|
|
m_cVectorX.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_pVertical->m_xY);
|
|
m_cVectorY.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_pVertical->m_xZ);
|
|
m_cVectorZ.SetWindowText(szVal);
|
|
// fluid
|
|
sprintf(szVal, "%5.2f", m_xDensity);
|
|
m_cDensity.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_xViscosity);
|
|
m_cViscosity.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_xLevel);
|
|
m_cLevel.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_pStream->m_xX);
|
|
m_cStreamX.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_pStream->m_xY);
|
|
m_cStreamY.SetWindowText(szVal);
|
|
sprintf(szVal, "%5.2f", m_pStream->m_xZ);
|
|
m_cStreamZ.SetWindowText(szVal);
|
|
// volumic
|
|
iInd = m_cVolumic.FindStringExact(-1, m_csVolumic);
|
|
m_cVolumic.SetCurSel(iInd);
|
|
}
|
|
}
|
|
*/
|
|
//#################################################################################
|
|
// Specific Parameters
|
|
//#################################################################################
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeName (void)
|
|
{
|
|
CString csFinalName;
|
|
char szNewName[256];
|
|
|
|
// no mec env => no changes
|
|
if ((!m_pMecEnv)||(!m_cName.GetModify()))
|
|
return;
|
|
|
|
// get corresponding name
|
|
m_cName.GetWindowText(szNewName, 255);
|
|
if (!strcmp(szNewName, ""))
|
|
{
|
|
m_cName.SetWindowText(m_csName);
|
|
return;
|
|
}
|
|
|
|
// get prefixed name
|
|
csFinalName = m_pSectorInterface->GetInterface()->GetPrefixedName(szNewName);
|
|
// check name validity
|
|
if (m_pMecEnv->fn_eCheckValidity(csFinalName) == E_mc_None)
|
|
m_csName = csFinalName;
|
|
// update window
|
|
m_cName.SetWindowText(m_csName);
|
|
|
|
m_cName.SetModify(FALSE);
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeGravity (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cGravity.GetModify())
|
|
{
|
|
m_cGravity.GetWindowText(szVal, 15);
|
|
m_xGravity = (float) atof(szVal);
|
|
m_cGravity.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeVectorX (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cVectorX.GetModify())
|
|
{
|
|
m_cVectorX.GetWindowText(szVal, 15);
|
|
m_pVertical->m_xX = (float) atof(szVal);
|
|
m_cVectorX.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeVectorY (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cVectorY.GetModify())
|
|
{
|
|
m_cVectorY.GetWindowText(szVal, 15);
|
|
m_pVertical->m_xY = (float) atof(szVal);
|
|
m_cVectorY.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeVectorZ (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cVectorZ.GetModify())
|
|
{
|
|
m_cVectorZ.GetWindowText(szVal, 15);
|
|
m_pVertical->m_xZ = (float) atof(szVal);
|
|
m_cVectorZ.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeViscosity (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cViscosity.GetModify())
|
|
{
|
|
m_cViscosity.GetWindowText(szVal, 15);
|
|
m_xViscosity = (float) atof(szVal);
|
|
m_cViscosity.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeDensity (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cDensity.GetModify())
|
|
{
|
|
m_cDensity.GetWindowText(szVal, 15);
|
|
m_xDensity = (float) atof(szVal);
|
|
m_cDensity.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeLevel (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cLevel.GetModify())
|
|
{
|
|
m_cLevel.GetWindowText(szVal, 15);
|
|
m_xLevel = (float) atof(szVal);
|
|
m_cLevel.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeStreamX (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cStreamX.GetModify())
|
|
{
|
|
m_cStreamX.GetWindowText(szVal, 15);
|
|
m_pStream->m_xX = (float) atof(szVal);
|
|
m_cStreamX.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeStreamY (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cStreamY.GetModify())
|
|
{
|
|
m_cStreamY.GetWindowText(szVal, 15);
|
|
m_pStream->m_xY = (float) atof(szVal);
|
|
m_cStreamY.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnChangeStreamZ (void)
|
|
{
|
|
char szVal[15];
|
|
|
|
if (m_cStreamZ.GetModify())
|
|
{
|
|
m_cStreamZ.GetWindowText(szVal, 15);
|
|
m_pStream->m_xZ = (float) atof(szVal);
|
|
m_cStreamZ.SetModify(FALSE);
|
|
}
|
|
}
|
|
*/
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnSelChangeComboVolumic (void)
|
|
{
|
|
char szText[256];
|
|
|
|
// get corresponding environment
|
|
m_cVolumic.GetLBText(m_cVolumic.GetCurSel(), szText);
|
|
// update value
|
|
m_csVolumic = szText;
|
|
}
|
|
*/
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnSave()
|
|
{
|
|
SECT_ModifMecEnvParams *pModif;
|
|
|
|
// no mec env => no changes
|
|
if (!m_pMecEnv)
|
|
return;
|
|
|
|
// default mec env => create new one
|
|
if (m_pMecEnv == m_pDefaultMecEnv)
|
|
m_pMecEnv = new SECT_MecEnvironment(m_pSectorInterface, m_csName);
|
|
|
|
// modif
|
|
pModif = new SECT_ModifMecEnvParams(m_pSectorInterface, E_tm_ModifMecEnv, m_pMecEnv,
|
|
m_csName, m_xGravity, m_pVertical, m_xViscosity,
|
|
m_xDensity, m_xLevel, m_pStream, m_csVolumic);
|
|
|
|
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
|
|
// give controtl to dialog env & update combo meca
|
|
m_pSectorInterface->GetDialogEnv()->fn_vInitMecListBox();
|
|
m_pSectorInterface->GetDialogEnv()->fn_vSelectMechanic(m_pMecEnv);
|
|
m_pSectorInterface->GetDialogEnv()->fn_vInitControls(TRUE);
|
|
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
|
|
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
|
|
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnCancel()
|
|
{
|
|
// new mec env => cancel
|
|
if (m_pMecEnv == m_pDefaultMecEnv)
|
|
m_pMecEnv = NULL;
|
|
|
|
// reinit controls
|
|
fn_vInitMecEnvironment(m_pMecEnv, FALSE);
|
|
// give controtl to dialog env
|
|
m_pSectorInterface->GetDialogEnv()->fn_vInitControls(TRUE);
|
|
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
|
|
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
|
|
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnDefault()
|
|
{
|
|
if (m_cName.GetModify())
|
|
{
|
|
OnChangeName();
|
|
m_cName.SetFocus();
|
|
}
|
|
|
|
}
|
|
*/
|
|
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnSize(UINT, int, int)
|
|
{
|
|
RECT WindowPosition;
|
|
int ecx, ecy;
|
|
|
|
if (!m_bInitialised)
|
|
return;
|
|
|
|
// calculate name position
|
|
GetWindowRect(&WindowPosition);
|
|
ecx = WindowPosition.right - WindowPosition.left;
|
|
ecx = (ecx < 310) ? 0 : ecx-300;
|
|
ecy = WindowPosition.bottom - WindowPosition.top;
|
|
ecy = (ecy < 180) ? 0 : ecy-180;
|
|
|
|
// buttons
|
|
m_cCancel.MoveWindow(ecx/2, 7, 40, 16);
|
|
m_cSave.MoveWindow(ecx/2+260, 7, 40, 16);
|
|
// name
|
|
m_cName.MoveWindow(ecx/2+50, 5, 200, 20);
|
|
// Volumic environment
|
|
GetDlgItem(SECT_IDC_TEXTVOLUMIC)->MoveWindow(ecx/2, 30, 147, 40);
|
|
m_cVolumic.MoveWindow(ecx/2+10, 45, 130, 20);
|
|
// Gravity parameters
|
|
GetDlgItem(SECT_IDC_TEXTGRAVITY)->MoveWindow(ecx/2, 75, 147, 90);
|
|
GetDlgItem(SECT_IDC_TEXTCOEFF)->MoveWindow(ecx/2+10, 91, 60, 18);
|
|
m_cGravity.MoveWindow(ecx/2+80, 90, 60, 20);
|
|
GetDlgItem(SECT_IDC_TEXTVERTICAL)->MoveWindow(ecx/2+10, 115, 70, 18);
|
|
m_cVectorX.MoveWindow(ecx/2+5, 135, 43, 20);
|
|
m_cVectorY.MoveWindow(ecx/2+50, 135, 43, 20);
|
|
m_cVectorZ.MoveWindow(ecx/2+95, 135, 43, 20);
|
|
// mechanic
|
|
GetDlgItem(SECT_IDC_TEXTFLUID)->MoveWindow(ecx/2+152, 30, 147, 135);
|
|
GetDlgItem(SECT_IDC_TEXTVISCOSITY)->MoveWindow(ecx/2+162, 46, 60, 18);
|
|
m_cViscosity.MoveWindow(ecx/2+232, 45, 60, 20);
|
|
GetDlgItem(SECT_IDC_TEXTDENSITY)->MoveWindow(ecx/2+162, 68, 60, 18);
|
|
m_cDensity.MoveWindow(ecx/2+232, 67, 60, 20);
|
|
GetDlgItem(SECT_IDC_TEXTLEVEL)->MoveWindow(ecx/2+162, 90, 60, 18);
|
|
m_cLevel.MoveWindow(ecx/2+232, 89, 60, 20);
|
|
GetDlgItem(SECT_IDC_TEXTSTREAM)->MoveWindow(ecx/2+162, 115, 70, 18);
|
|
m_cStreamX.MoveWindow(ecx/2+157, 135, 43, 20);
|
|
m_cStreamY.MoveWindow(ecx/2+202, 135, 43, 20);
|
|
m_cStreamZ.MoveWindow(ecx/2+247, 135, 43, 20);
|
|
}
|
|
*/
|
|
/*----------------------------------------
|
|
----------------------------------------*/
|
|
/*
|
|
void SECT_DialogMec::OnDestroy (void)
|
|
{
|
|
// FOR TUTORIAL
|
|
TUT_M_vGetTutDll();
|
|
// environment
|
|
TUT_M_vUnregisterControl(m_cName.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cDefault.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cCancel.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cSave.m_hWnd);
|
|
// gravity
|
|
TUT_M_vUnregisterControl(m_cGravity.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cVectorX.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cVectorY.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cVectorZ.m_hWnd);
|
|
// fluid
|
|
TUT_M_vUnregisterControl(m_cViscosity.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cDensity.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cLevel.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cStreamX.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cStreamY.m_hWnd);
|
|
TUT_M_vUnregisterControl(m_cStreamZ.m_hWnd);
|
|
// volumic environment
|
|
TUT_M_vUnregisterControl(m_cVolumic.m_hWnd);
|
|
// END TUTORIAL
|
|
|
|
CFormView::OnDestroy();
|
|
}
|
|
*/ |