reman3/Rayman_X/cpa/tempgrp/TPG/Src/TPG_View.cpp

692 lines
19 KiB
C++

// TPG_View.cpp : implementation file
//
#include "stdafx.h"
#include "x:\cpa\main\inc\_EditID.h"
#include "TUT.h"
#include "TPG_View.hpp"
#include "TPGMyDoc.hpp"
#include "TPG_OGen.hpp"
#include "TPG_OEnv.hpp"
#include "TPG_OSys.hpp"
#include "_Minterf.hpp"
#include "TPG_Strg.hpp"
#include "ErO.h"
#include "SCR.h"
#include "WAW.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// TPG_View
IMPLEMENT_DYNCREATE(TPG_View, CTL_Editor_BaseFormView)
TPG_View::TPG_View() : CTL_Editor_BaseFormView(TPG_View::IDD)
{
//{{AFX_DATA_INIT(TPG_View)
//}}AFX_DATA_INIT
}
TPG_View::~TPG_View()
{
}
void TPG_View::DoDataExchange(CDataExchange* pDX)
{
CTL_Editor_BaseFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(TPG_View)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(TPG_View, CTL_Editor_BaseFormView)
//{{AFX_MSG_MAP(TPG_View)
ON_BN_CLICKED(IDC_BUTTON_DELETE, OnButtonDelete)
ON_BN_CLICKED(IDC_BUTTON_NEW, OnButtonNew)
ON_BN_CLICKED(IDC_BUTTON_DELETEENV, OnButtonDeleteenv)
ON_BN_CLICKED(IDC_BUTTON_DELETESYSTEM, OnButtonDeletesystem)
ON_BN_CLICKED(IDC_BUTTON_NEWENV, OnButtonNewenv)
ON_BN_CLICKED(IDC_BUTTON_NEWSYSTEM, OnButtonNewsystem)
ON_BN_CLICKED(IDC_BUTTON_RENAMEENV, OnButtonRenameenv)
ON_BN_CLICKED(IDC_BUTTON_RENAMESYSTEM, OnButtonRenamesystem)
ON_WM_LBUTTONDBLCLK()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// TPG_View diagnostics
#ifdef _DEBUG
void TPG_View::AssertValid() const
{
CTL_Editor_BaseFormView::AssertValid();
}
void TPG_View::Dump(CDumpContext& dc) const
{
CTL_Editor_BaseFormView::Dump(dc);
}
#endif //_DEBUG
//////////////////////////////////////////////////////////////////////////////
// Functions to get the document associated to the View
CPA_PartGen_MyDocument* TPG_View::m_pub_fn_p_clGetDocument()
{
return g_pclInterface->m_pub_fn_p_clGetDocument();
}
/////////////////////////////////////////////////////////////////////////////
// TPG_View message handlers
//////////////////////////////
// Generator control
// Creation Control
void TPG_View::OnButtonNew()
{
CPA_Dialog_GeneratorNewName Dialog( this );
if ( Dialog.DoModal() == IDOK )
{
ERROR_PREPARE_M
(
g_c_csPartGenModuleNameForErrors,
"Creating a new generator",
"TPG_View::OnButtonNew",
E_ERROR_GRAVITY_FATAL,
"new generator is not allocated"
);
CPA_PartGen_Generator *p_clGenerator = new CPA_PartGen_Generator( Dialog.m_csNewGeneratorName );
ERROR_ASSERT( p_clGenerator != NULL );
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
void TPG_View::OnButtonDelete()
{
CString csText = "You are going to delete the generator '";
csText += m_pub_fn_p_clGetDocument()->m_pub_p_clCurrentGenerator->GetName();
csText += "'\nDo you want to continue ?";
CPA_Dialog_Warning Dialog( this, csText );
if ( Dialog.DoModal() == IDOK )
{
m_pub_fn_p_clGetDocument()->m_pub_fn_vDeleteGenerator();
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
///////////////////////////////:
// Environment controls
void TPG_View::OnButtonNewenv()
{
CPA_Dialog_GeneratorNewName Dialog( this );
if ( Dialog.DoModal() == IDOK )
{
CPA_PartGen_Environment *p_clEnv = new CPA_PartGen_Environment( Dialog.m_csNewGeneratorName);
ERROR_ASSERT( p_clEnv != NULL );
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
m_pub_fn_p_clGetDocument()->m_pub_fn_vUpdateChangingEnumDescriptors();
/*CComboBox *p_clCombo = (CComboBox*)GetDlgItem( IDC_COMBO_ENV );
short wIndex = p_clCombo->AddString( p_clEnv->GetName() );
p_clCombo->SetItemDataPtr( wIndex, (void*)p_clEnv );*/
}
}
void TPG_View::OnButtonDeleteenv()
{
CString csText = "You are going to delete the environment '";
csText += m_pub_fn_p_clGetDocument()->m_pub_p_clCurrentEnv->GetName();
csText += "'\nDo you want to continue ?";
CPA_Dialog_Warning Dialog( this, csText );
if ( Dialog.DoModal() == IDOK )
{
m_pub_fn_p_clGetDocument()->m_pub_fn_vDeleteEnv();
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
/*
void Parcours( WAW_DataList &List )
{
POSITION pos = List.GetHeadPosition();
while( pos != NULL )
{
WAW_Data * pclData = List.GetNext( pos );
}
}
*/
void TPG_View::OnButtonRenameenv()
{
//*** Test de WAW
/*
WAW_DataList List( "TPG Test" );
List.m_pub_fn_vGetVisible();
Parcours( List );
*/
}
//////////////////////////////////
// System Controls
void TPG_View::OnButtonNewsystem()
{
CPA_Dialog_SystemNewName Dialog( this );
if ( Dialog.DoModal() == IDOK )
{
CPA_PartGen_System *p_clSystem = new CPA_PartGen_System( Dialog.m_csNewSystemName, Dialog.m_lNbParticles);
ERROR_ASSERT( p_clSystem != NULL );
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
m_pub_fn_p_clGetDocument()->m_pub_fn_vUpdateChangingEnumDescriptors();
/*CComboBox *p_clCombo = (CComboBox*)GetDlgItem( IDC_COMBO_SYSTEM );
short wIndex = p_clCombo->AddString( p_clSystem->GetName() );
p_clCombo->SetItemDataPtr( wIndex, (void*)p_clSystem );*/
}
}
void TPG_View::OnButtonDeletesystem()
{
CString csText = "You are going to delete the system '";
csText += m_pub_fn_p_clGetDocument()->m_pub_p_clCurrentSystem->GetName();
csText += "'\nDo you want to continue ?";
CPA_Dialog_Warning Dialog( this, csText );
if ( Dialog.DoModal() == IDOK )
{
m_pub_fn_p_clGetDocument()->m_pub_fn_vDeleteSystem();
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
/*
void TPG_g_fn_TestForWAW( WAW_tdeMessage _eMessage, void * _pvData )
{
int i = 0;
switch( _eMessage )
{
case WAW_eDeletedNode :
i = i;
break;
case WAW_eUpdateData :
i = i;
break;
}
}
*/
void TPG_View::OnButtonRenamesystem()
{
//*** Test de WAW
/*
WAW_hUserInfo hInfo = WAW_fn_hUserRegister( "TPG Test", TPG_g_fn_TestForWAW );
WAW_Data * pclData = NULL;
pclData = WAW_fn_pclAddNode( hInfo, NULL, "System" );
pclData = WAW_fn_pclAddData( hInfo, pclData, "Bidon", "1.500" );
WAW_fn_pclAddData( hInfo, pclData, "Truc", "0", TPG_g_fn_TestForWAW );
WAW_fn_pclAddData( hInfo, pclData, "Machin", "Hello" );
WAW_fn_pclAddData( hInfo, NULL, "Truc", "0" );
*/
}
///////////////////////////////////////
// Fuctions to show and update editors
///////////////////////////////////////
void TPG_View::OnInitialUpdate()
{
CTL_Editor_BaseFormView::OnInitialUpdate();
g_pclInterface->m_pub_p_clView = this;
//*** register controls for TUT
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_hWnd, "TPG_MainWindow",TUT_e_Window);
//****** register buttons
TUT_M_vRegisterControlID(IDC_BUTTON_NEW, "TPG_CreateNewGenerator",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_RENAME, "TPG_CopyEditedGenerator",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_DELETE, "TPG_DeleteEditedGenerator",TUT_e_Button);
//ANNECY VL PRT 20/03/98{
TUT_M_vRegisterControlID(IDC_BUTTON_NEWPRTSRC, "TPG_CreateNewSource",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_RENAMEPRTSRC, "TPG_CopyEditedSource",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_DELETEPRTSRC, "TPG_DeleteEditedSourec",TUT_e_Button);
//ENDANNECY VL}
TUT_M_vRegisterControlID(IDC_BUTTON_NEWSYSTEM, "TPG_CreateNewSystem",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_RENAMESYSTEM, "TPG_CopyEditedSystem",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_DELETESYSTEM, "TPG_DeleteEditedSystem",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_NEWENV, "TPG_CreateNewEnvironment",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_RENAMEENV, "TPG_CopyEditedEnvironment",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_DELETEENV, "TPG_DeleteEditedEnvironment",TUT_e_Button);
m_pub_fn_p_clGetDocument()->m_pub_fn_vDisplayCurrentGenerator();
}
void TPG_View::m_pub_fn_vDisplayGeneratorInZone( CPA_PartGen_Generator *_p_clGenerator, CPoint *_p_clTopLeft, CPoint * _p_clTopRight )
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
CWnd *p_clWnd = NULL;
CRect *p_clRect = new CRect( *_p_clTopLeft, *_p_clTopRight );
int iButtonWidth = (int) (p_clRect->Width() / 3);
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
p_clRect->InflateRect( 0, 10 );
p_clRect->OffsetRect( 0, 10 );
p_clWnd = GetDlgItem( IDC_STATIC_GENERATORNAME );
p_clWnd->SetWindowText( (_p_clGenerator != NULL) ? _p_clGenerator->GetName() : "<No Generator>" );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->DeflateRect( iButtonWidth, 0 );
p_clRect->OffsetRect( -iButtonWidth, 25 );
p_clWnd = GetDlgItem( IDC_BUTTON_NEW );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_RENAME );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( FALSE );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_DELETE );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( _p_clGenerator != NULL );
p_clWnd->ShowWindow( TRUE );
_p_clTopLeft->y+=50;
_p_clTopRight->y+=50;
delete p_clRect;
}
void TPG_View::m_pub_fn_vDisplaySourceInZone( CPA_PartGen_Source *_p_oPrtSrc, CPoint *_p_clTopLeft, CPoint * _p_clTopRight )
{
CWnd * p_clWnd = NULL;
CRect * p_clRect = new CRect( *_p_clTopLeft, *_p_clTopRight );
int iButtonWidth = (int)(p_clRect->Width() / 3);
p_clRect->InflateRect( 0, 10 );
p_clRect->OffsetRect( 0, 10 );
p_clWnd = GetDlgItem( IDC_STATIC_PRTSRCNAME );
p_clWnd->SetWindowText( ( _p_oPrtSrc != NULL ) ? _p_oPrtSrc->GetName() : "<No Source>" );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->DeflateRect( iButtonWidth, 0 );
p_clRect->OffsetRect( -iButtonWidth, 25 );
p_clWnd = GetDlgItem( IDC_BUTTON_NEWPRTSRC );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_RENAMEPRTSRC );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( FALSE );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_DELETEPRTSRC );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( _p_oPrtSrc != NULL );
p_clWnd->ShowWindow( TRUE );
_p_clTopLeft->y+=50;
_p_clTopRight->y+=50;
delete p_clRect;
}
void TPG_View::m_pub_fn_vDisplaySystemInZone( CPA_PartGen_System *_p_clSystem, CPoint *_p_clTopLeft, CPoint * _p_clTopRight )
{
CWnd * p_clWnd = NULL;
CRect * p_clRect = new CRect( *_p_clTopLeft, *_p_clTopRight );
int iButtonWidth = (int)(p_clRect->Width() / 3);
p_clRect->InflateRect( 0, 10 );
p_clRect->OffsetRect( 0, 10 );
p_clWnd = GetDlgItem( IDC_STATIC_SYSNAME );
p_clWnd->SetWindowText( ( _p_clSystem != NULL ) ? _p_clSystem->GetName() : "<No System>" );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->DeflateRect( iButtonWidth, 0 );
p_clRect->OffsetRect( -iButtonWidth, 25 );
p_clWnd = GetDlgItem( IDC_BUTTON_NEWSYSTEM );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_RENAMESYSTEM );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( FALSE );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_DELETESYSTEM );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( _p_clSystem != NULL );
p_clWnd->ShowWindow( TRUE );
_p_clTopLeft->y+=50;
_p_clTopRight->y+=50;
delete p_clRect;
}
void TPG_View::m_pub_fn_vDisplayEnvInZone( CPA_PartGen_Environment *_p_clEnv, CPoint *_p_clTopLeft, CPoint * _p_clTopRight )
{
CWnd * p_clWnd = NULL;
CRect * p_clRect = new CRect( *_p_clTopLeft, *_p_clTopRight );
int iButtonWidth = (int)(p_clRect->Width() / 3);
p_clRect->InflateRect( 0, 10 );
p_clRect->OffsetRect( 0, 10 );
p_clWnd = GetDlgItem( IDC_STATIC_ENVNAME );
p_clWnd->SetWindowText( ( _p_clEnv != NULL ) ? _p_clEnv->GetName() : "<No Environment>" );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->DeflateRect( iButtonWidth, 0 );
p_clRect->OffsetRect( -iButtonWidth, 25 );
p_clWnd = GetDlgItem( IDC_BUTTON_NEWENV );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_RENAMEENV );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( FALSE );
p_clWnd->ShowWindow( TRUE );
p_clRect->OffsetRect( iButtonWidth, 0 );
p_clWnd = GetDlgItem( IDC_BUTTON_DELETEENV );
p_clWnd->MoveWindow( p_clRect );
p_clWnd->EnableWindow( _p_clEnv != NULL );
p_clWnd->ShowWindow( TRUE );
_p_clTopLeft->y+=50;
_p_clTopRight->y+=50;
delete p_clRect;
}
void TPG_View::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CRect clClientRect;
GetDlgItem( IDC_STATIC_GENERATORNAME )->GetWindowRect( &clClientRect );
ScreenToClient( &clClientRect );
if( clClientRect.PtInRect( point ) )
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->SetCurrentType( g_C_csPartGenGeneratorName );
GetDlgItem( IDC_STATIC_SYSNAME )->GetWindowRect( &clClientRect );
ScreenToClient( &clClientRect );
if( clClientRect.PtInRect( point ) )
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->SetCurrentType( g_C_csPartGenSystemName );
GetDlgItem( IDC_STATIC_ENVNAME )->GetWindowRect( &clClientRect );
ScreenToClient( &clClientRect );
if( clClientRect.PtInRect( point ) )
m_pub_fn_p_clGetDocument()->m_pub_p_clDialogList->SetCurrentType( g_C_csPartGenEnvName );
CTL_Editor_BaseFormView::OnLButtonDblClk(nFlags, point);
}
void TPG_View::OnSize(UINT nType, int cx, int cy)
{
CTL_Editor_BaseFormView::OnSize(nType, cx, cy);
m_pub_fn_p_clGetDocument()->m_pub_fn_vDisplayCurrentGenerator();
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Dialog_GeneratorNewName dialog
CPA_Dialog_GeneratorNewName::CPA_Dialog_GeneratorNewName(CWnd* pParent /*=NULL*/)
: CDialog(CPA_Dialog_GeneratorNewName::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Dialog_GeneratorNewName)
m_csNewGeneratorName = _T("");
//}}AFX_DATA_INIT
}
void CPA_Dialog_GeneratorNewName::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Dialog_GeneratorNewName)
DDX_Text(pDX, IDC_EDIT_NEWGENERATORNAME, m_csNewGeneratorName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPA_Dialog_GeneratorNewName, CDialog)
//{{AFX_MSG_MAP(CPA_Dialog_GeneratorNewName)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CPA_Dialog_GeneratorNewName::OnInitDialog()
{
CDialog::OnInitDialog();
//*** register controls for TUT
TUT_M_vGetTutDll();
//****** register window
TUT_M_vRegisterControl(m_hWnd, "TPG_DialogNewGeneratorOrEnvironmentNameWindow",TUT_e_Window);
//****** register controls
TUT_M_vRegisterControlID(IDC_EDIT_NEWGENERATORNAME, "TPG_GetNewGeneratorOrEnvironmentName",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDOK, "TPG_AcceptNewGeneratorOrEnvironmentName",TUT_e_Button);
TUT_M_vRegisterControlID(IDCANCEL, "TPG_CancelNewGeneratorOrEnvironmentName",TUT_e_Button);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPA_Dialog_GeneratorNewName::OnDestroy()
{
CDialog::OnDestroy();
//*** unregister controls for TUT
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_hWnd);
TUT_M_vUnregisterControlID(IDC_EDIT_NEWGENERATORNAME);
TUT_M_vUnregisterControlID(IDOK);
TUT_M_vUnregisterControlID(IDCANCEL);
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Dialog_GeneratorNewName message handlers
/////////////////////////////////////////////////////////////////////////////
// CPA_Dialog_SystemNewName dialog
CPA_Dialog_SystemNewName::CPA_Dialog_SystemNewName(CWnd* pParent /*=NULL*/)
: CDialog(CPA_Dialog_SystemNewName::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Dialog_SystemNewName)
m_csNewSystemName = _T("");
m_lNbParticles = 100;
//}}AFX_DATA_INIT
}
void CPA_Dialog_SystemNewName::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Dialog_SystemNewName)
DDX_Text(pDX, IDC_EDIT_SYSTEMNEWNAME, m_csNewSystemName);
DDX_Text(pDX, IDC_EDIT_SYSDIALOGNBPARTICLES, m_lNbParticles);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPA_Dialog_SystemNewName, CDialog)
//{{AFX_MSG_MAP(CPA_Dialog_SystemNewName)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPA_Dialog_SystemNewName message handlers
BOOL CPA_Dialog_SystemNewName::OnInitDialog()
{
CDialog::OnInitDialog();
//*** register controls for TUT
TUT_M_vGetTutDll();
//****** register window
TUT_M_vRegisterControl(m_hWnd, "TPG_DialogNewSystemNameWindow",TUT_e_Window);
//****** register controls
TUT_M_vRegisterControlID(IDC_EDIT_SYSTEMNEWNAME, "TPG_GetNewSystemName",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDOK, "TPG_AcceptNewSystemName",TUT_e_Button);
TUT_M_vRegisterControlID(IDCANCEL, "TPG_CancelNewSystemName",TUT_e_Button);
TUT_M_vRegisterControlID(IDC_EDIT_SYSDIALOGNBPARTICLES, "TPG_GetNewSystemNbParticles",TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDC_SPIN_SYS, "TPG_SpinForNewSystemNbParticles", TUT_e_Spin);
((CSpinButtonCtrl*)GetDlgItem( IDC_SPIN_SYS ))->SetRange( 0, 500);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPA_Dialog_SystemNewName::OnDestroy()
{
CDialog::OnDestroy();
//*** unregister controls for TUT
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_hWnd);
TUT_M_vUnregisterControlID(IDC_EDIT_SYSTEMNEWNAME);
TUT_M_vUnregisterControlID(IDOK);
TUT_M_vUnregisterControlID(IDCANCEL);
TUT_M_vUnregisterControlID(IDC_EDIT_SYSDIALOGNBPARTICLES);
TUT_M_vUnregisterControlID(IDC_SPIN_SYS);
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Dialog_Warning dialog
CPA_Dialog_Warning::CPA_Dialog_Warning(CWnd* pParent, CString _csText /*=NULL*/)
: CDialog(CPA_Dialog_Warning::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Dialog_Warning)
m_csWarningText = _csText;
//}}AFX_DATA_INIT
}
void CPA_Dialog_Warning::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Dialog_Warning)
DDX_Text(pDX, IDC_STATIC_WARNING, m_csWarningText);
//}}AFX_DATA_MAP
}
BOOL CPA_Dialog_Warning::OnInitDialog()
{
CDialog::OnInitDialog();
//*** register controls for TUT
TUT_M_vGetTutDll();
//****** register window
TUT_M_vRegisterControl(m_hWnd, "TPG_WarningWhenObjectIsDeletedWindow",TUT_e_Window);
TUT_M_vRegisterControlID(IDOK, "TPG_AcceptObjectIsDeleted", TUT_e_Button);
TUT_M_vRegisterControlID(IDCANCEL, "TPG_CancelObjectIsDeleted", TUT_e_Button);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPA_Dialog_Warning::OnDestroy()
{
CDialog::OnDestroy();
//*** unregister controls for TUT
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_hWnd);
TUT_M_vUnregisterControlID(IDOK);
TUT_M_vUnregisterControlID(IDCANCEL);
}
BEGIN_MESSAGE_MAP(CPA_Dialog_Warning, CDialog)
//{{AFX_MSG_MAP(CPA_Dialog_Warning)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPA_Dialog_Warning message handlers