Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,29 @@
#ifndef _CPA_MECA_ALLOC_
#define _CPA_MECA_ALLOC_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CPA_Meca_Card;
//Unallocation functions
void fn_vUnalloc1(CPA_Meca_Card *);
void fn_vUnalloc2(CPA_Meca_Card *);
void fn_vUnalloc3(CPA_Meca_Card *);
void fn_vUnalloc4(CPA_Meca_Card *);
void fn_vUnalloc5(CPA_Meca_Card *);
void fn_vUnalloc6(CPA_Meca_Card *);
void fn_vUnalloc7(CPA_Meca_Card *);
void fn_vUnalloc8(CPA_Meca_Card *);
void fn_vUnalloc9(CPA_Meca_Card *);
void fn_vUnalloc10(CPA_Meca_Card *);
void fn_vUnalloc11(CPA_Meca_Card *);
void fn_vUnalloc12(CPA_Meca_Card *);
void fn_vUnalloc13(CPA_Meca_Card *);
void fn_vUnalloc14(CPA_Meca_Card *);
//ANNECY jt {
void fn_vUnallocRay2Egypte1(CPA_Meca_Card *); // base
//ENDANNECY jt }
#endif //_CPA_MECA_ALLOC

View File

@@ -0,0 +1,14 @@
// Constant strings defintion for Controls and Data customization
//
// YB
///////////////////////////////////////////////////////////////////
#ifndef _TME_CONSTANT_STRINGS_FOR_CONTROLS_
#define _TME_CONSTANT_STRINGS_FOR_CONTROLS_
//For Controls
const CString TME_g_c_cs_ControlOwnerData_ParentCardType = "Parent_Card_Type";
//For Data
const CString TME_g_c_cs_DataOwnerData_ParentCard = "Parent_Card";
#endif //_TME_CONSTANT_STRINGS_FOR_CONTROLS_

View File

@@ -0,0 +1,24 @@
// CallBacks
//
// YB
///////////////////////
#ifndef _TME_CALLBACKS_
#define _TME_CALLBACKS_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
//External Modules
#include "CTL.h"
//End of External Modules
BOOL TME_fn_bControlCanBeDisplayedCallBack(CTL_Editor_Control *_pclSenderControl);
void TME_fn_vCallBackWhenADataHasChanged(CTL_Editor_Data *_pclChangedData,
CTL_tdeUpdateReason _eReason,
long _lUserDefinedReason = 0);
#endif //_TME_CALLBACKS_

View File

@@ -0,0 +1,101 @@
// Constants definition for the Charactersitics Editor
////////////////////////////////////////////////////////
#ifndef _EDCAR_CONST_HPP_
#define _EDCAR_CONST_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
//Definitions for Editor
#define C_EDITOR_SUBSTRACTED_HEIGHT 0
#define C_EDITOR_WIDTH 250
#define C_SCROLLBAR_WIDTH 7
//Definitions for MS placing
#define C_SPACE_FOR_BORDER 2
#define C_MS_LINE_HEIGHT 20
#define C_MS_SPACING 3
//Definitions for MS internal controls
#define C_TABULATION 0
#define C_ALLOC_BUTTON_PERCENT_WIDTH 20
//Definitions for special tool tips windows
#define C_TTIPS_SPACING 4
//Definitions for Actors' View
//Defines for next/prev buttons display
#define C_BUTTON_SIZE 20 //square buttons
//Defines for direct acces buttons display
#define C_BUTTON_SPACING 2
#define C_BUTTON_HEIGHT 20
#define C_BUTTONS_COLUMNS 3 //Number of direct access buttons per line
//Definitions for Main View
#define C_MAIN_VIEW_SPACING 2
//Definitions for Buttons
#define C_BUTTON_MARGIN 3
//Definitions for Spin Buttons
#define C_SPIN_PRECISION 3
#define C_ACCEL_NB 5
//Global definitions for control
#define C_SPACE_BETWEEN_CONTROLS 2
#define C_EDIT_HEIGHT 15
//Definitions for Boolean control
#define C_BOOL_NAME_BOX_PERCENT_WIDTH 70
#define C_BOOL_NAME_BOX_MIN_WIDTH 40
#define C_BOOL_BUTTON_PERCENT_WIDTH 30
#define C_BUTTON_HEIGHT 20
#define C_BUTTON_WIDTH 40
//Definitions for Enum control
#define C_ENUM_BOX_TOTAL_HEIGHT 100
#define C_ENUM_COMBO_BOX_HEIGHT 20
#define C_ENUM_BOX_PERCENT_WIDTH 50
#define C_ENUM_BOX_MIN_WIDTH 90
#define C_ENUM_NAME_PERCENT_WIDTH 50
//Definitions for Float control
#define C_DECIMAL_NAME_BOX_PERCENT_WIDTH 60
#define C_DECIMAL_CURRENT_VALUE_PERCENT_WIDTH 35
#define C_DECIMAL_CURRENT_VALUE_MIN_WIDTH 50 //for Auto Spacing
#define C_DECIMAL_SPIN_PERCENT_WIDTH 5
#define C_DECIMAL_SPIN_MIN_WIDTH 10 //for Auto Spacing
#define C_SPIN_HEIGHT 17 //for Auto Spacing
//Definitions for Int control
#define C_INT_NAME_BOX_PERCENT_WIDTH 70
#define C_INT_CURRENT_VALUE_PERCENT_WIDTH 25
#define C_INT_CURRENT_VALUE_MIN_WIDTH 30 //for Auto Spacing
#define C_INT_SPIN_PERCENT_WIDTH 5
#define C_INT_SPIN_MIN_WIDTH 10 //for Auto Spacing
//Definitions for List control
#define C_LIST_NUMBER_OF_CONTROLS 3
#define C_LIST_BUTTON_HEIGHT 20
#define C_LIST_EDIT_BUTTON_PERCENT_WIDTH 15
#define C_LIST_DEV_BUTTON_PERCENT_WIDTH 15
#define C_LIST_NAME_BOX_PERCENT_WIDTH 70
#define C_LIST_ADDING_HEIGHT_WHEN_DEV 70
//Definitions for Matrice control
#define C_MATRICE_NUMBER_OF_CONTROLS 3
#define C_MATRICE_BUTTON_HEIGHT 20
#define C_MATRICE_EDIT_BUTTON_PERCENT_WIDTH 15
#define C_MATRICE_DEV_BUTTON_PERCENT_WIDTH 15
#define C_MATRICE_NAME_BOX_PERCENT_WIDTH 70
#define C_MATRICE_ADDING_HEIGHT_WHEN_DEV 50
//Definitions for Text control
#define C_TEXT_NAME_BOX_PERCENT_WIDTH 70
#define C_TEXT_CURRENT_VALUE_PERCENT_WIDTH 30
#define C_TEXT_CURRENT_VALUE_MIN_WIDTH 30 //for Auto Spacing
#endif //_EDCAR_CONST_HPP_

View File

@@ -0,0 +1,145 @@
// Header for the definition of the class representing a Mechanical Card Type
//////////////////////////////////////////////////////////////////////////////
#ifndef _CPA_MECA_CARD_TYPE_HPP_
#define _CPA_MECA_CARD_TYPE_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <afxtempl.h>
#include "_MecCard.hpp"
//External Modules
#include "CTL.h"
//End of External Modules
class CPA_Editor_EnumDescriptor;
class CPA_Meca_MiniStrucView;
class CPA_Meca_CardType
{
public:
CPA_Meca_CardType(CString csName, DNM_tdeMechanicsID tdeMotorID);
~CPA_Meca_CardType();
//---------------------------------------
//Attributes
public:
//The list of data
CTL_Editor_ControlList m_clControlList;
//A rectangle specifying the zone where controls are drown
CRect m_crControlZone;
//A pointer on the Unallocation function
void (*m_p_fn_vUnallocate) (CPA_Meca_Card *);
//A pointer on the Filling function
void (*m_p_fn_vFill) (CPA_Meca_Card *);
//A pointer on the Saving function
void (*m_p_fn_vSave) (SCR_tdst_File_Description *, CPA_Meca_Card *);
//
BOOL m_bAtLeastOneCardOfTheCardTypeHasBeenLoaded;
protected:
private:
//The name of the mini-structure (in the Tree)
CString m_csName;
//The name of the File where this type of Cards are stored
CString m_csFileName;
//The name of the Action for this type of Cards
CString m_csActionName;
CRect m_crDisplayRect;
CPA_Meca_MiniStrucView *m_pclParentView;
//The currently edited Card
CPA_Meca_Card *m_pclCurrentCard;
//The list of Cards
CPA_Meca_CardList m_clCardsList;
//...
BOOL m_bControlsAreHidden;
//The ID of the type of Mechanics (image of Motor ID)
DNM_tdeMechanicsID m_tdeMotorID;
//---------------------------------------
//Functions
public:
CString m_fn_csGetCardTypeName();
void m_fn_vSetCardTypeName(CString csNewName);
CPA_Meca_Card *m_fn_pclGetEditedCard();
void m_fn_vSetEditedCard(CPA_Meca_Card *);
CPA_Meca_CardList *m_fn_pclGetCardsList();
unsigned long m_fn_ulGetCardsNumber();
BOOL m_fn_bControlsAreHidden();
//Get : The ID of the type of Mechanics (image of Motor ID)
DNM_tdeMechanicsID m_fn_tdeGetMotorID();
//The name of the File where this type of Cards are stored
CString m_fn_csGetFileName();
void m_fn_vSetFileName(CString csNewName);
//The name of the Action for this type of Cards
CString m_fn_csGetActionName();
void m_fn_vSetActionName(CString csNewName);
// void m_fn_vAddIntegerControl(CString, long, long, char , BOOL, tdeDataLevel, BOOL, tdeControlSpacingType, BOOL);
void m_fn_vAddDecimalControl(long double, long double, char, BOOL, CString _csControlName);
void m_fn_vAddBooleanControl(BOOL, CString _csControlName);
// void m_fn_vAddEnumControl(CString, CPA_Editor_EnumDescriptor *, tdeDataLevel, BOOL);
// void m_fn_vAddListControl(CString, tdeDataLevel, BOOL);
// void m_fn_vAddMatriceControl(CString, long, long, char, BOOL, tdeDataLevel, BOOL);
// void m_fn_vAddTextControl(CString, tdeDataLevel, BOOL, tdeControlSpacingType, BOOL);
//Creates all controls
virtual long m_fn_lCreateMSControls(CWnd *, CRect);
//Hides all controls
virtual void m_fn_vHideAllControls();
long m_fn_lOpen(CRect crRect);
void m_fn_vOffsetZone(long lOffset);
void m_fn_vClose();
void m_fn_vGetMotorDatas();
protected:
private:
void m_pri_fn_vAddOwnerDataToControl(CTL_Editor_Control *_pclControl);
};
//#####################################################################
// Definition of the class for the list of mini-structures
class CPA_Meca_CardTypeList : public CList<CPA_Meca_CardType *, CPA_Meca_CardType *>
{
public:
CPA_Meca_CardTypeList();
~CPA_Meca_CardTypeList();
CPA_Meca_CardType* m_fn_pclAddElement(CString, DNM_tdeMechanicsID tdeMotorID);
void m_fn_vEmptyList();
//Gets a Type Card from its Motor ID
CPA_Meca_CardType* m_fn_pclGetTypeCardFromID(DNM_tdeMechanicsID tdeMotorID);
};
#endif //_CPA_MECA_CARD_TYPE_HPP_

View File

@@ -0,0 +1,60 @@
// cpacqudg.hpp : header file
/////////////////////////////////////////////////////////////////////////////
#ifndef _CPACINFODG_HPP_
#define _CPACINFODG_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Meca_Res.h"
#define C_NUMBER_OF_BITMAPS 5
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_InformationDialog dialog
class CPA_Meca_InformationDialog : public CDialog
{
// Construction
public:
// standard constructor
CPA_Meca_InformationDialog(CWnd* pParent, CString);
~CPA_Meca_InformationDialog();
// Dialog Data
//{{AFX_DATA(CPA_Meca_InformationDialog)
enum { IDD = IDD_MECA_DIALOG_INFO };
CString m_csMessage;
//}}AFX_DATA
private:
CBitmap m_a_cbBitmaps[C_NUMBER_OF_BITMAPS];
HINSTANCE m_hOldInstance;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_InformationDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
protected:
// Generated message map functions
//{{AFX_MSG(CPA_Meca_InformationDialog)
virtual BOOL OnInitDialog();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
void OnOK();
DECLARE_MESSAGE_MAP()
};
#endif //_CPACINFODG_HPP_

View File

@@ -0,0 +1,51 @@
// CPAMDgNC.hpp : header file
/////////////////////////////////////////////////////////////////////////////
#ifndef _CPA_NEW_CARD_DIALOG_
#define _CPA_NEW_CARD_DIALOG_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Meca_Res.h"
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_NewCardDialog dialog
class CPA_Meca_NewCardDialog : public CDialog
{
// Construction
public:
// standard constructor
CPA_Meca_NewCardDialog( CString csCardName,
CWnd* pParent = NULL);
// Dialog Data
//{{AFX_DATA(CPA_Meca_NewCardDialog)
enum { IDD = IDD_MECA_DIALOG_NEW_CARD };
CString m_csName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_NewCardDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPA_Meca_NewCardDialog)
afx_msg void OnDestroy();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //_CPA_NEW_CARD_DIALOG_

View File

@@ -0,0 +1,59 @@
// cpacqudg.hpp : header file
/////////////////////////////////////////////////////////////////////////////
#ifndef _CPACQUDG_HPP_
#define _CPACQUDG_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Meca_Res.h"
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_QuestionDialog dialog
class CPA_Meca_QuestionDialog : public CDialog
{
// Construction
public:
// standard constructor
CPA_Meca_QuestionDialog(CWnd* pParent, CString);
~CPA_Meca_QuestionDialog();
// Dialog Data
//{{AFX_DATA(CPA_Meca_QuestionDialog)
enum { IDD = IDD_MECA_DIALOG_QUESTION };
CString m_csMessage;
//}}AFX_DATA
private:
CBitmap m_cbBitmap;
HINSTANCE m_hOldInstance;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_QuestionDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
protected:
// Generated message map functions
//{{AFX_MSG(CPA_Meca_QuestionDialog)
afx_msg void OnNo();
afx_msg void OnYes();
virtual BOOL OnInitDialog();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //_CPACQUDG_HPP_

View File

@@ -0,0 +1,61 @@
// CPACSetp.hpp : header file
/////////////////////////////////////////////////////////////////////////////
#ifndef _CAPCSETP_HPP_
#define _CAPCSETP_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Meca_Res.h"
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_EditorSetupDialog dialog
class CPA_Meca_EditorSetupDialog : public CDialog
{
// Construction
public:
CPA_Meca_EditorSetupDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CPA_Meca_EditorSetupDialog)
enum { IDD = IDD_MECA_DIALOG_SETUP };
BOOL m_bMustDisplayModelFieldsInInstance;
BOOL m_bMustConfirmSuppressionInWatch;
BOOL m_bKeepPreviousReference;
BOOL m_bMustDisplayUnallocatedMS;
BOOL m_bMustConfirmUnallocation;
BOOL m_bMustConfirmAllocation;
BOOL m_bMustFillWhenInWatch;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_EditorSetupDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
protected:
// Generated message map functions
//{{AFX_MSG(CPA_Meca_EditorSetupDialog)
afx_msg void OnPaint();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
virtual void OnOK();
//}}AFX_MSG
afx_msg long OnMyHelp(UINT, long);
private:
BOOL m_fn_bEditColor(COLORREF &r_Color);
DECLARE_MESSAGE_MAP()
};
#endif //_CAPCSETP_HPP_

View File

@@ -0,0 +1,126 @@
// Definitions for the class CMyDocument
/////////////////////////////////////////////
#ifndef _EMECDOC_HPP_
#define _EMECDOC_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "EMECCrdT.hpp"
#include "EditMDef.hpp"
//External Modules
#include "CTL.h"
//End of External Modules
class CPA_Meca_ControlView;
class CPA_Meca_MiniStrucView;
class CPA_Meca_Card;
class CPA_Meca_MyDocument
{
public:
CPA_Meca_MyDocument();
~CPA_Meca_MyDocument();
//Attributes
public:
//The lists of Cards
CPA_Meca_CardTypeList m_clCardTypeList;
//The list fo all Cards
CPA_BaseObjectList m_clListOfCards;
//The current Card Type
CPA_Meca_CardType *m_pclCurrentCardType;
//The current Card
CPA_Meca_Card *m_pclCurrentCard;
//Pointers on the views
CPA_Meca_ControlView *m_pclControlView;
CPA_Meca_MiniStrucView *m_pclMiniStrucView;
CPA_DialogList *m_pclDialogList;
//
// CTL_Editor_Control *m_pclFocusedControl;
//Editor's setup variables
//------------------------
CString m_csIniFileName;
//Editor's Help variables
//------------------------
CString m_csHelpFileNameAndPath;
//Editor's preferences
//------------------------
long m_ulListViewHeight;
long m_ulControlViewHeight;
long m_ulEditorWidth;
protected:
private:
//Functions
public:
CPA_Meca_Card *m_pub_fn_vCreateCopyOfCard(CPA_Meca_Card * _pclSourceCard);
/////////////////////
// Editor's aspect //
/////////////////////
//To display a selected Card
void m_fn_vEditCard(CPA_Meca_Card *pclNewCard);
//To display a Card Tyep (<--> the associated controls)
void m_fn_vDisplayCardType( CPA_Meca_CardType *pclNewCardType,
BOOL bForcesRepaint = FALSE);
//To refresh display when Cards have been loaded
void m_fn_vReInitDisplay();
//Sets the data pointers of the controls in tree to the current card's ones
void m_fn_vSetPointersForSelectedCard();
//Sets the data pointers of the controls in tree to the card's ones
void m_fn_vSetPointersForCard(CPA_Meca_Card *pclCard);
//Removes a Card from a Card Type's list
void m_fn_vRemoveCard(CPA_Meca_Card *);
//
void m_fn_vSearchForLoadedCards();
void m_fn_vLoadUnloadedCards();
void m_fn_vUpdateUnLoadedCards();
//
void m_fn_vCheckSpacesInString(CString &r_csStringToCheck);
//Preferences
BOOL m_pub_fn_bSavePreferences();
BOOL m_pub_fn_bLoadPreferences();
protected:
private:
void m_fn_vFillCardsTypeList();
void m_fn_vConstructListOfEnumDescriptors();
void m_fn_vInitialize();
void m_fn_vChangeSize();
// void m_fn_vSetPointersForActor(CPA_CarEditorActor *pclActor);
BOOL m_fn_bReadIniFile();
BOOL m_fn_bWriteIniFile();
//Preferences
void m_pri_fn_vGetEditorCurrentSettings();
};
#endif //_EMECDOC_HPP_

View File

@@ -0,0 +1,18 @@
// Modification functions for Data
//////////////////////////////////////
#ifndef _EMEC_MODIFICATIONS_FUNCTIONS_
#define _EMEC_MODIFICATIONS_FUNCTIONS_
class CTL_Editor_Data;
void EMEC_fn_vModifFloatFromCosToDegre(CTL_Editor_Data *_pclBaseData);
void EMEC_fn_vModifFloatFromDegreToCos(CTL_Editor_Data *_pclBaseData);
void EMEC_fn_vModifFloatFromRadianPerSecondToDegrePerSecond(CTL_Editor_Data *_pclBaseData);
void EMEC_fn_vModifFloatFromDegrePerSecondToRadianPerSecond(CTL_Editor_Data *_pclBaseData);
void EMEC_fn_vModifFloatFromHertzToSecond(CTL_Editor_Data *_pclBaseData);
void EMEC_fn_vModifFloatFromSecondToHertz(CTL_Editor_Data *_pclBaseData);
#endif //_EMEC_MODIFICATIONS_FUNCTIONS_

View File

@@ -0,0 +1,150 @@
// Definition of Strings used to describe the fields in the Mechanics Editor
////////////////////////////////////////////////////////////////////////////
#ifndef _EMEC_FIELDS_DESCRIPTOR_STRINGS_
#define _EMEC_FIELDS_DESCRIPTOR_STRINGS_
////////////////////
// Walk type cards //
/////////////////////
// also used by Jump type cards
const CString g_c_cs_FieldName_Walk_Mass = "Mass (kg)";
const CString g_c_cs_FieldName_Walk_FatherSonLink = "Father-Son link";
const CString g_c_cs_FieldName_Walk_StairsStepHeight = "Stairs Step Height (m)";
const CString g_c_cs_FieldName_Walk_MinLinearSpeed = "Min Linear Speed (m/s)";
const CString g_c_cs_FieldName_Walk_MaxLinearSpeed = "Max Linear Speed (m/s)";
const CString g_c_cs_FieldName_Walk_MinAngularSpeed = "Min Angular Speed (deg/s)";
const CString g_c_cs_FieldName_Walk_MaxAngularSpeed = "Max Angular Speed (deg/s)";
const CString g_c_cs_FieldName_Walk_GroundLimit = "Ground Limit (deg)";
const CString g_c_cs_FieldName_Walk_SlopeLimit = "Slope Limit (deg)";
const CString g_c_cs_FieldName_Walk_WallLimit = "Wall Limit (deg)";
const CString g_c_cs_FieldName_Walk_AtticLimit = "Attic Limit (deg)";
const CString g_c_cs_FieldName_Walk_StepFrontLimit = "Step Front Limit (deg)";
const CString g_c_cs_FieldName_Walk_StepHighLimit = "Step High Limit (deg)";
const CString g_c_cs_FieldName_Walk_IsOrientationFree = "Is Orientation Free";
const CString g_c_cs_FieldName_Walk_OrientationVelocity = "Orientation Velocity (deg/s)";
const CString g_c_cs_FieldName_Walk_IsDTForced = "Is Dt Forced";
const CString g_c_cs_FieldName_Walk_MechanicsEngineFrequency = "Mechanics Eng. Freq.(Hz)";
const CString g_c_cs_FieldName_Walk_IsAgainstWall = "Is Against Wall";
const CString g_c_cs_FieldName_Walk_WallOrientationVelocity = "Wall Orient. Velocity (deg/s)";
const CString g_c_cs_FieldName_Walk_BringDownHeight = "Bring Down Height";
const CString g_c_cs_FieldName_Walk_AirResistingSurface = "Air Resisting Surface";
const CString g_c_cs_FieldName_Walk_GravityRatio = "Gravity Ratio";
////////////////////
// Ski type cards //
////////////////////
const CString g_c_cs_FieldName_Ski_Mass = "Mass (kg)";
const CString g_c_cs_FieldName_Ski_Factor = "Factor";
const CString g_c_cs_FieldName_Ski_MinLinearSpeed = "Min Linear Speed (m/s)";
const CString g_c_cs_FieldName_Ski_MaxLinearSpeed = "Max Linear Speed (m/s)";
const CString g_c_cs_FieldName_Ski_MinAngularSpeed = "Min Angular Speed (deg/s)";
const CString g_c_cs_FieldName_Ski_MaxAngularSpeed = "Max Angular Speed (deg/s)";
const CString g_c_cs_FieldName_Ski_SlideCoef = "Slide Coef";
const CString g_c_cs_FieldName_Ski_TChaseTimeConstant = "TChase Time Constant";
const CString g_c_cs_FieldName_Ski_HandCoef = "HandCoef";
const CString g_c_cs_FieldName_Ski_ReturnCoeff = "ReturnCoeff";
const CString g_c_cs_FieldName_Ski_EdgeCoeff = "EdgeCoeff";
const CString g_c_cs_FieldName_Ski_PlaquageCoeff = "PlaquageCoeff";
const CString g_c_cs_FieldName_Ski_GravityCoeff = "GravityCoeff";
const CString g_c_cs_FieldName_Ski_AlphaFilter = "AlphaFilter";
const CString g_c_cs_FieldName_Ski_InTheAirControl = "InTheAirControl";
const CString g_c_cs_FieldName_Ski_InTheAirGravity = "InTheAirGravity";
const CString g_c_cs_FieldName_Ski_PlaquageGap = "PlaquageGap";
const CString g_c_cs_FieldName_Ski_PlaquageAngle = "PlaquageAngle (deg)";
const CString g_c_cs_FieldName_Ski_MinSpeedToCompute = "MinSpeedToCompute";
/////////////////////
// Swim type cards //
/////////////////////
const CString g_c_cs_FieldName_Swim_Mass = "Mass";
const CString g_c_cs_FieldName_Swim_TractionScale = "Traction Scale";
const CString g_c_cs_FieldName_Swim_AlphaTimeConstant = "Alpha Time Constant";
const CString g_c_cs_FieldName_Swim_ThetaTimeConstant = "Theta Time Constant";
const CString g_c_cs_FieldName_Swim_TractionScaleTimeConstant = "Traction Scale Time Constant";
const CString g_c_cs_FieldName_Swim_AlphaPas = "Alpha Pas";
const CString g_c_cs_FieldName_Swim_ThetaPas = "Theta Pas";
const CString g_c_cs_FieldName_Swim_TractionScalePas = "Traction Scale Pas";
const CString g_c_cs_FieldName_Swim_ArchimedaRadius = "Archimeda Radius";
const CString g_c_cs_FieldName_Swim_LimitVolumeCoef = "Limit Volume Coef";
const CString g_c_cs_FieldName_Swim_CrossingAirWaterCoef = "Crossing Air Water Coef";
const CString g_c_cs_FieldName_Swim_DepthOfLimitVolume = "Depth Of Limit Volume";
const CString g_c_cs_FieldName_Swim_AlphaDecay = "Alpha Decay";
const CString g_c_cs_FieldName_Swim_AlphaMin = "Alpha Min";
const CString g_c_cs_FieldName_Swim_AlphaMax = "Alpha Max";
const CString g_c_cs_FieldName_Swim_AlphaOffset = "Alpha Offset";
//////////////////////
// Stone type cards //
//////////////////////
const CString g_c_cs_FieldName_Stone_Mass = "Mass (kg)";
const CString g_c_cs_FieldName_Stone_Diameter = "Diameter (m)";
const CString g_c_cs_FieldName_Stone_MechanicsEngineFrequency = "Mechanics Eng. Freq.(Hz)";
const CString g_c_cs_FieldName_Stone_Center_X = "Center X";
const CString g_c_cs_FieldName_Stone_Center_Y = "Center Y";
const CString g_c_cs_FieldName_Stone_Center_Z = "Center Z";
/////////////////////
// Raft type cards //
/////////////////////
const CString g_c_cs_FieldName_Raft_TorqueResistance = "Torque Resistance";
const CString g_c_cs_FieldName_Raft_IAxisModificator = "I Axis Modificator";
const CString g_c_cs_FieldName_Raft_JAxisModificator = "J Axis Modificator";
const CString g_c_cs_FieldName_Raft_SinkCoeff = "Sink Coeff";
const CString g_c_cs_FieldName_Raft_SinkMaxDistance = "Sink Max Distance";
const CString g_c_cs_FieldName_Raft_VerticalSpeedTreshold = "Vertical Speed Treshold (m/s)";
const CString g_c_cs_FieldName_Raft_MaxAngularSpeed = "Max Angular Speed (rad/s)";
const CString g_c_cs_FieldName_Raft_AngularSpeedTreshold = "Angular Speed Treshold (rad/s)";
/////////////////////////
// Platform type cards //
/////////////////////////
const CString g_c_cs_FieldName_Platform_Mass = "Mass (kg)";
const CString g_c_cs_FieldName_Platform_MinLinearSpeed = "Min Linear Speed (m/s)";
const CString g_c_cs_FieldName_Platform_MaxLinearSpeed = "Max Linear Speed (m/s)";
const CString g_c_cs_FieldName_Platform_MinAngularSpeed = "Min Angular Speed (deg/s)";
const CString g_c_cs_FieldName_Platform_MaxAngularSpeed = "Max Angular Speed (deg/s)";
const CString g_c_cs_FieldName_Platform_GravityRatio = "Gravity Ratio";
const CString g_c_cs_FieldName_Platform_ViscosityFactor = "Viscosity Factor";
const CString g_c_cs_FieldName_Platform_StiffnessFactor = "Stiffness Factor";
//ANNECY jt {
/////////////////////
// Base type cards //
/////////////////////
const CString g_c_cs_FieldName_Base_Animation = "Animation";
const CString g_c_cs_FieldName_Base_Collide = "Collide";
const CString g_c_cs_FieldName_Base_Gravity = "Gravity";
const CString g_c_cs_FieldName_Base_Tilt = "Tilt";
const CString g_c_cs_FieldName_Base_Gi = "Gi";
const CString g_c_cs_FieldName_Base_Climb = "Climb";
const CString g_c_cs_FieldName_Base_OnGround = "OnGround";
const CString g_c_cs_FieldName_Base_Spider = "Spider";
const CString g_c_cs_FieldName_Base_Shoot = "Shoot";
const CString g_c_cs_FieldName_Base_Swim = "Swim";
const CString g_c_cs_FieldName_Base_CollisionControl = "Collision control";
const CString g_c_cs_FieldName_Base_KeepSpeedZ = "KeepSpeedZ";
const CString g_c_cs_FieldName_Base_SpeedLimit = "SpeedLimit";
const CString g_c_cs_FieldName_Base_Inertia = "Inertia";
const CString g_c_cs_FieldName_Base_Stream = "Stream";
const CString g_c_cs_FieldName_Base_StickOnPlatform = "StickOnPlatform";
const CString g_c_cs_FieldName_Base_Scale = "Scale";
const CString g_c_cs_FieldName_Base_GravityFactor = "g";
const CString g_c_cs_FieldName_Base_Slide = "Slide";
const CString g_c_cs_FieldName_Base_Rebound = "Rebound";
const CString g_c_cs_FieldName_Base_SlopeLimit = "SlopeLimit";
const CString g_c_cs_FieldName_Base_InertiaFactorX = "Ix";
const CString g_c_cs_FieldName_Base_InertiaFactorY = "Iy";
const CString g_c_cs_FieldName_Base_InertiaFactorZ = "Iz";
const CString g_c_cs_FieldName_Base_TiltIntensity = "TiltIntensity";
const CString g_c_cs_FieldName_Base_TiltInertia = "TiltInertia";
const CString g_c_cs_FieldName_Base_TiltOrigin = "TiltOrigin";
const CString g_c_cs_FieldName_Base_MaxSpeed = "MaxSpeed";
//ENDANNECY jt }
#endif //_EMEC_FIELDS_DESCRIPTOR_STRINGS_

View File

@@ -0,0 +1,81 @@
// MainFrm.h : interface of the CPA_Meca_MainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#ifndef _MAINFRM_H_
#define _MAINFRM_H_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "ACP_Base.h"
#include "ITF.h"
#include "IncMEC.h"
#define D_State_Define
#include "IncGAM.h"
#undef D_State_Define
#include "GLI.h"
#define C_ROW_INDEX_CONTROL 0
#define C_ROW_INDEX_INFO 1
#define C_ROW_INDEX_MINI_STRUC 2
//-----------------IR-------------------------
#ifdef D_ED_IR_ACTIVE
#define C_ROW_INDEX_DES_VAR 3
#endif //D_ED_IR_ACTIVE
//--------------------------------------------
class CPA_Meca_MainFrame : public CSplitFrame
{
public:
CPA_Meca_MainFrame();
protected: // create from serialization only
// DECLARE_DYNCREATE(CFrameWnd)
// Attributes
public:
// CPA_Editor_SplitterWnd m_clSplitter;
private:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_MainFrame)
// public:
// virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//}}AFX_VIRTUAL
//Attributes
public:
protected: // control bar embedded members
// Generated message map functions
protected:
//{{AFX_MSG(CPA_Meca_MainFrame)
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// Implementation
public:
virtual ~CPA_Meca_MainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};
/////////////////////////////////////////////////////////////////////////////
#endif //_MAINFRM_H_

View File

@@ -0,0 +1,24 @@
// Mechanics Editor constant Strings
////////////////////////////////////////
#ifndef _EDMECA_STRINGS_
#define _EDMECA_STRINGS_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "x:\cpa\Main\inc\_EditId.h"
//Used for Errors
const CString g_c_csMecaModuleNameForErrors = "Mechanics Editor";
//DLL Name
const CString g_c_csDLLMecaName = C_szDLLMecaName;
//Objects Names
const CString g_c_csMecaCardTypeName = C_szMecaCardTypeName;
#define M_MAKECHAR(a) ((char *)LPCSTR(a))
#endif //_EDMECA_STRINGS_

View File

@@ -0,0 +1,103 @@
// cpacvwms.hpp : header file
/////////////////////////////////////////////////////////////////////////////
#ifndef _CPACVWMS_HPP_
#define _CPACVWMS_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Meca_Res.h"
//External Modules
#include "CTL.h"
//End of External Modules
class CPA_Meca_MyDocument;
class CPA_Meca_Card;
class CPA_Meca_CardType;
class CPA_Meca_CardTypeList;
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MiniStrucView form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class CPA_Meca_MiniStrucView : public CTL_Editor_BaseFormView
{
public:
CPA_Meca_MiniStrucView();
protected:
DECLARE_DYNCREATE(CPA_Meca_MiniStrucView)
// Attributes
public:
CRect m_crEditionRect;
protected:
private:
CPA_Meca_CardType *m_pclOldCardType;
// Implementation
public:
void m_fn_vDisplaySelectedCard();
void m_fn_vUpdateAllDatas();
//To display a Card (<--> Datas)
void m_fn_vEditCard(CPA_Meca_Card *pclNewCard);
//To display a Card Type (<--> the associated controls)
void m_fn_vDisplayCardType( CPA_Meca_CardType *pclNewCardType,
BOOL bMustRepaint = FALSE);
CPA_Meca_MyDocument* m_fn_pclGetDocument();
protected:
private:
void m_fn_vCreateAllMS();
void m_fn_vCreateMS(CPA_Meca_CardTypeList *pclList);
// Form Data
public:
//{{AFX_DATA(CPA_Meca_MiniStrucView)
enum { IDD = IDD_MECA_DIALOG_MS_VIEW };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_MiniStrucView)
//protected:
public:
// virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CPA_Meca_MiniStrucView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(CPA_Meca_MiniStrucView)
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif //_CPACVWMS_HPP_

View File

@@ -0,0 +1,82 @@
// Interface of the CPA_Meca_ControlView class
/////////////////////////////////////////////////////////////////////////////
#ifndef _ED_MECA_CONTROL_VIEW_HPP_
#define _ED_MECA_CONTROL_VIEW_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CPA_Meca_MyDocument;
class CPA_Meca_Card;
class CPA_Meca_CardType;
//###########################################################################
class CPA_Meca_ControlView : public CFormView
{
public:
CPA_Meca_ControlView();
virtual ~CPA_Meca_ControlView();
protected: // create from serialization only
DECLARE_DYNCREATE(CPA_Meca_ControlView)
// Attributes
public:
protected:
private:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPA_Meca_ControlView)
public:
virtual void OnInitialUpdate();
//}}AFX_VIRTUAL
// Implementation
public:
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
CPA_Meca_MyDocument* m_fn_pclGetDocument();
void m_fn_vUpdateCardsNumber(CPA_Meca_CardType *_pclCardType);
void m_fn_vUpdateCardsName();
protected:
private:
// Generated message map functions
protected:
//{{AFX_MSG(CPA_Meca_ControlView)
afx_msg void OnButtonCreate();
afx_msg void OnButtonDelete();
afx_msg void OnButtonRename();
afx_msg void OnSelchangeComboCardTypes();
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnButtonCopy();
afx_msg void OnDestroy();
//}}AFX_MSG
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR * pTTTStruct, LRESULT * pResult);
DECLARE_MESSAGE_MAP()
friend class CPA_Meca_MyDocument;
};
/////////////////////////////////////////////////////////////////////////////
#endif //_ED_MECA_CONTROL_VIEW_HPP_

Binary file not shown.

View File

@@ -0,0 +1,197 @@
; CLW file contains information for the MFC ClassWizard
[General Info]
Version=1
LastClass=CPA_Meca_InformationDialog
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "edmeca.h"
LastPage=0
ClassCount=15
Class1=CPA_Editor_BaseFormView
Class2=CPA_Editor_MiniStructureButton
Class3=CPA_Editor_EditButton
Class4=CPA_Editor_CheckBox
Class5=CPA_Editor_Edit
Class6=CPA_Editor_SplitterWnd
Class7=CPA_Editor_SpinButton
Class8=CPA_Editor_Static
Class9=CPA_Meca_InformationDialog
Class10=CPA_Meca_NewCardDialog
Class11=CPA_Meca_QuestionDialog
Class12=CPA_Meca_EditorSetupDialog
Class13=CPA_Meca_MainFrame
Class14=CPA_Meca_ControlView
Class15=CPA_Meca_MiniStrucView
ResourceCount=6
Resource1=IDD_MECA_DIALOG_NEW_CARD
Resource2=IDD_MECA_DIALOG_QUESTION
Resource3=IDD_MECA_DIALOG_SETUP
Resource4=IDD_MECA_DIALOG_MS_VIEW
Resource5=IDD_MECA_DIALOG_INFO
Resource6=IDD_MECA_DIALOG_CONTROL
[CLS:CPA_Editor_BaseFormView]
Type=0
BaseClass=CFormView
HeaderFile=CPA_VBas.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_VBas.cpp
LastObject=CPA_Editor_BaseFormView
[CLS:CPA_Editor_MiniStructureButton]
Type=0
BaseClass=CButton
HeaderFile=CPA_WBuM.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WBuM.cpp
[CLS:CPA_Editor_EditButton]
Type=0
BaseClass=CButton
HeaderFile=CPA_WBut.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WBut.cpp
[CLS:CPA_Editor_CheckBox]
Type=0
BaseClass=CButton
HeaderFile=CPA_WCkB.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WCkB.cpp
[CLS:CPA_Editor_Edit]
Type=0
BaseClass=CEdit
HeaderFile=CPA_WEdt.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WEdt.cpp
[CLS:CPA_Editor_SplitterWnd]
Type=0
BaseClass=CSplitterWnd
HeaderFile=CPA_WSpl.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WSpl.cpp
[CLS:CPA_Editor_SpinButton]
Type=0
BaseClass=CSpinButtonCtrl
HeaderFile=CPA_WSpn.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WSpn.cpp
[CLS:CPA_Editor_Static]
Type=0
BaseClass=CStatic
HeaderFile=CPA_WSta.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\CPA_WSta.cpp
[CLS:CPA_Meca_InformationDialog]
Type=0
BaseClass=CDialog
HeaderFile=EMECDgIf.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECDgIf.cpp
Filter=D
VirtualFilter=dWC
LastObject=CPA_Meca_InformationDialog
[CLS:CPA_Meca_NewCardDialog]
Type=0
BaseClass=CDialog
HeaderFile=EMECDgNC.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECDgNC.cpp
LastObject=CPA_Meca_NewCardDialog
Filter=D
VirtualFilter=dWC
[CLS:CPA_Meca_QuestionDialog]
Type=0
BaseClass=CDialog
HeaderFile=EMECDgQu.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECDgQu.cpp
Filter=D
VirtualFilter=dWC
LastObject=CPA_Meca_QuestionDialog
[CLS:CPA_Meca_EditorSetupDialog]
Type=0
BaseClass=CDialog
HeaderFile=EMECDgSp.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECDgSp.cpp
[CLS:CPA_Meca_MainFrame]
Type=0
BaseClass=CSplitFrame
HeaderFile=EMECFmMn.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECFmMn.cpp
[CLS:CPA_Meca_ControlView]
Type=0
BaseClass=CFormView
HeaderFile=EMECVwMn.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECVwMn.cpp
Filter=D
VirtualFilter=VWC
LastObject=CPA_Meca_ControlView
[CLS:CPA_Meca_MiniStrucView]
Type=0
BaseClass=CPA_Editor_BaseFormView
HeaderFile=EMECVwMS.hpp
ImplementationFile=\Cpa\TempGrp\TME\Src\EMECVwMS.cpp
[DLG:IDD_MECA_DIALOG_INFO]
Type=1
Class=CPA_Meca_InformationDialog
ControlCount=3
Control1=IDOK,button,1342242817
Control2=IDC_STATIC_TEXT,static,1342312449
Control3=IDC_STATIC_IMAGE,static,1342177294
[DLG:IDD_MECA_DIALOG_NEW_CARD]
Type=1
Class=CPA_Meca_NewCardDialog
ControlCount=4
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_STATIC,static,1342308352
Control4=IDC_EDIT_NAME,edit,1350631552
[DLG:IDD_MECA_DIALOG_QUESTION]
Type=1
Class=CPA_Meca_QuestionDialog
ControlCount=4
Control1=IDYES,button,1342242817
Control2=IDNO,button,1342242816
Control3=IDC_STATIC_QUESTION,static,1342312449
Control4=IDC_EDIT_BIDON,edit,1350631552
[DLG:IDD_MECA_DIALOG_SETUP]
Type=1
Class=CPA_Meca_EditorSetupDialog
ControlCount=10
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
Control3=IDC_STATIC,button,1342177287
Control4=IDC_STATIC,static,1342308354
Control5=IDC_STATIC,static,1342308352
Control6=IDC_STATIC,static,1342308352
Control7=IDC_RECT_TEXT_FIELD_INST,static,1342177298
Control8=IDC_RECT_BG_FIELD_INST,static,1342177298
Control9=IDC_STATIC,button,1342177287
Control10=IDC_CHECK_KEEP_PREVIOUS_EDITION,button,1476481027
[DLG:IDD_MECA_DIALOG_MS_VIEW]
Type=1
Class=CPA_Meca_MiniStrucView
ControlCount=0
[DLG:IDD_MECA_DIALOG_CONTROL]
Type=1
Class=CPA_Meca_ControlView
ControlCount=8
Control1=IDC_STATIC,static,1342308352
Control2=IDC_BUTTON_CREATE,button,1342242880
Control3=IDC_BUTTON_RENAME,button,1476460608
Control4=IDC_BUTTON_DELETE,button,1476460608
Control5=IDC_STATIC_CARD_NUMBER,static,1342312449
Control6=IDC_LIST_CARD_TYPES,listbox,1352728835
Control7=IDC_TEXT_CARD_NAME,static,1342312449
Control8=IDC_BUTTON_COPY,button,1476460608

View File

@@ -0,0 +1,299 @@
//Microsoft Developer Studio generated resource script.
//
#include "Meca_Res.h"
// Generated Help ID header file
#define APSTUDIO_HIDDEN_SYMBOLS
#include "Meca_Res.hm"
#undef APSTUDIO_HIDDEN_SYMBOLS
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"Meca_Res.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 12, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""EdMeca.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""l.fra\\afxres.rc"" // Standard components\r\n"
"#endif\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "..\\res\\EdCarac.ico"
IDI_ICON_BUTTON_CREATE ICON DISCARDABLE "..\\res\\icon1.ico"
IDI_ICON_BUTTON_DELETE ICON DISCARDABLE "..\\res\\icon_but.ico"
IDI_ICON_BUTTON_RENAME ICON DISCARDABLE "..\\res\\ico00001.ico"
IDI_ICON_BUTTON_COPY ICON DISCARDABLE "..\\res\\ico00002.ico"
IDI_TME_DLGBAR_ICON ICON DISCARDABLE "..\\res\\tme_dlgb.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MECA_DIALOG_CONTROL DIALOG DISCARDABLE 0, 0, 170, 114
STYLE DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Current type of Card :",IDC_STATIC,1,1,67,9
PUSHBUTTON "Cr<43>er",IDC_BUTTON_CREATE,139,0,25,24,BS_ICON
PUSHBUTTON "Renommer",IDC_BUTTON_RENAME,139,25,25,24,BS_ICON |
WS_DISABLED
PUSHBUTTON "Supprimer",IDC_BUTTON_DELETE,139,50,25,24,BS_ICON |
WS_DISABLED
CTEXT "Number of Cards",IDC_STATIC_CARD_NUMBER,74,0,61,10,
SS_SUNKEN
LISTBOX IDC_LIST_CARD_TYPES,0,11,135,89,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CTEXT "Card's Name",IDC_TEXT_CARD_NAME,0,102,135,11,SS_SUNKEN
PUSHBUTTON "Supprimer",IDC_BUTTON_COPY,139,75,25,24,BS_ICON |
WS_DISABLED
END
IDD_MECA_DIALOG_QUESTION DIALOG DISCARDABLE 0, 0, 277, 67
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mechanics Editor - Question"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Yes",IDYES,108,46,50,14
PUSHBUTTON "No",IDNO,170,46,50,14
CTEXT "Static",IDC_STATIC_QUESTION,59,7,211,35,SS_SUNKEN
EDITTEXT IDC_EDIT_BIDON,3,7,40,38,ES_AUTOHSCROLL
END
IDD_MECA_DIALOG_SETUP DIALOGEX 0, 0, 225, 115
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Mechanics Editor - Setup"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,55,98,50,14
PUSHBUTTON "Annuler",IDCANCEL,119,98,50,14
GROUPBOX "Aspect de l'<27>diteur",IDC_STATIC,6,47,211,43
RTEXT "Nom des champs :",IDC_STATIC,22,71,115,8
LTEXT "Fond :",IDC_STATIC,159,58,21,8
LTEXT "Texte :",IDC_STATIC,133,58,23,8
CONTROL "",IDC_RECT_TEXT_FIELD_INST,"Static",SS_ETCHEDFRAME,140,
70,13,12
CONTROL "",IDC_RECT_BG_FIELD_INST,"Static",SS_ETCHEDFRAME,162,70,
13,12
GROUPBOX "G<>n<EFBFBD>ral",IDC_STATIC,6,2,211,41
CONTROL "ESSAI",IDC_CHECK_KEEP_PREVIOUS_EDITION,"Button",
BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_NOTIFY | WS_DISABLED |
WS_TABSTOP,12,11,197,10,0,
HIDC_CHECK_KEEP_PREVIOUS_EDITION
END
IDD_MECA_DIALOG_MS_VIEW DIALOG DISCARDABLE 0, 0, 72, 17
STYLE DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
BEGIN
END
IDD_MECA_DIALOG_INFO DIALOG DISCARDABLE 0, 0, 277, 67
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mechanics Editor - Information"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Continue !",IDOK,113,46,50,14
CTEXT "Static",IDC_STATIC_TEXT,59,7,211,35,SS_SUNKEN
CONTROL "",IDC_STATIC_IMAGE,"Static",SS_BITMAP,7,7,37,34
END
IDD_MECA_DIALOG_NEW_CARD DIALOG DISCARDABLE 0, 0, 196, 54
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mechanics Editor - Card creation"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,45,36,50,14
PUSHBUTTON "Cancel",IDCANCEL,100,36,50,14
LTEXT "Donnez un nom <20> la nouvelle fiche :",IDC_STATIC,0,5,144,
8
EDITTEXT IDC_EDIT_NAME,0,15,196,14,ES_AUTOHSCROLL
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Application ""Editeur de M<>canique""\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "EdMeca\0"
VALUE "LegalCopyright", "Copyright <20> 1996\0"
VALUE "OriginalFilename", "EdMeca.dll\0"
VALUE "ProductName", "Editeur de M<>canique\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_MECA_DIALOG_CONTROL, DIALOG
BEGIN
BOTTOMMARGIN, 113
END
IDD_MECA_DIALOG_QUESTION, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 270
TOPMARGIN, 7
BOTTOMMARGIN, 60
END
IDD_MECA_DIALOG_SETUP, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 218
TOPMARGIN, 7
BOTTOMMARGIN, 108
END
IDD_MECA_DIALOG_MS_VIEW, DIALOG
BEGIN
BOTTOMMARGIN, 16
END
IDD_MECA_DIALOG_INFO, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 270
TOPMARGIN, 7
BOTTOMMARGIN, 60
END
IDD_MECA_DIALOG_NEW_CARD, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 189
TOPMARGIN, 7
BOTTOMMARGIN, 47
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BITMAP_QUESTION BITMAP DISCARDABLE "..\\res\\bitmap_q.bmp"
IDB_BITMAP_INFO1 BITMAP DISCARDABLE "..\\res\\bitmap_i.bmp"
IDB_BITMAP_INFO2 BITMAP DISCARDABLE "..\\res\\bmp00010.bmp"
IDB_BITMAP_INFO3 BITMAP DISCARDABLE "..\\res\\bmp00011.bmp"
IDB_BITMAP_INFO4 BITMAP DISCARDABLE "..\\res\\bmp00012.bmp"
IDB_BITMAP_INFO5 BITMAP DISCARDABLE "..\\res\\bmp00013.bmp"
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE 12, 1
#pragma code_page(1252)
#endif
#include "EdMeca.rc2" // non-Microsoft Visual C++ edited resources
#include "l.fra\afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,13 @@
//
// EDCARAC.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,82 @@
// Constants and defines for the definition of ths list of MS
///////////////////////////////////////////////////////////////
#ifndef _EDIT_MECA_DEF_HPP_
#define _EDIT_MECA_DEF_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "SCR.h"
//Include here the header where are defined the motor structures
//#undef extern
//Eventually add here the other motor useful headers
//#include "enum.h"
//...
//Declare here the filling functions for the MS you have created
class CPA_Meca_Card;
void fn_vFillCard1(CPA_Meca_Card *pclCard);
void fn_vFillCard2(CPA_Meca_Card *pclCard);
void fn_vFillCard3(CPA_Meca_Card *pclCard);
void fn_vFillCard4(CPA_Meca_Card *pclCard);
void fn_vFillCard5(CPA_Meca_Card *pclCard);
void fn_vFillCard6(CPA_Meca_Card *pclCard);
void fn_vFillCard7(CPA_Meca_Card *pclCard);
void fn_vFillCard8(CPA_Meca_Card *pclCard);
void fn_vFillCard9(CPA_Meca_Card *pclCard);
void fn_vFillCard10(CPA_Meca_Card *pclCard);
void fn_vFillCard11(CPA_Meca_Card *pclCard);
void fn_vFillCard12(CPA_Meca_Card *pclCard);
void fn_vFillCard13(CPA_Meca_Card *pclCard);
void fn_vFillCard14(CPA_Meca_Card *pclCard);
void fn_vFillCardRay2Egypte1(CPA_Meca_Card *pclCard);
void fn_vSaveCard1(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard2(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard3(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard4(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard5(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard6(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard7(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard8(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard9(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard10(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard11(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard12(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard13(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCard14(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
void fn_vSaveCardRay2Egypte1(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard);
//*********************************************************************
//Other defines to simplify MS and pointers definitions
#define EDMEC_READ_ONLY TRUE
#define EDMEC_READ_WRITE FALSE
//Controls Spacing
#define EDMEC_AUTO_SPACE EDCAR_SPACING_AUTO
#define EDMEC_SINGLE_LINE EDCAR_SPACING_SINGLE_LINE
#define EDMEC_FIXED_SIZE EDCAR_SPACING_FIXED_SIZE
//Constants for integers declarations
#define EDMEC_SIGNED_INT TRUE
#define EDMEC_UNSIGNED_INT FALSE
#define EDMEC_CHAR_INT 1
#define EDMEC_SHORT_INT 2
#define EDMEC_LONG_INT 4
//Constants for decimal declarations
#define EDMEC_FLOAT 4
#define EDMEC_DOUBLE 8
#define EDMEC_LONG_DOUBLE 10
//Constants for data level declarations
#define LEVEL_1 EDCAR_DATA_LEVEL_1
#define LEVEL_2 EDCAR_DATA_LEVEL_2
#define LEVEL_3 EDCAR_DATA_LEVEL_3
#endif //_EDIT_MECA_DEF_HPP_

Binary file not shown.

View File

@@ -0,0 +1,13 @@
//
// EDCARAC.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,49 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by EdMeca.rc
//
#define IDR_MAINFRAME 128
#define IDD_MECA_DIALOG_CONTROL 130
#define IDD_MECA_DIALOG_SETUP 162
#define IDB_BITMAP_QUESTION 168
#define IDD_MECA_DIALOG_NEW_CARD 170
#define IDI_ICON_BUTTON_CREATE 171
#define IDI_ICON_BUTTON_DELETE 172
#define IDI_ICON_BUTTON_RENAME 173
#define IDI_ICON_BUTTON_COPY 174
#define IDI_TME_DLGBAR_ICON 176
#define IDB_BITMAP_INFO1 178
#define IDB_BITMAP_INFO2 179
#define IDB_BITMAP_INFO3 180
#define IDB_BITMAP_INFO4 181
#define IDB_BITMAP_INFO5 182
#define IDD_MECA_DIALOG_MS_VIEW 311
#define IDC_RECT_TEXT_FIELD_INST 1062
#define IDC_RECT_BG_FIELD_INST 1063
#define IDC_CHECK_KEEP_PREVIOUS_EDITION 1083
#define IDC_STATIC_QUESTION 1091
#define IDD_MECA_DIALOG_QUESTION 1091
#define IDD_MECA_DIALOG_INFO 1092
#define IDC_STATIC_IMAGE 1097
#define IDC_STATIC_TEXT 1100
#define IDC_EDIT_BIDON 1102
#define IDC_BUTTON_CREATE 1105
#define IDC_BUTTON_RENAME 1106
#define IDC_EDIT_NAME 1106
#define IDC_BUTTON_DELETE 1107
#define IDC_BUTTON_COPY 1108
#define IDC_STATIC_CARD_NUMBER 1109
#define IDC_LIST_CARD_TYPES 1110
#define IDC_TEXT_CARD_NAME 1111
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 177
#define _APS_NEXT_COMMAND_VALUE 32785
#define _APS_NEXT_CONTROL_VALUE 1114
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,5 @@
// Microsoft Developer Studio generated Help ID include file.
// Used by EdMeca.rc
//
#define HIDC_CHECK_KEEP_PREVIOUS_EDITION \
0x80a2043b // IDD_MECA_DIALOG_SETUP

View File

@@ -0,0 +1,18 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef __STDAAFX_H__
#define __STDAAFX_H__
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif //__STDAAFX_H__

View File

@@ -0,0 +1,153 @@
// Header for the definition of the class representing a Mechanical Card
//////////////////////////////////////////////////////////////////////////
#ifndef _CPA_MECA_CARD_HPP_
#define _CPA_MECA_CARD_HPP_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <afxtempl.h>
#include "ACP_Base.h"
#include "ITF.h"
#include "IncMEC.h"
#define D_State_Define
#include "IncGAM.h"
#undef D_State_Define
#include "GLI.h"
//External Modules
#include "CTL.h"
//End of External Modules
class CPA_Meca_CardType;
class CPA_Meca_Card : public CPA_SaveObject
{
public:
CPA_Meca_Card(CString csName,
CPA_Meca_CardType *pclCardType,
CString csEngineFileName,
CString csEngineActionName,
void *pvBaseAddress,
BOOL bCanbBeLoaded = FALSE);
~CPA_Meca_Card();
//---------------------------------------
//Attributes
public:
//The list of data
CTL_Editor_DataList m_clDataList;
BOOL m_bDataCreated;
//Undo Manager
CPA_EditManager m_clUndoManager;
protected:
private:
//The Name of the Card
// CString m_csCardName;
//The Base Address for Data (ie the address where the Structure is located)
void *m_pvBaseAddress;
//The base Card Type
CPA_Meca_CardType *m_pclCardType;
//
CString m_pri_csActionName;
CString m_pri_csCompleteFileName;
CString m_pri_csReferencedFileName;
//
BOOL m_pri_bIsNotified;
//---------------------------------------
//Functions
public:
void *GetEngineStruct();
void *m_fn_pvGetBaseAddress();
void m_fn_vSetBaseAddress(void *);
CString m_fn_csGetCardName();
void m_fn_vSetCardName(CString);
CPA_Meca_CardType *m_fn_pclGetCardType();
void m_fn_pclSetCardType(CPA_Meca_CardType *);
//Virtual functions
virtual long GetDataType(void);
virtual void *GetData(void);
virtual BOOL fn_bCanBeNotified(void);
//For saving
static void s_m_fn_vCallBackSaveMecaCard( SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction);
void m_fn_vSaveMecaCard(SCR_tdst_File_Description *p_tdstFile,
SCR_tde_Ntfy_Action _eAction);
BOOL m_fn_bLoadIfUnloaded();
//
CString m_pub_fn_csGetActionName();
void m_pub_fn_vSetActionName(CString);
CString m_pub_fn_csGetReferencedFileName();
CString m_pub_fn_csGetCompleteFileName();
void m_pub_fn_vSetCompleteFileName(CString);
//
BOOL m_pub_fn_bIsNotified();
//Notifications
virtual void fn_vNotifySave(void);
virtual void fn_vNotifyUnSave(void);
virtual void fn_vNotifyRestore(void);
virtual void fn_vNotifyRename(void);
//ANNECY jt {
void m_pri_fn_vGetAllMotorValues();
//ENDANNECY jt }
protected:
private:
//ANNECY jt {
// void m_pri_fn_vGetAllMotorValues();
//ENDANNECY jt }
CString m_pri_fn_csComputeReferencedSectionName();
CString m_pri_fn_csComputeCompleteSectionName();
};
//#####################################################################
// Definition of the class for the list of mini-structures
class CPA_Meca_CardList : public CList<CPA_Meca_Card *, CPA_Meca_Card *>
{
public:
CPA_Meca_CardList();
~CPA_Meca_CardList();
CPA_Meca_Card* m_fn_pclAddElement(CString,
CPA_Meca_CardType *,
void *,
CString csFileName = "",
CString csSectionName = "",
BOOL bCanbBeLoaded = FALSE);
void m_fn_vEmptyList();
//Returns the first available (i.e. loaded) Card in the List
CPA_Meca_Card *m_pub_fn_pclGetFirstAvailableCard();
};
#endif //_CPA_MECA_CARD_HPP_

View File

@@ -0,0 +1,298 @@
//**************************************
// This is the base class of your DLL interface
// All methods of CPA_ToolDLLBase are
// present in that class.
//**************************************
#ifndef __MECA_INTERF_HPP__
#define __MECA_INTERF_HPP__
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "ACP_Base.h"
#include "ITF.h"
#include "IncMEC.h"
#define D_State_Define
#include "IncGAM.h"
#undef D_State_Define
#include "GLI.h"
// YB //
// Specific Includes //
#include "EMECDoc.hpp"
#include "EMECFmMn.hpp"
// End YB //
// if you want only one instance of your DLL
// activate the next line
//#define DLL_ONLY_ONE_INSTANCE
//----------------------------------------------------------
// Tool DLL interface class
//----------------------------------------------------------
class CPA_Meca_Interface : public CPA_ToolDLLBase
{
private:
public:
CPA_Meca_Interface(void);
// ~CPA_Meca_Interface(void);
/*===========================================================================
Virtual Functions
=========================================================================*/
public:
// To pre translate all messages
// virtual BOOL fn_bPreTranslateMessage(MSG * /*p_stMsg*/) { return FALSE; };
// Called just after editor has been inserted in list of all editors
virtual void fn_vJustAfterRegistered(void);
// Called just before windows main loop processing
virtual void fn_vConstruct(void);
// Called to refresh datas of DLL if "fn_vCanBeRefresh" returns TRUE
// virtual void fn_vRefreshDatas(void);
// Called when level has changed
// virtual void fn_vLevelHasChanged (void) {};
virtual void fn_vLevelChanges(void);
virtual BOOL fn_bLoadBaseObject (CPA_BaseObject *p_oObject);
virtual void fn_vAfterSaveAll(void);
/*===========================================================================
Current Editor
=========================================================================*/
virtual tdePermission fn_eAcceptNewEditor (CPA_EditorBase *pNewEditor);
virtual BOOL fn_bCanActivateEditor(CPA_List<CPA_BaseObject> *pParams);
virtual void fn_vOnActivateEditor(CPA_List<CPA_BaseObject> *pParams, BOOL bBackActivated=FALSE);
virtual BOOL fn_bCanCloseEditor(void);
virtual void fn_vOnCloseEditor(void);
public:
/*===========================================================================
Messages from Evt_Editor
=========================================================================*/
// for changes
// virtual void fn_vOnChangeDevice (void) { }
// Editor Modifs
// virtual void fn_vOnModifDelete (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
// virtual void fn_vOnModifParent (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
// virtual void fn_vOnModifCopy (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
// virtual void fn_vOnModifName(CPA_SuperObject *pEdObj, CString csInitalName, CString csFinalName, tdeTypeModif eType, tdeStatus eStatus);
// virtual void fn_vOnSelect(CPA_SuperObject *pEdObj, tdeTypeModif eType, tdeStatus eStatus);
// virtual void fn_vOnModifInsert(CPA_SuperObject *pEdObj, CPA_SuperObject *pParent,
// tdstPosition *p_stPosition, tdeTypeModif eType, tdeStatus eStatus) { }
// Moves
// virtual void fn_vOnModifMove(CPA_List<EDT_SavePos> *pListObjects, CPA_List<EDT_SaveGlobalPos> *pListConcerned, tdeTypeModif eType, tdeStatus eStatus) { }
// virtual void fn_vOnBeginMove(CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus) { }
// virtual void fn_vOnMoving(CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus) { }
// Models
// virtual void fn_vOnAddModelToList(CPA_ObjectDLLBase *pOwnerDLL, CString csListName, CString csModelName, tdeTypeModif eType) { }
// permission
// virtual BOOL fn_bAcceptModifDelete(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
// virtual BOOL fn_bAcceptModifParent(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// virtual BOOL fn_bAcceptModifCopy(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
// virtual BOOL fn_bAcceptModifTranslate(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// virtual BOOL fn_bAcceptModifRotate(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus) { return TRUE; }
// virtual BOOL fn_bAcceptModifInsert(CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdeStatus eStatus) { return TRUE; }
// virtual BOOL fn_bAcceptModifScale(CPA_SuperObject *pEdObj, tdeStatus eStatus) { return TRUE; }
// virtual BOOL fn_bAcceptModifName(CPA_SuperObject *pEdObj, tdeStatus eStatus);
// virtual BOOL fn_bAcceptMultiSelect(void) { return TRUE; }
// to precise selection
// virtual tdeTypeAnswer fn_bAcceptSelect(CPA_SuperObject *pEdObj, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking, tdeStatus eStatus);
/*===========================================================================
Dialog List
=========================================================================*/
// virtual BOOL fn_bSetCustomTest (CPA_DialogList *pDialog) { return FALSE; }
// virtual BOOL fn_bCustomTestFunction (CString csCurrentType, CString csTestName, CPA_SaveObject *pEdObj) { return TRUE; }
/*===========================================================================
General Purpose
=========================================================================*/
long OnQueryAction (CPA_EditorBase * /*p_oSender*/, WPARAM, LPARAM);
// virtual long OnQueryInfos (CPA_DLLBase * /*p_oSender*/, WPARAM, LPARAM) { return 0; };
// virtual long OnQueryOpen (CPA_DLLBase * /*p_oSender*/, WPARAM, LPARAM) { return 0; };
// virtual long OnQueryClose (CPA_DLLBase * /*p_oSender*/, WPARAM, LPARAM) { return 0; };
/*===========================================================================
Coherence
=========================================================================*/
// virtual BOOL fn_bOnInvalidateLink (CPA_ObjectBase *pOwner, CPA_ObjectBase *pReferencedObject, BOOL bDestroyed) { return FALSE; }
// virtual void fn_vOnRestoreLink (CPA_ObjectBase *pOwner, CPA_ObjectBase *pReferencedObject) { }
/*===========================================================================
Messages
=========================================================================*/
// focus
virtual void fn_vHasLostFocus (void);
virtual BOOL fn_bHasGainedFocus (void);
// engine - editor
virtual void fn_vBeforeEngine (void);
virtual void fn_vBeforeEditor (void);
// engine
// virtual BOOL fn_bAcceptToRunEngine(void) { return TRUE; };
// virtual BOOL fn_bAcceptToRunTimerEngine (void) { return TRUE; };
// end appli
// virtual void fn_vJustBeforeClosing (void) { };
// virtual BOOL fn_bAcceptToExit (void) { return TRUE; };
// keys
// virtual BOOL _OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags) { return FALSE; };
// virtual BOOL _OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags) { return FALSE; };
// mouse
// virtual BOOL _OnMouseMove (UINT nFlags, tdstMousePos *p_stPos, MTH3D_tdstVector *p_stVect) { return FALSE; };
// virtual BOOL _OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
// virtual BOOL _OnRButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
// virtual BOOL _OnLButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
// virtual BOOL _OnRButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo) { return FALSE; };
// virtual BOOL _OnLButtonUp (UINT nFlags, tdstMousePos *p_stPos) { return FALSE; };
// virtual BOOL _OnRButtonUp (UINT nFlags, tdstMousePos *p_stPos) { return FALSE; };
// command
// virtual BOOL _OnCommand (UINT IDCmdMsg) { return FALSE; };
// virtual BOOL _OnUpdateCommandUI (UINT uiID, CCmdUI *pCmdUI) { return FALSE; };
// dragdrop
// virtual BOOL _OnDragDropEnd (WPARAM wParam, LPARAM lParam) { return FALSE; };
// virtual BOOL _OnDragDropMove (WPARAM wParam, LPARAM lParam) { return FALSE; };
// virtual BOOL _OnDragDropLooseFocus (WPARAM wParam, LPARAM lParam) { return FALSE; };
// virtual BOOL _OnDragDropGainFocus (WPARAM wParam, LPARAM lParam) { return FALSE; };
// add objects to draw
// virtual void fn_vAddObjectsToDraw (GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2) { };
// virtual void fn_vAddObjectsToDraw2 (GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2) { };
/*===========================================================================
Reinit
=========================================================================*/
// virtual void fn_vOnChangeRoot (void) { };
// virtual void fn_vOnChangeWorld (void) { };
/*===========================================================================
for Dialog List
=========================================================================*/
virtual CPA_BaseObject *GetDialogSelection(CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDrawMode);
virtual void GetListsForDialog (CPA_DialogList *pDialog);
// virtual BOOL fn_bOnSelChangeHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pSelectedObject) { return FALSE; };
// virtual BOOL fn_bOnDblClkHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pSelectedObject) { return FALSE; };
virtual BOOL fn_bOnSelChangeListObjects(CPA_DialogList *pDialog, CString csTypeName, CPA_BaseObject *pSelectedObject, BOOL bUnselect);
// virtual BOOL fn_bOnDblClkListObjects (CPA_DialogList *pDialog, CString csTypeName, CPA_SaveObject *pSelectedObject) { return FALSE; };
// virtual BOOL fn_bCanDragItemInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pObjectToDrag) { return FALSE; };
// virtual BOOL fn_bCanDropItemInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pObjectToDrop, CPA_SuperObject *pTarget) { return FALSE; };
// virtual BOOL fn_bOnDragDropInHierarchyTree (CPA_DialogList *pDialog, CString csTypeName, CPA_SuperObject *pObject, CPA_SuperObject *pTarget) { return FALSE; };
virtual BOOL fn_bOnSelChangeComboList(CPA_DialogList *pDialog, CString csTypeName);
virtual BOOL fn_bOnButtonTest(CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw);
virtual void fn_vInitDefaultParameters(CPA_DialogList *pDialog);
virtual void fn_vSetANewTest(CPA_DialogList *pDialog, CString csCurrentList);
virtual BOOL fn_bTestFunction(CString csCurrentType, CString csTestName, CPA_BaseObject *pEdObj);
/*===========================================================================
Dialog Bar - Mircea Dunka 31 Aug. 1998
=========================================================================*/
void fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn);
/*===========================================================================
SubMenus and PopupMenu
=========================================================================*/
virtual BOOL fn_bDefineSubMenu(EDT_SubMenu *_p_oEDTSubMenu);
virtual void _OnSubMenuCommand(EDT_SubMenu *_p_oEDTSubMenu,UINT uiMsgID);
virtual BOOL fn_bDefinePopupMenu(EDT_PopUpMenu *pPopup, CPA_List<CPA_SuperObject> *pSelection, BOOL bAsCurrentEditor);
virtual void _OnPopUpMenuCommand(UINT m_IDCmdMsg);
// Hierarchy
// virtual CPA_SuperObject *GetNewEditorInstance(HIE_tdxHandleToSuperObject pEngineInstance);
// virtual void fn_vUpdateEditorInstance(CPA_SuperObject *pEditorInstance, HIE_tdxHandleToSuperObject pEngineInstance);
// virtual BOOL fn_bCanHandleThisType(long lEngineType);
// Models & Instances
// virtual void fn_vInitListByType(CPA_World *pWorld);
// virtual void fn_vInitListsOfModels(void);
// virtual void fn_vSaveListModels(CString csListName, CPA_List<EDT_Model> *pListModels);
// virtual CString fn_csLoadListModels(void);
// virtual EDT_Model *GetNewModel(CString csListName);
// virtual BOOL fn_bCanLoadNewModel(CString csListName);
// virtual BOOL fn_bCanDeleteModel(CString csListName) { return FALSE; };
// virtual BOOL fn_bCanSaveListModels(CString csListName);
// virtual BOOL fn_bCanLoadListModels(void);
// virtual void fn_vOnLoadNewModel(CString csListName, EDT_Model *pNewModel);
// virtual CPA_SuperObject *GetNewInstance(CString csTypeName, CString csModelName, CPA_SuperObject *pParent);
// virtual tdeTypeSO GetTypeInstance(CString csTypeName, CString csModelName);
// virtual CPA_SuperObject * GetParentForInsertion (CString csTypeName, CString csModelName, tdstPosition *p_stPosition) { return NULL; }
// virtual BOOL fn_bChooseInsertPosition(CPA_SuperObject *pNewInstance, CPA_SuperObject *pParent, tdstPosition *p_stPosition);
// objects
// virtual CPA_Object * GetNewObject (CString csObjectFile, CString csObjectName, FILE *p_fFile, CPA_MainWorld *p_oMainWorld) { return NULL; }
// virtual CPA_Object *Duplicate(CPA_Object *pObject, CPA_SuperObject *pNewSuperObject);
// virtual CPA_SuperObject *GetCopyOfProtectedChild (CPA_SuperObject *pInitialChild, CPA_SuperObject *pNewOwner);
// permissions for EvtEditor
// virtual BOOL fn_bAcceptAsParent(CPA_Object *pChild, CPA_Object *pParent);
// virtual BOOL fn_bAcceptAsChild(CPA_Object *pParent, CPA_Object *pChild);
// when insertion is canceled
// virtual void fn_vOnCancelInsertion(CPA_SuperObject *pInstance);
////////
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//(YB) Editor's specific members
//Attributes
public:
//The (one and only) document
CPA_Meca_MyDocument m_clDocument;
//The main frame
CPA_Meca_MainFrame *m_pclMecaMainFrame;
protected:
private:
CString m_csEditorVersion;
CPA_Meca_Card *m_pri_pclSelectedCard;
//Fucntions
public:
CPA_Meca_MyDocument *m_fn_pclGetDocument();
protected:
private:
void m_fn_vShowEditor();
void m_fn_vHideEditor();
//(YB) End of Editor's specific members
//--------------------------------------------------------------------------
};
// YB //
extern CPA_Meca_Interface *g_pclInterface;
// End YB //
extern tdstDLLIdentity g_stMecaDLLIdentity;
#endif // __MECA_INTERF_HPP_

View File

@@ -0,0 +1 @@
#define IDH_GENERAL 10000

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[TME.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project

View File

@@ -0,0 +1,32 @@
========================================================================
DYNAMIC LINK LIBRARY : TME Project Overview
========================================================================
AppWizard has created this TME DLL for you.
This file contains a summary of what you will find in each of the files that
make up your TME application.
TME.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
TME.cpp
This is the main DLL source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named TME.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,12 @@
// Saving functions
//////////////////////////////
// Mechanics Editor
/////////////////////////////////////////
#include "StdAfx.h"
void m_fn_vSaveMecaCard()
{
}

View File

@@ -0,0 +1,126 @@
// Allocation and free functions for all types of Mechanics
////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECAllo.hpp"
#include "_MecCard.hpp"
#include "_MInterf.hpp"
#include "IncMEC.h"
//Unallocation functions
// ANNECY AV CLEAN_MEC {
/*
//*************************************************************
void fn_vUnalloc1(CPA_Meca_Card *pclCard)
{
DNM_stMecWalkIdCard *p_tdstStruct = (DNM_stMecWalkIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc2(CPA_Meca_Card *pclCard)
{
DNM_tdstMecSkiIdCard *p_tdstStruct = (DNM_tdstMecSkiIdCard *)pclCard->m_fn_pvGetBaseAddress();
// free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc3(CPA_Meca_Card *pclCard)
{
DNM_stMecSwimIdCard *p_tdstStruct = (DNM_stMecSwimIdCard *)pclCard->m_fn_pvGetBaseAddress();
// free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc4(CPA_Meca_Card *pclCard)
{
DNM_tdstMecJumpIdCard *p_tdstStruct = (DNM_tdstMecJumpIdCard *)pclCard->m_fn_pvGetBaseAddress();
// free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc5(CPA_Meca_Card *pclCard)
{
DNM_stMecFlyIdCard *p_tdstStruct = (DNM_stMecFlyIdCard *)pclCard->m_fn_pvGetBaseAddress();
// free(p_tdstStruct);
}
*/
// END ANNECY AV }
//*************************************************************
void fn_vUnalloc6(CPA_Meca_Card *pclCard)
{
DNM_stMecCameraIdCard *p_tdstStruct = (DNM_stMecCameraIdCard *)pclCard->m_fn_pvGetBaseAddress();
// free(p_tdstStruct);
}
// ANNECY AV CLEAN_MEC {
/*
//*************************************************************
void fn_vUnalloc7(CPA_Meca_Card *pclCard)
{
DNM_stMecWalkIdCard *p_tdstStruct = (DNM_stMecWalkIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc8(CPA_Meca_Card *pclCard)
{
DNM_stMecWalkIdCard *p_tdstStruct = (DNM_stMecWalkIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc9(CPA_Meca_Card *pclCard)
{
DNM_stMecStoneIdCard *p_tdstStruct = (DNM_stMecStoneIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc10(CPA_Meca_Card *pclCard)
{
DNM_tdstMecHelicopterIdCard *p_tdstStruct = (DNM_tdstMecHelicopterIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc11(CPA_Meca_Card *pclCard)
{
DNM_tdstMecHookIdCard *p_tdstStruct = (DNM_tdstMecHookIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc12(CPA_Meca_Card *pclCard)
{
DNM_tdstMecShootingIdCard *p_tdstStruct = (DNM_tdstMecShootingIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc13(CPA_Meca_Card *pclCard)
{
DNM_tdstMecRaftIdCard *p_tdstStruct = (DNM_tdstMecRaftIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
//*************************************************************
void fn_vUnalloc14(CPA_Meca_Card *pclCard)
{
DNM_tdstMecWalkOPIdCard *p_tdstStruct = (DNM_tdstMecWalkOPIdCard *)pclCard->m_fn_pvGetBaseAddress();
//free(p_tdstStruct);
}
*/
// END ANNECY AV }
//ANNECY jt {
//*************************************************************
void fn_vUnallocRay2Egypte1(CPA_Meca_Card *pclCard)
{
DNM_tdstMecBaseIdCard *p_tdstStruct = (DNM_tdstMecBaseIdCard *)pclCard->m_fn_pvGetBaseAddress();
}
//ENDANNECY jt }

View File

@@ -0,0 +1,35 @@
// CallBacks
//
// YB
///////////////////////
#include "StdAfx.h"
#include "EMECClBk.hpp"
#include "EMECCStr.hpp"
#include "_MECCard.hpp"
//************************************************************************************
BOOL TME_fn_bControlCanBeDisplayedCallBack(CTL_Editor_Control *_pclSenderControl)
{
return TRUE;
}
//************************************************************************************
void TME_fn_vCallBackWhenADataHasChanged(CTL_Editor_Data *_pclChangedData,
CTL_tdeUpdateReason _eReason,
long _lUserDefinedReason /*/ 0*/)
{
if ( _eReason == CTL_UPDATE_REASON__DATA_MODIFIED_BY_USER )
{
//Gets Parent Card
CTL_OwnerData *pclOwnerData = _pclChangedData->m_pub_fn_pclGetOwnerDataWithName(TME_g_c_cs_DataOwnerData_ParentCard);
if ( pclOwnerData != NULL )
{
CPA_Meca_Card *pclParentCard = (CPA_Meca_Card *)pclOwnerData->m_pub_fn_pvGetDataPtr();
pclParentCard->fn_vNotifySave();
}
}
}

View File

@@ -0,0 +1,308 @@
// Implementation for the definition of the class representing a Mechanical Card
/////////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECCrdT.hpp"
#include "EMECVwMS.hpp"
#include "EMECDoc.hpp"
#include "EMECFmMn.hpp"
#include "EMECCnst.hpp"
#include "EMECDgQu.hpp"
#include "EMECClBk.hpp"
#include "EMECCStr.hpp"
#include "_Minterf.hpp"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//***************************************************************************
CPA_Meca_CardType::CPA_Meca_CardType(CString csName,
DNM_tdeMechanicsID tdeMotorID)
{
m_csName = csName;
m_tdeMotorID = tdeMotorID;
m_pclCurrentCard = NULL;
m_p_fn_vUnallocate = NULL;
m_p_fn_vFill = NULL;
m_p_fn_vSave = NULL;
m_crControlZone = CRect(0,0,0,0);
m_bControlsAreHidden = TRUE;
m_bAtLeastOneCardOfTheCardTypeHasBeenLoaded = FALSE;
}
//***************************************************************************
CPA_Meca_CardType::~CPA_Meca_CardType()
{
}
//**************************************************************************************
//********************************** Controls ****************************************
//**************************************************************************************
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vAddDecimalControl(long double ldMinValue,
long double ldMaxValue,
char cDataLength,
BOOL bReadOnly,
CString _csControlName)
{
m_pri_fn_vAddOwnerDataToControl( m_clControlList.m_fn_pclAddDecimalControl( ldMinValue,
ldMaxValue,
cDataLength,
bReadOnly,
CTL_SPACING_TYPE__SINGLE_LINE,
FALSE,
_csControlName,
TRUE, 0 //ANNECY BBB
)
);
}
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vAddBooleanControl(BOOL bReadOnly,
CString _csControlName)
{
m_pri_fn_vAddOwnerDataToControl( m_clControlList.m_fn_pclAddBooleanControl( bReadOnly,
CTL_SPACING_TYPE__SINGLE_LINE,
FALSE,
_csControlName,
TRUE, 0 //ANNECY BBB
)
);
}
//**************************************************************************************
void CPA_Meca_CardType::m_pri_fn_vAddOwnerDataToControl(CTL_Editor_Control *_pclControl)
{
if ( _pclControl != NULL )
{
//OwnerData
_pclControl->m_pub_fn_pclAddOwnerData((void *)this, TME_g_c_cs_ControlOwnerData_ParentCardType);
}
}
//**************************************************************************************
//**************************************************************************************
//**************************************************************************************
//**************************************************************************************
//Creates all controls
long CPA_Meca_CardType::m_fn_lCreateMSControls( CWnd *pclWnd,
CRect crRect)
{
m_pclParentView = (CPA_Meca_MiniStrucView *)pclWnd;
//Adds an item in the tree
m_crDisplayRect = crRect;
//Creates controls of the data list
////
CTL_fn_vSetModuleInfo("TMe", CString("Type ") + m_csName); ///for TUT
////
//Creates controls of the data list
POSITION pos = m_clControlList.GetHeadPosition();
while ( pos != NULL )
(m_clControlList.GetNext(pos))->m_fn_bCreateControl(pclWnd);
////
CTL_fn_vResetModuleInfo();
////
return 0L;
}
//**************************************************************************************
//Hides all controls
void CPA_Meca_CardType::m_fn_vHideAllControls()
{
//Hides controls of the data list
m_clControlList.m_pub_fn_vHideAllControls();
m_bControlsAreHidden = TRUE;
}
//**************************************************************************************
long CPA_Meca_CardType::m_fn_lOpen(CRect crRect)
{
CPoint clTopLeft;
CPoint clTopRight;
clTopLeft.y = clTopRight.y = crRect.top;
clTopLeft.x = crRect.left + C_TABULATION;
clTopRight.x = crRect.right;
m_clControlList.m_pub_fn_vDisplayControlsInZone(clTopLeft, clTopRight);
m_bControlsAreHidden = FALSE;
return (clTopLeft.y - crRect.top);
}
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vClose()
{
//Hides controls of the list
m_clControlList.m_pub_fn_vHideAllControls();
m_crControlZone = CRect(0,0,0,0);
m_bControlsAreHidden = TRUE;
}
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vOffsetZone(long lOffset)
{
m_crControlZone.OffsetRect(0, lOffset);
}
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vGetMotorDatas()
{
//Gets motor data for all controls of the data list
//And retrieves it in the control
m_clControlList.m_pub_fn_vUpdateControlsWithEditedData(TRUE);
}
//**************************************************************************************
CPA_Meca_Card *CPA_Meca_CardType::m_fn_pclGetEditedCard()
{
return m_pclCurrentCard;
}
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vSetEditedCard(CPA_Meca_Card *pclNewCard)
{
// ERROR_ASSERT( (pclNewCard != NULL) && (pclNewCard->fn_bIsAvailable()) );
m_pclCurrentCard = pclNewCard;
}
//**************************************************************************************
CPA_Meca_CardList *CPA_Meca_CardType::m_fn_pclGetCardsList()
{
return (&m_clCardsList);
}
//**************************************************************************************
unsigned long CPA_Meca_CardType::m_fn_ulGetCardsNumber()
{
return m_clCardsList.GetCount();
}
//**************************************************************************************
BOOL CPA_Meca_CardType::m_fn_bControlsAreHidden()
{
return m_bControlsAreHidden;
}
//**************************************************************************************
CString CPA_Meca_CardType::m_fn_csGetCardTypeName()
{
return m_csName;
}
//**************************************************************************************
void CPA_Meca_CardType::m_fn_vSetCardTypeName(CString csNewName)
{
m_csName = csNewName;
}
//***************************************************************************
//Get : The ID of the type of Mechanics (image of Motor ID)
DNM_tdeMechanicsID CPA_Meca_CardType::m_fn_tdeGetMotorID()
{
return m_tdeMotorID;
}
//***************************************************************************
//The name of the File where this type of Cards are stored
CString CPA_Meca_CardType::m_fn_csGetFileName()
{
return m_csFileName;
}
//***************************************************************************
void CPA_Meca_CardType::m_fn_vSetFileName(CString csNewName)
{
m_csFileName = csNewName;
}
//***************************************************************************
//The name of the Action for this type of Cards
CString CPA_Meca_CardType::m_fn_csGetActionName()
{
return m_csActionName;
}
//***************************************************************************
void CPA_Meca_CardType::m_fn_vSetActionName(CString csNewName)
{
m_csActionName = csNewName;
}
//**************************************************************************************
//**************************************************************************************
//**************************************************************************************
CPA_Meca_CardTypeList::CPA_Meca_CardTypeList()
{
}
//**************************************************************************************
CPA_Meca_CardTypeList::~CPA_Meca_CardTypeList()
{
m_fn_vEmptyList();
}
//**************************************************************************************
CPA_Meca_CardType* CPA_Meca_CardTypeList::m_fn_pclAddElement(CString csName,
DNM_tdeMechanicsID tdeMotorID)
{
CPA_Meca_CardType *pclNewElement = new CPA_Meca_CardType(csName, tdeMotorID);
AddTail(pclNewElement);
return pclNewElement;
}
//**************************************************************************************
void CPA_Meca_CardTypeList::m_fn_vEmptyList()
{
POSITION pos = GetHeadPosition();
while( pos != NULL )
delete (GetNext(pos));
RemoveAll();
}
//**************************************************************************************
//Gets a Type Card from its Motor ID
CPA_Meca_CardType* CPA_Meca_CardTypeList::m_fn_pclGetTypeCardFromID(DNM_tdeMechanicsID tdeMotorID)
{
CPA_Meca_CardType *pclTypeCard;
POSITION pos = GetHeadPosition();
BOOL bFound = FALSE;
while ( (pos != NULL) && (!bFound) )
{
pclTypeCard = GetNext(pos);
bFound = ( pclTypeCard->m_fn_tdeGetMotorID() == tdeMotorID );
}
if ( bFound )
return pclTypeCard;
else
return NULL;
}

View File

@@ -0,0 +1,109 @@
// CPAMDgIf.cpp : implementation file
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECDgIf.hpp"
#include "_MInterf.hpp"
//External Modules
#include "IncTUT.h"
//End of External Modules
#define C_INFO_DIALOG_TIMER 70 //An Id for the timer
#define C_TEMPO_TIMER 100 //(ms)
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_InformationDialog dialog
BEGIN_MESSAGE_MAP(CPA_Meca_InformationDialog, CDialog)
//{{AFX_MSG_MAP(CPA_Meca_InformationDialog)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//**************************************************************************
CPA_Meca_InformationDialog::CPA_Meca_InformationDialog(CWnd* pParent, CString csMessage)
: CDialog(CPA_Meca_InformationDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Meca_InformationDialog)
m_csMessage = csMessage;
//}}AFX_DATA_INIT
m_hOldInstance = AfxGetResourceHandle();
AfxSetResourceHandle(g_stMecaDLLIdentity.hModule);
}
//**************************************************************************
CPA_Meca_InformationDialog::~CPA_Meca_InformationDialog()
{
AfxSetResourceHandle(m_hOldInstance);
}
//***************************************************************************
void CPA_Meca_InformationDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Meca_InformationDialog)
DDX_Text(pDX, IDC_STATIC_TEXT, m_csMessage);
//}}AFX_DATA_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_InformationDialog message handlers
//***************************************************************************
BOOL CPA_Meca_InformationDialog::OnInitDialog()
{
CDialog::OnInitDialog();
//Init. timer
SetTimer(C_INFO_DIALOG_TIMER, C_TEMPO_TIMER, NULL);
//Loads Bitmaps
m_a_cbBitmaps[0].LoadBitmap(IDB_BITMAP_INFO1);
m_a_cbBitmaps[1].LoadBitmap(IDB_BITMAP_INFO2);
m_a_cbBitmaps[2].LoadBitmap(IDB_BITMAP_INFO3);
m_a_cbBitmaps[3].LoadBitmap(IDB_BITMAP_INFO4);
m_a_cbBitmaps[4].LoadBitmap(IDB_BITMAP_INFO5);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//***************************************************************************
void CPA_Meca_InformationDialog::OnOK()
{
KillTimer(C_INFO_DIALOG_TIMER);
EndDialog(IDOK);
}
//***************************************************************************
void CPA_Meca_InformationDialog::OnTimer(UINT nIDEvent)
{
static BOOL s_bFirstPass = TRUE;
static char s_cCurrentBitmapIndex = -1; //To begin with first bitmap
static char s_cIndexIncrement = 1;
s_cCurrentBitmapIndex += s_cIndexIncrement;
if ( ! s_bFirstPass )
{
if ( s_cCurrentBitmapIndex % (C_NUMBER_OF_BITMAPS-1) == 0 )
s_cIndexIncrement = -s_cIndexIncrement;
}
else
s_bFirstPass = FALSE;
((CStatic *)GetDlgItem(IDC_STATIC_IMAGE))->SetBitmap(HBITMAP(m_a_cbBitmaps[s_cCurrentBitmapIndex]));
CDialog::OnTimer(nIDEvent);
}

View File

@@ -0,0 +1,88 @@
// CPAMDgNC.cpp : implementation file
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECDgNC.hpp"
//External Modules
#include "IncTUT.h"
//End of External Modules
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_NewCardDialog dialog
BEGIN_MESSAGE_MAP(CPA_Meca_NewCardDialog, CDialog)
//{{AFX_MSG_MAP(CPA_Meca_NewCardDialog)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//**************************************************************************
CPA_Meca_NewCardDialog::CPA_Meca_NewCardDialog(CString csCardName,
CWnd* pParent /*=NULL*/)
: CDialog(CPA_Meca_NewCardDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Meca_NewCardDialog)
m_csName = csCardName;
//}}AFX_DATA_INIT
}
//**************************************************************************
void CPA_Meca_NewCardDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Meca_NewCardDialog)
DDX_Text(pDX, IDC_EDIT_NAME, m_csName);
//}}AFX_DATA_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_NewCardDialog message handlers
//**************************************************************************
BOOL CPA_Meca_NewCardDialog::OnInitDialog()
{
CDialog::OnInitDialog();
//////////////
//////////////
//Registers for TUT Module
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDC_EDIT_NAME, "TMe_NewCardDialog_NameEdit", TUT_e_TextEdit);
TUT_M_vRegisterControlID(IDOK, "TMe_InformationDialog_OKButton", TUT_e_Button);
TUT_M_vRegisterControlID(IDCANCEL, "TMe_InformationDialog_CancelButton", TUT_e_Button);
//End of Registers for TUT Module
//////////////
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//**************************************************************************
void CPA_Meca_NewCardDialog::OnDestroy()
{
//////////////
//////////////
//UnRegisters for TUT Module
TUT_M_vGetTutDll();
TUT_M_vUnregisterControlID(IDC_EDIT_NAME);
TUT_M_vUnregisterControlID(IDOK);
TUT_M_vUnregisterControlID(IDCANCEL);
//End of UnRegisters for TUT Module
//////////////
CDialog::OnDestroy();
}

View File

@@ -0,0 +1,182 @@
// CPAMDgQu.cpp : implementation file
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECDgQu.hpp"
#include "_MInterf.hpp"
//External Modules
#include "IncTUT.h"
//End of External Modules
#define C_QUESTION_DIALOG_TIMER 69 //An Id for the timer
#define C_TEMPO_TIMER 60 //(ms)
#define C_NUMBER_OF_FRAMES 15
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_QuestionDialog dialog
BEGIN_MESSAGE_MAP(CPA_Meca_QuestionDialog, CDialog)
//{{AFX_MSG_MAP(CPA_Meca_QuestionDialog)
ON_BN_CLICKED(IDNO, OnNo)
ON_BN_CLICKED(IDYES, OnYes)
ON_WM_TIMER()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//**************************************************************************
CPA_Meca_QuestionDialog::CPA_Meca_QuestionDialog(CWnd* pParent, CString csMessage)
: CDialog(CPA_Meca_QuestionDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Meca_QuestionDialog)
m_csMessage = csMessage;
//}}AFX_DATA_INIT
m_hOldInstance = AfxGetResourceHandle();
AfxSetResourceHandle(g_stMecaDLLIdentity.hModule);
}
//**************************************************************************
CPA_Meca_QuestionDialog::~CPA_Meca_QuestionDialog()
{
AfxSetResourceHandle(m_hOldInstance);
}
//***************************************************************************
void CPA_Meca_QuestionDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Meca_QuestionDialog)
DDX_Text(pDX, IDC_STATIC_QUESTION, m_csMessage);
//}}AFX_DATA_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_QuestionDialog message handlers
//***************************************************************************
BOOL CPA_Meca_QuestionDialog::OnInitDialog()
{
CDialog::OnInitDialog();
//Init. timer
SetTimer(C_QUESTION_DIALOG_TIMER, C_TEMPO_TIMER, NULL);
//Loads Bitmaps
m_cbBitmap.LoadBitmap(IDB_BITMAP_QUESTION);
//////////////
//////////////
//Registers for TUT Module
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDYES, "TMe_QuestionDialog_YesButton", TUT_e_Button);
TUT_M_vRegisterControlID(IDNO, "TMe_QuestionDialog_NoButton", TUT_e_Button);
//End of Registers for TUT Module
//////////////
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//***************************************************************************
void CPA_Meca_QuestionDialog::OnDestroy()
{
//////////////
//////////////
//UnRegisters for TUT Module
TUT_M_vGetTutDll();
TUT_M_vUnregisterControlID(IDYES);
TUT_M_vUnregisterControlID(IDNO);
//End of UnRegisters for TUT Module
//////////////
CDialog::OnDestroy();
}
//***************************************************************************
void CPA_Meca_QuestionDialog::OnNo()
{
KillTimer(C_QUESTION_DIALOG_TIMER);
EndDialog(IDNO);
}
//***************************************************************************
void CPA_Meca_QuestionDialog::OnYes()
{
KillTimer(C_QUESTION_DIALOG_TIMER);
EndDialog(IDYES);
}
//***************************************************************************
void CPA_Meca_QuestionDialog::OnTimer(UINT nIDEvent)
{
/* static BOOL s_bFirstPass = TRUE;
static char s_cCurrentBitmapIndex = -1; //To begin with first bitmap
static char s_cIndexIncrement = 1;
s_cCurrentBitmapIndex += s_cIndexIncrement;
if ( ! s_bFirstPass )
{
if ( s_cCurrentBitmapIndex % (C_NUMBER_OF_FRAMES-1) == 0 )
s_cIndexIncrement = -s_cIndexIncrement;
}
else
s_bFirstPass = FALSE;
((CStatic *)GetDlgItem(IDC_STATIC_IMAGE))->SetBitmap(HBITMAP(m_a_cbBitmaps[s_cCurrentBitmapIndex]));
*/
static BOOL s_bFirstPass = TRUE;
static CRect crRect;
static char s_cCurrentIndex = -1;
static char s_cIndexIncrement = 1;
s_cCurrentIndex += s_cIndexIncrement;
if ( s_bFirstPass )
{
crRect.top = 0;
crRect.bottom = 56;
crRect.left = 0;
crRect.right = 56;
s_bFirstPass = FALSE;
}
else
{
if ( s_cCurrentIndex % (C_NUMBER_OF_FRAMES-1) == 0 )
s_cIndexIncrement = -s_cIndexIncrement;
}
//Computes Rect
crRect.left = (56 * s_cCurrentIndex)/ C_NUMBER_OF_FRAMES;
crRect.right = 56 - (56 * s_cCurrentIndex)/ C_NUMBER_OF_FRAMES;
CClientDC dc(GetDlgItem(IDC_EDIT_BIDON));
CDC memDC;
memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(m_cbBitmap);
dc.StretchBlt( crRect.left,
crRect.top,
crRect.Width(),
crRect.Height(), &memDC, 0, 0, 56, 56, SRCCOPY);
CDialog::OnTimer(nIDEvent);
}

View File

@@ -0,0 +1,125 @@
// CPAMDgSp.cpp : implementation file
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECDgSp.hpp"
#include "_Minterf.hpp"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_EditorSetupDialog dialog
BEGIN_MESSAGE_MAP(CPA_Meca_EditorSetupDialog, CDialog)
//{{AFX_MSG_MAP(CPA_Meca_EditorSetupDialog)
ON_WM_PAINT()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_HELP, OnMyHelp)
END_MESSAGE_MAP()
//***************************************************************************
CPA_Meca_EditorSetupDialog::CPA_Meca_EditorSetupDialog(CWnd* pParent /*=NULL*/)
: CDialog(CPA_Meca_EditorSetupDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CPA_Meca_EditorSetupDialog)
//}}AFX_DATA_INIT
}
//***************************************************************************
void CPA_Meca_EditorSetupDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_Meca_EditorSetupDialog)
//}}AFX_DATA_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_EditorSetupDialog message handlers
//***************************************************************************
void CPA_Meca_EditorSetupDialog::OnOK()
{
UpdateData(TRUE);
CDialog::OnOK();
}
//***************************************************************************
void CPA_Meca_EditorSetupDialog::OnLButtonUp(UINT nFlags, CPoint point)
{
CWnd *pclWnd;
CRect crClientRect;
pclWnd = GetDlgItem(IDC_RECT_TEXT_FIELD_INST);
pclWnd->GetWindowRect(crClientRect);
ScreenToClient(crClientRect);
// if ( crClientRect.PtInRect(point) )
// if ( m_fn_bEditColor(g_colref_FieldInstanceTextColor) )
// InvalidateRect(NULL);
pclWnd = GetDlgItem(IDC_RECT_BG_FIELD_INST);
pclWnd->GetWindowRect(crClientRect);
ScreenToClient(crClientRect);
// if ( crClientRect.PtInRect(point) )
// if ( m_fn_bEditColor(g_colref_FieldInstanceBackgroundColor) )
// InvalidateRect(NULL);
CDialog::OnLButtonUp(nFlags, point);
}
//***************************************************************************
BOOL CPA_Meca_EditorSetupDialog::m_fn_bEditColor(COLORREF &r_Color)
{
CColorDialog dial(r_Color, CC_FULLOPEN, this);
if ( dial.DoModal() == IDOK )
{
r_Color = dial.GetColor();
return TRUE;
}
else
return FALSE;
}
//***************************************************************************
void CPA_Meca_EditorSetupDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect crClientRect;
CWnd *pclWnd;
pclWnd = GetDlgItem(IDC_RECT_TEXT_FIELD_INST);
pclWnd->GetClientRect(crClientRect);
crClientRect.InflateRect(-2,-2);
CClientDC dc3(pclWnd);
// dc3.FillSolidRect(crClientRect, g_colref_FieldInstanceTextColor);
pclWnd = GetDlgItem(IDC_RECT_BG_FIELD_INST);
pclWnd->GetClientRect(crClientRect);
crClientRect.InflateRect(-2,-2);
CClientDC dc4(pclWnd);
// dc4.FillSolidRect(crClientRect, g_colref_FieldInstanceBackgroundColor);
// Do not call CDialog::OnPaint() for painting messages
}
//***************************************************************************
long CPA_Meca_EditorSetupDialog::OnMyHelp(UINT, long lParam)
{
LPHELPINFO lphi = (LPHELPINFO)lParam;
::WinHelp(m_hWnd,
"c:\\acp\\dllbibli\\object\\actors\\help\\actors.hlp",
HELP_CONTEXTPOPUP,
lphi->dwContextId);
return TRUE;
}

View File

@@ -0,0 +1,530 @@
// Implementation for the class CMyDocument
/////////////////////////////////////////////
#include "StdAfx.h"
#include "SCR.h"
#include "EMECDoc.hpp"
#include "EMECVwMn.hpp"
#include "EMECVwMS.hpp"
#include "EMECStrg.hpp"
#include "EMECDgNC.hpp"
#include "_Minterf.hpp"
#include "x:\cpa\main\inc\_EditID.h"
//External modules
#include "ErO.h"
#include "Dpt.h"
//End of External modules
long g_lCurrentId = 2000;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//****************************************************************************
CPA_Meca_MyDocument::CPA_Meca_MyDocument()
{
// AfxEnableMemoryTracking(TRUE);
//Initializes editor's state
m_pclCurrentCardType = NULL;
m_pclCurrentCard = NULL;
m_pclControlView = NULL;
m_pclMiniStrucView = NULL;
m_pclDialogList = NULL;
//Editor's Setup var. Init.
m_ulListViewHeight = 170;
m_ulControlViewHeight = 250;
m_ulEditorWidth = 260;
//Other init.
m_fn_vInitialize();
}
//****************************************************************************
CPA_Meca_MyDocument::~CPA_Meca_MyDocument()
{
m_fn_bWriteIniFile();
}
//****************************************************************************
//Extra init.
void CPA_Meca_MyDocument::m_fn_vInitialize()
{
//Constructs the list of Enum desciptors
m_fn_vConstructListOfEnumDescriptors();
//Fills the mini-structure list (controls)
m_fn_vFillCardsTypeList();
//Init. the INI file name
m_csIniFileName = M_GetMainApp()->m_csEditorDataPath + "Tools\\Meca\\EdMeca.ini";
//Reads INI file
m_fn_bReadIniFile();
m_pub_fn_bLoadPreferences();
//PROVISOIRE...
m_csHelpFileNameAndPath = M_GetMainApp()->m_csEditorDataPath + "Tools\\Meca\\Meca.hlp >Normale";
}
/////////////////////
// Editor's aspect //
/////////////////////
//***************************************************************************
// ...
void CPA_Meca_MyDocument::m_fn_vEditCard(CPA_Meca_Card *pclNewCard)
{
m_pclCurrentCard = pclNewCard;
if ( m_pclMiniStrucView != NULL )
{
if ( pclNewCard != NULL )
{
if ( (pclNewCard->m_fn_pclGetCardType()->m_fn_bControlsAreHidden())
|| (m_pclCurrentCardType == NULL)
)
//Forces "Repaint"
m_fn_vDisplayCardType(pclNewCard->m_fn_pclGetCardType(), TRUE);
m_fn_vSetPointersForSelectedCard();
m_pclMiniStrucView->m_fn_vEditCard(m_pclCurrentCard);
m_pclControlView->m_fn_vUpdateCardsName();
//Sets new Card as Type Card's current Card
pclNewCard->m_fn_pclGetCardType()->m_fn_vSetEditedCard(pclNewCard);
}
else
{
if ( !m_pclCurrentCardType->m_fn_bControlsAreHidden() )
m_pclCurrentCardType->m_fn_vHideAllControls();
//Sets new Card as Type Card's current Card
m_pclCurrentCardType->m_fn_vSetEditedCard(pclNewCard);
}
}
}
//***************************************************************************
// ...
void CPA_Meca_MyDocument::m_fn_vDisplayCardType(CPA_Meca_CardType *pclNewCardType,
BOOL bForcesRepaint /*= FALSE*/)
{
if ( (pclNewCardType != m_pclCurrentCardType) || (bForcesRepaint) )
{
m_pclCurrentCardType = pclNewCardType;
if ( m_pclMiniStrucView )
m_pclMiniStrucView->m_fn_vDisplayCardType(m_pclCurrentCardType, TRUE);
if ( m_pclCurrentCardType != NULL )
{
if ( m_pclCurrentCardType->m_fn_ulGetCardsNumber() == 0 )
{
//PROVISOIRE...
m_pclCurrentCardType->m_fn_vHideAllControls();
//Refreshes buttons
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_DELETE))->EnableWindow( FALSE );
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_RENAME))->EnableWindow( FALSE );
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_COPY))->EnableWindow( FALSE );
m_pclCurrentCardType->m_fn_vSetEditedCard(NULL);
}
else
{
//Refreshes buttons
if ( m_pclCurrentCardType->m_fn_pclGetEditedCard() != NULL )
{
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_DELETE))->EnableWindow( TRUE );
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_RENAME))->EnableWindow( TRUE );
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_COPY))->EnableWindow( TRUE );
}
else
{
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_DELETE))->EnableWindow( FALSE );
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_RENAME))->EnableWindow( FALSE );
((CButton *)m_pclControlView->GetDlgItem(IDC_BUTTON_COPY))->EnableWindow( FALSE );
}
}
}
//Selects in the List Box
CListBox *pclTypeLB = (CListBox *)m_pclControlView->GetDlgItem(IDC_LIST_CARD_TYPES);
pclTypeLB->SelectString(-1, m_pclCurrentCardType->m_fn_csGetCardTypeName());
}
}
//***************************************************************************
// ...
void CPA_Meca_MyDocument::m_fn_vReInitDisplay()
{
CListBox *pclTypeLB = (CListBox *)m_pclControlView->GetDlgItem(IDC_LIST_CARD_TYPES);
pclTypeLB->SetCurSel(0);
m_pclControlView->OnSelchangeComboCardTypes();
//Updates Dialog List
m_pclDialogList->fn_vReinitDialog();
}
//**********************************************************************************************
CPA_Meca_Card *CPA_Meca_MyDocument::m_pub_fn_vCreateCopyOfCard(CPA_Meca_Card *_pclSourceCard)
{
ERROR_ASSERT( _pclSourceCard != NULL );
CPA_Meca_Card *pclNewCard = NULL;
//Creates Card
//////////////////
//Gets user wanted name
CString csCopyName = _pclSourceCard->GetName() + "_Copy";
CPA_Meca_NewCardDialog dial(csCopyName, m_pclControlView);
if ( dial.DoModal() == IDOK )
{
csCopyName = dial.m_csName;
CPA_Meca_CardType *pclCardType = _pclSourceCard->m_fn_pclGetCardType();
pclNewCard = pclCardType->m_fn_pclGetCardsList()->m_fn_pclAddElement(
csCopyName,
_pclSourceCard->m_fn_pclGetCardType(),
NULL,
_pclSourceCard->m_fn_pclGetCardType()->m_fn_csGetFileName(),
_pclSourceCard->m_fn_pclGetCardType()->m_fn_csGetActionName());
//Copies Data from source Card
POSITION SourcePos = _pclSourceCard->m_clDataList.GetHeadPosition();
POSITION NewCardPos = pclNewCard->m_clDataList.GetHeadPosition();
while ( SourcePos != NULL )
{
ERROR_ASSERT( NewCardPos != NULL );
pclNewCard->m_clDataList.GetNext(NewCardPos)->m_fn_vUpdateData(_pclSourceCard->m_clDataList.GetNext(SourcePos));
}
ERROR_ASSERT( NewCardPos == NULL );
}
return pclNewCard;
}
///////////////////////
// Private functions //
///////////////////////
//**********************************************************************************************
//Sets the pointer on a Data (the one of the Card) in each control of Card Type
void CPA_Meca_MyDocument::m_fn_vSetPointersForSelectedCard()
{
m_fn_vSetPointersForCard(m_pclCurrentCard);
}
//**********************************************************************************************
//Sets the pointer on a Data (the one of the Card) in each control of Card Type
void CPA_Meca_MyDocument::m_fn_vSetPointersForCard(CPA_Meca_Card *pclCard)
{
if ( pclCard != NULL )
{
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Linking a Card to a Card Type (i.e. data to controls)",
"CPA_Meca_MyDocument::m_fn_vSetPointersForCard(...)",
E_ERROR_GRAVITY_FATAL,
"The given Card Type is invalid");
ERROR_ASSERT( m_pclCurrentCardType != NULL );
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Linking a Card to a Card Type (i.e. data to controls)",
"CPA_Meca_MyDocument::m_fn_vSetPointersForCard(...)",
E_ERROR_GRAVITY_FATAL,
"The type of the Card differs from the one of the Type Card...");
ERROR_ASSERT( m_pclCurrentCardType == pclCard->m_fn_pclGetCardType() );
m_pclCurrentCardType->m_clControlList.m_pub_fn_vUpdateControlsWithListOfData(&pclCard->m_clDataList);
}
}
//**********************************************************************************************
//Removes a Card from a Card Type's list
void CPA_Meca_MyDocument::m_fn_vRemoveCard(CPA_Meca_Card *pclCard)
{
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Trying to delete a Mechanical Card",
"CPA_Meca_MyDocument::m_fn_vRemoveCard(...)",
E_ERROR_GRAVITY_FATAL,
"The Card to be deleted is invalid");
ERROR_ASSERT( pclCard != NULL );
CPA_Meca_CardType *pclCardType = pclCard->m_fn_pclGetCardType();
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Trying to delete a Mechanical Card",
"CPA_Meca_MyDocument::m_fn_vRemoveCard(...)",
E_ERROR_GRAVITY_FATAL,
"The type of the Card to be deleted is invalid");
ERROR_ASSERT( pclCardType != NULL );
POSITION pos = pclCardType->m_fn_pclGetCardsList()->Find(pclCard);
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Trying to delete a Mechanical Card",
"CPA_Meca_MyDocument::m_fn_vRemoveCard(...)",
E_ERROR_GRAVITY_FATAL,
"The Card to be deleted has not been found in the Editor list");
ERROR_ASSERT( pos != NULL );
//Removes from list
pclCardType->m_fn_pclGetCardsList()->RemoveAt(pos);
//Notifies
pclCard->fn_vNotifyUnSave();
//deletes
delete pclCard;
//Selects another Card
m_fn_vEditCard(pclCardType->m_fn_pclGetCardsList()->m_pub_fn_pclGetFirstAvailableCard());
}
//**********************************************************************************************
void CPA_Meca_MyDocument::m_fn_vCheckSpacesInString(CString &r_csStringToCheck)
{
CString csSpace(" ");
for (int c_lI = 0; c_lI < r_csStringToCheck.GetLength(); c_lI ++)
if ( r_csStringToCheck[c_lI] == csSpace )
r_csStringToCheck.SetAt(c_lI, '_');
}
//**********************************************************************************************
void CPA_Meca_MyDocument::m_fn_vSearchForLoadedCards()
{
//Uses LinkTables
SCR_tdst_Link_Table *p_stLinkTable = DNM_fn_p_stGetLinkTableOfIdCard();
unsigned int uiPos = 0;
SCR_tdst_Link_Value *p_stValue;
CPA_Meca_Card *pclAddedCard = NULL;
CPA_Meca_CardType *pclConcernedCardType = NULL;
/* Get first element of array */
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value,
uiPos,
p_stValue,
SCR_M_st_Link_GetDynamicArray(p_stLinkTable)
)
while( p_stValue != NULL ) /* p_sValue is NULL at the end of the array */
{
/* Test current retrieved value */
if( SCR_M_e_Link_GetState(p_stValue) == SCR_ELS_Link_Initialized )
{
DNM_tdxHandleToMecIdentityCard h_IdCard = (DNM_tdxHandleToMecIdentityCard)SCR_M_ul_Link_GetValue(p_stValue);
//Gets the Name for the Card
CString csCardName(SCR_M_p_sz_Link_GetKey(p_stValue));
char a_256cFileName[256];
char a_256cActionName[256];
char a_256cName[256];
SCR_fn_v_RdL0_SplitSectionName((char *)LPCTSTR(csCardName), a_256cFileName, a_256cActionName, a_256cName);
csCardName = a_256cName;
//Gets the Motor Type for the Card
DNM_tdeMechanicsID tdeMotorType;
memcpy(&tdeMotorType, h_IdCard, sizeof(DNM_tdeMechanicsID));
//Adds to Card Type's list od Cards
pclConcernedCardType = m_clCardTypeList.m_fn_pclGetTypeCardFromID(tdeMotorType);
pclAddedCard = pclConcernedCardType->m_fn_pclGetCardsList()->m_fn_pclAddElement(csCardName,
pclConcernedCardType,
h_IdCard,
a_256cFileName,
a_256cActionName);
//Adds to the Main list
m_clListOfCards.fn_bAddObject(pclAddedCard);
pclAddedCard->SetExistingSection(TRUE);
pclConcernedCardType->m_bAtLeastOneCardOfTheCardTypeHasBeenLoaded = TRUE;
}
/* Get next element */
uiPos++;
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value,
uiPos,
p_stValue,
SCR_M_st_Link_GetDynamicArray(p_stLinkTable)
)
}
}
//**********************************************************************************************
void CPA_Meca_MyDocument::m_fn_vLoadUnloadedCards()
{
CPA_Meca_CardType *pclCurrentTypeCard;
POSITION pos= m_clCardTypeList.GetHeadPosition();
while ( pos != NULL )
{
pclCurrentTypeCard = m_clCardTypeList.GetNext(pos);
CString csCompleteFileName = fn_szGetMechanicsDataPath();
csCompleteFileName += CString("\\") + pclCurrentTypeCard->m_fn_csGetFileName();
CFile cfPrivateFile;
if ( cfPrivateFile.Open(csCompleteFileName, CFile::modeRead ) )
{
cfPrivateFile.Close();
char *szFileName = (char *)LPCTSTR(pclCurrentTypeCard->m_fn_csGetFileName());
//Gets all the sections in the corresponding file
SCR_fn_v_RdL0_OpenFile(szFileName);
//Gets a pointer on the file
SCR_tdst_File_Open *p_tdstFile = SCR_fnp_st_RdL0_GetOpenFile(szFileName);
unsigned int uiPos = 0;
SCR_tdst_Anl_SectionDes_ *p_stValue;
CPA_Meca_Card *pclAddedCard = NULL;
BOOL bCardIsNotLoaded;
/* Get first element of array */
SCR_M_DyAr_GetNextElement(SCR_tdst_Anl_SectionDes_,
uiPos,
p_stValue,
p_tdstFile->stSectionsDes
)
while( p_stValue != NULL ) /* p_sValue is NULL at the end of the array */
{
//Gets the Name for the Card
CString csCardName(p_stValue->stBuffers.p_szBufferCompleteName);
char a_256cFileName[256];
char a_256cActionName[256];
char a_256cName[256];
SCR_fn_v_RdL0_SplitSectionName((char *)LPCTSTR(csCardName), a_256cFileName, a_256cActionName, a_256cName);
csCardName = a_256cName;
// Tests if Card is already loaded
bCardIsNotLoaded = ( g_pclInterface->GetMainWorld()->fn_p_oFindObject(csCardName, C_szMecaCardTypeName) == NULL );
//Creates an unloaded Card if necessary
if ( bCardIsNotLoaded )
{
//Adds to Card Type's list od Cards
pclAddedCard = pclCurrentTypeCard->m_fn_pclGetCardsList()->m_fn_pclAddElement(csCardName,
pclCurrentTypeCard,
NULL,
a_256cFileName,
a_256cActionName,
TRUE);
pclAddedCard->SetAvailable(FALSE);
//Adds to the Main list
m_clListOfCards.fn_bAddObject(pclAddedCard);
pclAddedCard->SetExistingSection(TRUE);
}
/* Get next element */
uiPos++;
SCR_M_DyAr_GetNextElement(SCR_tdst_Anl_SectionDes_,
uiPos,
p_stValue,
p_tdstFile->stSectionsDes
)
}
}
}
}
//**********************************************************************************************
void CPA_Meca_MyDocument::m_fn_vUpdateUnLoadedCards()
{
//Uses LinkTables
SCR_tdst_Link_Table *p_stLinkTable = DNM_fn_p_stGetLinkTableOfIdCard();
unsigned int uiPos = 0;
SCR_tdst_Link_Value *p_stValue;
CPA_Meca_Card *pclEditorCard = NULL;
CPA_Meca_CardType *pclConcernedCardType = NULL;
/* Get first element of array */
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value,
uiPos,
p_stValue,
SCR_M_st_Link_GetDynamicArray(p_stLinkTable)
)
while( p_stValue != NULL ) /* p_sValue is NULL at the end of the array */
{
/* Test current retrieved value */
if( SCR_M_e_Link_GetState(p_stValue) == SCR_ELS_Link_Initialized )
{
DNM_tdxHandleToMecIdentityCard h_IdCard = (DNM_tdxHandleToMecIdentityCard)SCR_M_ul_Link_GetValue(p_stValue);
//Gets the Name for the Card
CString csCardName(SCR_M_p_sz_Link_GetKey(p_stValue));
char a_256cFileName[256];
char a_256cActionName[256];
char a_256cName[256];
SCR_fn_v_RdL0_SplitSectionName((char *)LPCTSTR(csCardName), a_256cFileName, a_256cActionName, a_256cName);
csCardName = a_256cName;
//Gets the Motor Type for the Card
DNM_tdeMechanicsID tdeMotorType;
memcpy(&tdeMotorType, h_IdCard, sizeof(DNM_tdeMechanicsID));
//Adds to Card Type's list of Cards
pclConcernedCardType = m_clCardTypeList.m_fn_pclGetTypeCardFromID(tdeMotorType);
//Searches for object with same name
pclEditorCard = (CPA_Meca_Card *)g_pclInterface->GetBaseObject(csCardName, C_szMecaCardTypeName);
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Updating unloaded Mechanical Cards (because a Family has been loaded)",
"CPA_Meca_MyDocument::m_fn_vUpdateUnLoadedCards()",
E_ERROR_GRAVITY_WARNING,
"No Editor Card found for one of the Motor Cards");
ERROR_ASSERT( pclEditorCard != NULL );
if( (pclEditorCard != NULL) && (!pclEditorCard->fn_bIsAvailable()) )
{
// Updates engine poniter
pclEditorCard->m_fn_vSetBaseAddress(h_IdCard);
pclEditorCard->SetAvailable(TRUE);
pclConcernedCardType->m_bAtLeastOneCardOfTheCardTypeHasBeenLoaded = TRUE;
pclConcernedCardType->m_p_fn_vFill(pclEditorCard);
DNM_tdstMecBaseIdCard *pMecCard = (DNM_tdstMecBaseIdCard *)pclEditorCard->m_fn_pvGetBaseAddress();
DNM_M_vBaseIdCardSetSlopeLimit ( pMecCard, MTH_M_xRadToDeg ( MTH_M_xATan (DNM_M_xBaseIdCardGetSlopeLimit(pMecCard))) );
}
}
/* Get next element */
uiPos++;
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value,
uiPos,
p_stValue,
SCR_M_st_Link_GetDynamicArray(p_stLinkTable)
)
}
}

View File

@@ -0,0 +1,91 @@
// Modification functions for Data
//////////////////////////////////////
#include "StdAfx.h"
#include "EMECDtMd.hpp"
//External Modules
#include "ErO.h"
#include "CTL.h"
//End of External Modules
//*******************************************************************************
void EMEC_fn_vModifFloatFromCosToDegre(CTL_Editor_Data *_pclBaseData)
{
ERROR_ASSERT( _pclBaseData != NULL );
ERROR_ASSERT( _pclBaseData->m_pub_fn_tdeGetDataType() == CTL_DATA_TYPE__DECIMAL );
CTL_Editor_DecimalData *pclTrueData = (CTL_Editor_DecimalData *)_pclBaseData;
long double ldValue = pclTrueData->m_ldCurrentValue;
ldValue = MTH_M_xACos(ldValue);
ldValue = MTH_M_xRadToDeg(ldValue);
pclTrueData->m_ldCurrentValue = ldValue;
}
//*******************************************************************************
void EMEC_fn_vModifFloatFromDegreToCos(CTL_Editor_Data *_pclBaseData)
{
ERROR_ASSERT( _pclBaseData != NULL );
ERROR_ASSERT( _pclBaseData->m_pub_fn_tdeGetDataType() == CTL_DATA_TYPE__DECIMAL );
CTL_Editor_DecimalData *pclTrueData = (CTL_Editor_DecimalData *)_pclBaseData;
long double ldValue = pclTrueData->m_ldCurrentValue;
ldValue = MTH_M_xDegToRad(ldValue);
ldValue = MTH_M_xCos(ldValue);
pclTrueData->m_ldCurrentValue = ldValue;
}
//*******************************************************************************
void EMEC_fn_vModifFloatFromRadianPerSecondToDegrePerSecond(CTL_Editor_Data *_pclBaseData)
{
ERROR_ASSERT( _pclBaseData != NULL );
ERROR_ASSERT( _pclBaseData->m_pub_fn_tdeGetDataType() == CTL_DATA_TYPE__DECIMAL );
CTL_Editor_DecimalData *pclTrueData = (CTL_Editor_DecimalData *)_pclBaseData;
long double ldValue = pclTrueData->m_ldCurrentValue;
ldValue = MTH_M_xRadToDeg(ldValue);
pclTrueData->m_ldCurrentValue = ldValue;
}
//*******************************************************************************
void EMEC_fn_vModifFloatFromDegrePerSecondToRadianPerSecond(CTL_Editor_Data *_pclBaseData)
{
ERROR_ASSERT( _pclBaseData != NULL );
ERROR_ASSERT( _pclBaseData->m_pub_fn_tdeGetDataType() == CTL_DATA_TYPE__DECIMAL );
CTL_Editor_DecimalData *pclTrueData = (CTL_Editor_DecimalData *)_pclBaseData;
long double ldValue = pclTrueData->m_ldCurrentValue;
ldValue = MTH_M_xDegToRad(ldValue);
pclTrueData->m_ldCurrentValue = ldValue;
}
//*******************************************************************************
void EMEC_fn_vModifFloatFromHertzToSecond(CTL_Editor_Data *_pclBaseData)
{
ERROR_ASSERT( _pclBaseData != NULL );
ERROR_ASSERT( _pclBaseData->m_pub_fn_tdeGetDataType() == CTL_DATA_TYPE__DECIMAL );
CTL_Editor_DecimalData *pclTrueData = (CTL_Editor_DecimalData *)_pclBaseData;
long double ldValue = pclTrueData->m_ldCurrentValue;
ldValue = 1 / ldValue;
pclTrueData->m_ldCurrentValue = ldValue;
}
//*******************************************************************************
void EMEC_fn_vModifFloatFromSecondToHertz(CTL_Editor_Data *_pclBaseData)
{
ERROR_ASSERT( _pclBaseData != NULL );
ERROR_ASSERT( _pclBaseData->m_pub_fn_tdeGetDataType() == CTL_DATA_TYPE__DECIMAL );
CTL_Editor_DecimalData *pclTrueData = (CTL_Editor_DecimalData *)_pclBaseData;
long double ldValue = pclTrueData->m_ldCurrentValue;
ldValue = 1 / ldValue;
pclTrueData->m_ldCurrentValue = ldValue;
}

View File

@@ -0,0 +1,158 @@
// MainFrm.cpp : implementation of the CPA_Meca_MainFrame class
////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECFmMn.hpp"
#include "EMECVwMn.hpp"
#include "EMECVwMS.hpp"
#include "EMECCnst.hpp"
#include "_Minterf.hpp"
//External Modules
#include "IncTUT.h"
//End of External Modules
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MainFrame
BEGIN_MESSAGE_MAP(CPA_Meca_MainFrame, CSplitFrame)
//{{AFX_MSG_MAP(CPA_Meca_MainFrame)
ON_WM_HELPINFO()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MainFrame construction/destruction
//*******************************************************************************
CPA_Meca_MainFrame::CPA_Meca_MainFrame()
{
}
//*******************************************************************************
CPA_Meca_MainFrame::~CPA_Meca_MainFrame()
{
}
//*******************************************************************************
/*UINT CPA_Meca_MainFrame::OnNcHitTest( CPoint point )
{
UINT nResponse = CWnd::OnNcHitTest(point);
if ( ( nResponse == HTBOTTOM ) //Re-size
|| ( nResponse == HTBOTTOMRIGHT ) //Re-size
|| ( nResponse == HTBOTTOMLEFT ) //Re-size
|| ( nResponse == HTTOP ) //Re-size
|| ( nResponse == HTTOPRIGHT ) //Re-size
|| ( nResponse == HTTOPLEFT ) //Re-size
|| ( nResponse == HTLEFT ) //Re-size
|| ( nResponse == HTRIGHT ) //Re-size
|| ( nResponse == HTCAPTION ) //Move
|| ( nResponse == HTZOOM ) //Max size
|| ( nResponse == HTSYSMENU ) //System Menu
|| ( nResponse == HTMENU ) //Menu
)
{
return 0;
}
else
return nResponse;
} */
//*******************************************************************************
BOOL CPA_Meca_MainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if ( !(CreateSplitter(C_cVerticalSplitter, 3)) )
return FALSE;
HINSTANCE hOldInstance = AfxGetResourceHandle();
//Creates Dialog List View
CPA_DialogList *pclDialogList = new CPA_DialogList;
g_pclInterface->m_clDocument.m_pclDialogList = pclDialogList;
pclDialogList->fn_vInitDialog(g_pclInterface, this);
SetPaneView(0, pclDialogList, "Available Cards", g_pclInterface->m_clDocument.m_ulListViewHeight);
//////////////
//////////////
//Registers for TUT Module
TUT_M_vGetTutDll();
TUT_M_vRegisterDialogList(pclDialogList, "TMe_DialogList_List",
"TMe_DialogList_NoTree", "TMe_DialogList_ComboBox", "TMe_DialogList_TestButton");
//End of Registers for TUT Module
//////////////
AfxSetResourceHandle(g_stMecaDLLIdentity.hModule);
//Creates MS view
if ( !CreateView(2,
RUNTIME_CLASS(CPA_Meca_MiniStrucView),
"Edition",
400) //The rest...
)
return FALSE;
//Creates Control view
if ( !CreateView(1,
RUNTIME_CLASS(CPA_Meca_ControlView),
"Types of Mechanics",
g_pclInterface->m_clDocument.m_ulControlViewHeight)
)
return FALSE;
//Manually calls OnInitialUpdate for all views !!!!!
CPA_Meca_MiniStrucView *pclMSView = (CPA_Meca_MiniStrucView *)m_fn_p_oGetPane(2);
pclMSView->OnInitialUpdate();
CPA_Meca_ControlView *pclControlView = (CPA_Meca_ControlView *)m_fn_p_oGetPane(1);
pclControlView->OnInitialUpdate();
AfxSetResourceHandle(hOldInstance);
return TRUE;
}
//*******************************************************************************
BOOL CPA_Meca_MainFrame::OnHelpInfo(HELPINFO* pHelpInfo)
{
::WinHelp(m_hWnd,
LPCTSTR(g_pclInterface->m_clDocument.m_csHelpFileNameAndPath),
HELP_FINDER,
0);
return FALSE;
}
//*******************************************************************************
//*******************************************************************************
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MainFrame diagnostics
#ifdef _DEBUG
void CPA_Meca_MainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CPA_Meca_MainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MainFrame message handlers

View File

@@ -0,0 +1,138 @@
#include "StdAfx.h"
#include "EMECDoc.hpp"
#include "EMECDgIf.hpp"
#include "_Minterf.hpp"
/////////////////////////////////////
// Ini file implementation //
/////////////////////////////////////
//***************************************************************************
BOOL CPA_Meca_MyDocument::m_fn_bReadIniFile()
{
CFile file;
if ( !file.Open(m_csIniFileName, CFile::modeRead) )
{
CString csMessage = "The Ini file ""EdMeca.ini"" is not present in ";
csMessage += m_csIniFileName.Left(m_csIniFileName.ReverseFind('\\'));
csMessage += "\nParameters are default ones, but they will be saved when you exit this application.";
CPA_Meca_InformationDialog dial(NULL, csMessage);
dial.DoModal();
return FALSE;
}
else
{
file.Close();
BOOL bReturn = TRUE;
return bReturn;
}
}
//***************************************************************************
BOOL CPA_Meca_MyDocument::m_fn_bWriteIniFile()
{
BOOL bReturn = TRUE;
return bReturn;
}
//Preferences
////////////////
#define C_EdMeca_szIniSection_Dimensions "Dimensions"
#define C_EdMeca_szIniEntry_ListHeight "ListHeight"
#define C_EdMeca_szIniEntry_ControlHeight "ControlHeight"
#define C_EdMeca_szIniEntry_EditorWidth "EditorWidth"
//#define C_EdMeca_szIniSection_ ""
//***************************************************************************
BOOL CPA_Meca_MyDocument::m_pub_fn_bSavePreferences()
{
BOOL bReturn = TRUE;
m_pri_fn_vGetEditorCurrentSettings();
CString csStringToWrite;
if ( bReturn )
{
csStringToWrite.Format("%ld", m_ulListViewHeight);
bReturn = WritePrivateProfileString(C_EdMeca_szIniSection_Dimensions,
C_EdMeca_szIniEntry_ListHeight,
LPCTSTR(csStringToWrite),
LPCTSTR(m_csIniFileName));
}
if ( bReturn )
{
csStringToWrite.Format("%ld", m_ulControlViewHeight);
bReturn = WritePrivateProfileString(C_EdMeca_szIniSection_Dimensions,
C_EdMeca_szIniEntry_ControlHeight,
LPCTSTR(csStringToWrite),
LPCTSTR(m_csIniFileName));
}
if ( bReturn )
{
csStringToWrite.Format("%ld", m_ulEditorWidth);
bReturn = WritePrivateProfileString(C_EdMeca_szIniSection_Dimensions,
C_EdMeca_szIniEntry_EditorWidth,
LPCTSTR(csStringToWrite),
LPCTSTR(m_csIniFileName));
}
return bReturn;
}
//***************************************************************************
BOOL CPA_Meca_MyDocument::m_pub_fn_bLoadPreferences()
{
BOOL bReturn = TRUE;
CFile file;
if ( !file.Open(m_csIniFileName, CFile::modeRead) )
bReturn = FALSE;
else
{
file.Close();
m_ulListViewHeight = GetPrivateProfileInt(C_EdMeca_szIniSection_Dimensions,
C_EdMeca_szIniEntry_ListHeight,
m_ulListViewHeight,
LPCTSTR(m_csIniFileName));
m_ulControlViewHeight = GetPrivateProfileInt( C_EdMeca_szIniSection_Dimensions,
C_EdMeca_szIniEntry_ControlHeight,
m_ulControlViewHeight,
LPCTSTR(m_csIniFileName));
m_ulEditorWidth = GetPrivateProfileInt( C_EdMeca_szIniSection_Dimensions,
C_EdMeca_szIniEntry_EditorWidth,
m_ulEditorWidth,
LPCTSTR(m_csIniFileName));
bReturn = TRUE;
}
return bReturn;
}
//***************************************************************************
void CPA_Meca_MyDocument::m_pri_fn_vGetEditorCurrentSettings()
{
//Gets views heights
m_ulListViewHeight = g_pclInterface->m_pclMecaMainFrame->GetPaneSize(0);
m_ulControlViewHeight = g_pclInterface->m_pclMecaMainFrame->GetPaneSize(1);
//Gets Charac frame width
CRect crFrameRect;
g_pclInterface->m_pclMecaMainFrame->GetClientRect(crFrameRect);
m_ulEditorWidth = crFrameRect.Width() - 1; //"-1" because FRMBase adds 1 to initial Width
}

View File

@@ -0,0 +1,431 @@
// Saving functions
//////////////////////////////
// Mechanics Editor
/////////////////////////////////////////
#include "StdAfx.h"
#include "_MecCard.hpp"
#include "EMECCrdT.hpp"
#include "EMECStrg.hpp"
#include "EMECFlds.hpp"
//External Modules
#include "ErO.h"
//End of External Modules
//*******************************************************************************************
// Will call one of the specific saving functions
void CPA_Meca_Card::m_fn_vSaveMecaCard(SCR_tdst_File_Description *p_tdstFile,
SCR_tde_Ntfy_Action _eAction)
{
ERROR_ASSERT( m_fn_pclGetCardType()->m_p_fn_vSave != NULL );
//Moves to the End of File
if ( _eAction == SCR_EA_Ntfy_AddSection )
SCR_fn_v_SvL1_ToEndSection(p_tdstFile);
m_fn_pclGetCardType()->m_p_fn_vSave(p_tdstFile, this);
SCR_M_SvL0_SaveBlankLine(p_tdstFile);
}
//*******************************************************************************************
void fn_vSaveCard6(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard)
{
CString csCurrentLine;
csCurrentLine.Format("%s:%s", C_SectionIdCardCamera,
pclCard->GetName());
SCR_M_SvL0_SaveBeginSection(p_tdstFile,
M_MAKECHAR(csCurrentLine),
SCR_CC_C_Cfg_EOL);
//Gets Base structure
DNM_stMecCameraIdCard * pStruct = (DNM_stMecCameraIdCard *)pclCard->m_fn_pvGetBaseAddress();
//Angular Speed
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryAngularSpeed,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%f",
DNM_M_xCameraIdCardGetAngularSpeed(pStruct));
//Linear Speed
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryLinearSpeed,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%f",
DNM_M_xCameraIdCardGetLinearSpeed(pStruct));
//Speeding Up
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntrySpeedingUp,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%f",
DNM_M_xCameraIdCardGetSpeedingUp(pStruct));
//Closes file's main section
SCR_M_SvL0_SaveEndSection(p_tdstFile, SCR_CC_C_Cfg_EOL);
}
//*******************************************************************************************
void fn_vSaveCardRay2Egypte1(SCR_tdst_File_Description *p_tdstFile, CPA_Meca_Card *pclCard)
{
CString csCurrentLine;
csCurrentLine.Format("%s:%s", C_SectionIdCardBase,
pclCard->GetName());
SCR_M_SvL0_SaveBeginSection(p_tdstFile,
M_MAKECHAR(csCurrentLine),
SCR_CC_C_Cfg_EOL);
//Gets Base structure
DNM_tdstMecBaseIdCard *pStruct = (DNM_tdstMecBaseIdCard *)pclCard->m_fn_pvGetBaseAddress();
// Animation
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseAnimation,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsAnimation(pStruct));
// Collide
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseCollide,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsCollide(pStruct));
// Gravity
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseGravity,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsGravity(pStruct));
// Tilt
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseTilt,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsTilt(pStruct));
// Gi
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseGi,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsGi(pStruct));
// Climb
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseClimb,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsClimb(pStruct));
// On ground
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseOnGround,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsOnGround(pStruct));
// Spider
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseSpider,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsSpider(pStruct));
// Shoot
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseShoot,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsShoot(pStruct));
// Swim
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseSwim,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsSwim(pStruct));
// Collision control
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseCollisionControl,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsCollisionControl(pStruct));
// Keep speed.z
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseKeepWallSpeedZ,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsKeepWallSpeedZ(pStruct));
// Speed limit
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseSpeedLimit,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsSpeedLimit(pStruct));
// Inertia
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseInertia,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsInertia(pStruct));
// Stream
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseStream,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsStream(pStruct));
// Stick on platform
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseStickOnPlatform,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsStickOnPlatform(pStruct));
// scale
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseUseScale,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%i",
DNM_M_bBaseIdCardIsScale(pStruct));
// Gravity factor
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseGravityFactor,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetGravityFactor(pStruct));
// slide
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseSlide,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetSlide(pStruct));
// rebound
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseRebound,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetRebound(pStruct));
// slope limit
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseSlopeLimit,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
MTH_M_xTan (MTH_M_xDegToRad (DNM_M_xBaseIdCardGetSlopeLimit(pStruct))) );
// inertia x
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseInertiaFactorX,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetInertiaFactorX(pStruct) );
// inertia y
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseInertiaFactorY,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetInertiaFactorY(pStruct) );
// inertia z
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseInertiaFactorZ,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetInertiaFactorZ(pStruct) );
// tilt intensity
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseTiltIntensity,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetTiltIntensity(pStruct) );
// tilt inertia
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseTiltInertia,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetTiltInertia(pStruct) );
// tilt origin
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseTiltOrigin,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
2,
"%lf",
DNM_M_xBaseIdCardGetTiltOrigin(pStruct) );
// max speed
SCR_M_SvL0_SaveEntry( p_tdstFile,
C_EntryBaseMaxSpeed,
SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_tdstFile,
SCR_EF_SvL0_Scanf,
4,
"%lf,%lf,%lf",
MTH3D_M_xGetXofVector(DNM_M_pBaseIdCardGetMaxSpeed(pStruct)),
MTH3D_M_xGetYofVector(DNM_M_pBaseIdCardGetMaxSpeed(pStruct)),
MTH3D_M_xGetZofVector(DNM_M_pBaseIdCardGetMaxSpeed(pStruct))
);
//Closes file's main section
SCR_M_SvL0_SaveEndSection(p_tdstFile, SCR_CC_C_Cfg_EOL);
}
//ENDANNECY jt }

View File

@@ -0,0 +1,209 @@
// CPAMVwMS.cpp : implementation file
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECVwMS.hpp"
#include "EMECFmMn.hpp"
#include "EMECDoc.hpp"
#include "EMECCnst.hpp"
#include "_Minterf.hpp"
#include "help_def.h" //for Context Help
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MiniStrucView
IMPLEMENT_DYNCREATE(CPA_Meca_MiniStrucView, CTL_Editor_BaseFormView)
BEGIN_MESSAGE_MAP(CPA_Meca_MiniStrucView, CTL_Editor_BaseFormView)
//{{AFX_MSG_MAP(CPA_Meca_MiniStrucView)
ON_WM_HELPINFO()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//***************************************************************************
CPA_Meca_MiniStrucView::CPA_Meca_MiniStrucView()
: CTL_Editor_BaseFormView(CPA_Meca_MiniStrucView::IDD, TRUE)
{
//{{AFX_DATA_INIT(CPA_Meca_MiniStrucView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_pclOldCardType = NULL;
}
//***************************************************************************
CPA_Meca_MiniStrucView::~CPA_Meca_MiniStrucView()
{
}
//Member Functions
////////////////////////////
//***************************************************************************
void CPA_Meca_MiniStrucView::OnInitialUpdate()
{
CTL_Editor_BaseFormView::OnInitialUpdate();
m_fn_pclGetDocument()->m_pclMiniStrucView = this;
CRect crClientRect;
GetClientRect(crClientRect);
//Sets the edition rectangle
MoveWindow(CRect(0,0,100,100));
m_fn_vCreateAllMS();
}
//*********************************************************************************
// Creates the MS controls (and their data controls)
void CPA_Meca_MiniStrucView::m_fn_vCreateAllMS()
{
m_fn_vCreateMS(&(m_fn_pclGetDocument()->m_clCardTypeList));
}
//*********************************************************************************
// Creates the MS controls (and their data controls)
void CPA_Meca_MiniStrucView::m_fn_vCreateMS(CPA_Meca_CardTypeList *pclList)
{
//Creates the list of MS (non visible action)
CRect crCurrentRect(m_crEditionRect);
crCurrentRect.bottom = crCurrentRect.top + C_MS_LINE_HEIGHT;
CPA_Meca_CardType *pclCurrentCardType;
POSITION MiniStrucPos = pclList->GetHeadPosition();
while ( MiniStrucPos != NULL )
{
pclCurrentCardType = pclList->GetNext(MiniStrucPos);
pclCurrentCardType->m_fn_lCreateMSControls(this, crCurrentRect);
crCurrentRect.OffsetRect(0, C_MS_SPACING + C_MS_LINE_HEIGHT);
}
}
//*******************************************************************************
//Called (during motor for example) to update current data in editor
void CPA_Meca_MiniStrucView::m_fn_vUpdateAllDatas()
{
//Updates all controls
POSITION ControlPos = m_fn_pclGetDocument()->m_pclCurrentCardType->m_clControlList.GetHeadPosition();
while ( ControlPos != NULL )
m_fn_pclGetDocument()->m_pclCurrentCardType->m_clControlList.GetNext(ControlPos)->m_fn_vUpdate();
}
//*******************************************************************************
void CPA_Meca_MiniStrucView::m_fn_vEditCard(CPA_Meca_Card *pclNewCard)
{
m_fn_vUpdateAllDatas();
}
//*******************************************************************************
//To display a Card Type (<--> the associated controls)
void CPA_Meca_MiniStrucView::m_fn_vDisplayCardType(CPA_Meca_CardType *pclNewCardType,
BOOL bMustRepaint)
{
if ( (m_pclOldCardType != NULL) && (m_pclOldCardType != pclNewCardType) )
m_pclOldCardType->m_fn_vHideAllControls();
if ( (bMustRepaint) || (m_pclOldCardType != pclNewCardType) )
{
//If no Card has been selected yet, we chose the first one
//(else names are not displayed)
if ( pclNewCardType->m_fn_pclGetEditedCard() == NULL )
{
//To avoid a non-loaded Card to be selected
CPA_Meca_Card *pclCurrentCard = pclNewCardType->m_fn_pclGetCardsList()->m_pub_fn_pclGetFirstAvailableCard();
pclNewCardType->m_fn_vSetEditedCard(pclCurrentCard);
}
if ( pclNewCardType->m_fn_pclGetEditedCard() != NULL )
{
m_fn_pclGetDocument()->m_fn_vSetPointersForCard(pclNewCardType->m_fn_pclGetEditedCard());
pclNewCardType->m_fn_lOpen(m_crEditionRect);
m_pclOldCardType = pclNewCardType;
}
}
}
//*******************************************************************************
CPA_Meca_MyDocument* CPA_Meca_MiniStrucView::m_fn_pclGetDocument()
{
return g_pclInterface->m_fn_pclGetDocument();
}
//***************************************************************************
BOOL CPA_Meca_MiniStrucView::OnHelpInfo(HELPINFO* pHelpInfo)
{
CString csFileAndWindow = g_pclInterface->m_clDocument.m_csHelpFileNameAndPath;
::WinHelp(m_hWnd,
LPCTSTR(csFileAndWindow),
HELP_CONTEXT,
IDH_GENERAL);
//return CFormView::OnHelpInfo(pHelpInfo);
return FALSE;
}
//***************************************************************************
void CPA_Meca_MiniStrucView::OnSize(UINT nType, int cx, int cy)
{
CTL_Editor_BaseFormView::OnSize(nType, cx, cy);
CRect crClientRect;
GetClientRect(crClientRect);
//Sets the edition rectangle
m_crEditionRect.top = C_MAIN_VIEW_SPACING;
m_crEditionRect.bottom = crClientRect.bottom - C_MAIN_VIEW_SPACING;
m_crEditionRect.left = crClientRect.left + C_MAIN_VIEW_SPACING;
m_crEditionRect.right = crClientRect.right - C_MAIN_VIEW_SPACING - C_SCROLLBAR_WIDTH;
CPoint cpTopLeft(0,C_MAIN_VIEW_SPACING);
CPoint cpTopRight(crClientRect.Width(),C_MAIN_VIEW_SPACING);
if
(
m_fn_pclGetDocument()
&& (m_fn_pclGetDocument()->m_pclCurrentCardType)
&& !(m_fn_pclGetDocument()->m_pclCurrentCardType->m_clControlList.IsEmpty())
)
m_fn_pclGetDocument()->m_pclCurrentCardType->m_clControlList.m_pub_fn_vDisplayControlsInZone(cpTopLeft,cpTopRight);
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MiniStrucView diagnostics
//***************************************************************************
//***************************************************************************
//***************************************************************************
#ifdef _DEBUG
void CPA_Meca_MiniStrucView::AssertValid() const
{
CTL_Editor_BaseFormView::AssertValid();
}
void CPA_Meca_MiniStrucView::Dump(CDumpContext& dc) const
{
CTL_Editor_BaseFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_MiniStrucView message handlers

View File

@@ -0,0 +1,438 @@
// Implementation of the CPA_Meca_ControlView class
///////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "EMECVwMn.hpp"
#include "EMECFmMn.hpp"
#include "EMECVwMS.hpp"
#include "EMECDoc.hpp"
#include "EMECCnst.hpp"
#include "EMECDgNC.hpp"
#include "EMECDgSp.hpp"
#include "EMECDgQu.hpp"
#include "_MecCard.hpp"
#include "_Minterf.hpp"
#include "help_def.h" //For Context help
//External Modules
#include "ErO.h"
#include "IncTUT.h"
//End of External Modules
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_ControlView
IMPLEMENT_DYNCREATE(CPA_Meca_ControlView, CFormView)
BEGIN_MESSAGE_MAP(CPA_Meca_ControlView, CFormView)
//{{AFX_MSG_MAP(CPA_Meca_ControlView)
ON_BN_CLICKED(IDC_BUTTON_CREATE, OnButtonCreate)
ON_BN_CLICKED(IDC_BUTTON_DELETE, OnButtonDelete)
ON_BN_CLICKED(IDC_BUTTON_RENAME, OnButtonRename)
ON_CBN_SELCHANGE(IDC_LIST_CARD_TYPES, OnSelchangeComboCardTypes)
ON_WM_HELPINFO()
ON_WM_SIZE()
ON_BN_CLICKED(IDC_BUTTON_COPY, OnButtonCopy)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_ControlView construction/destruction
//***************************************************************************
CPA_Meca_ControlView::CPA_Meca_ControlView() : CFormView( IDD_MECA_DIALOG_CONTROL )
{
}
//***************************************************************************
CPA_Meca_ControlView::~CPA_Meca_ControlView()
{
}
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_ControlView message handlers
//***************************************************************************
void CPA_Meca_ControlView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
EnableToolTips(TRUE);
m_fn_pclGetDocument()->m_pclControlView = this;
CRect crClientRect;
GetClientRect(crClientRect);
CRect crLastRect;
GetDlgItem(IDC_LIST_CARD_TYPES)->GetClientRect(crLastRect);
crClientRect.bottom = crLastRect.bottom + 5;
crClientRect.right = crLastRect.right + 5;
MoveWindow(crClientRect);
SetScrollSizes(MM_TEXT, CSize(crClientRect.Width() - 5, crClientRect.Height() - 5));
//Sets Icons for Butttons
HICON hIcon = AfxGetApp()->LoadIcon(IDI_ICON_BUTTON_CREATE);
((CButton *)GetDlgItem(IDC_BUTTON_CREATE))->SetIcon(hIcon);
hIcon = AfxGetApp()->LoadIcon(IDI_ICON_BUTTON_RENAME);
((CButton *)GetDlgItem(IDC_BUTTON_RENAME))->SetIcon(hIcon);
hIcon = AfxGetApp()->LoadIcon(IDI_ICON_BUTTON_DELETE);
((CButton *)GetDlgItem(IDC_BUTTON_DELETE))->SetIcon(hIcon);
hIcon = AfxGetApp()->LoadIcon(IDI_ICON_BUTTON_COPY);
((CButton *)GetDlgItem(IDC_BUTTON_COPY))->SetIcon(hIcon);
//Fills the list of cards types
CListBox *pclTypeLB = (CListBox *)GetDlgItem(IDC_LIST_CARD_TYPES);
pclTypeLB->ResetContent();
CPA_Meca_CardType *pclCardType;
short wIndex = 0;
POSITION pos = m_fn_pclGetDocument()->m_clCardTypeList.GetHeadPosition();
while ( pos != NULL )
{
pclCardType = m_fn_pclGetDocument()->m_clCardTypeList.GetNext(pos);
wIndex = pclTypeLB->AddString(pclCardType->m_fn_csGetCardTypeName());
pclTypeLB->SetItemDataPtr(wIndex, (void *)pclCardType);
}
//////////////
//////////////
//Registers for TUT Module
TUT_M_vGetTutDll();
TUT_M_vRegisterControlID(IDC_BUTTON_CREATE, "TMe_ControlView_CreateButton", TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_RENAME, "TMe_ControlView_RenameButton", TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_DELETE, "TMe_ControlView_DeleteButton", TUT_e_Button);
TUT_M_vRegisterControlID(IDC_BUTTON_COPY, "TMe_ControlView_CopyButton", TUT_e_Button);
TUT_M_vRegisterControlID(IDC_LIST_CARD_TYPES, "TMe_ControlView_ListBox", TUT_e_ListBox);
//End of Registers for TUT Module
//////////////
}
//*******************************************************************************
void CPA_Meca_ControlView::OnDestroy()
{
//////////////
//////////////
//UnRegisters for TUT Module
TUT_M_vGetTutDll();
TUT_M_vUnregisterControlID(IDC_BUTTON_CREATE);
TUT_M_vUnregisterControlID(IDC_BUTTON_RENAME);
TUT_M_vUnregisterControlID(IDC_BUTTON_DELETE);
TUT_M_vUnregisterControlID(IDC_BUTTON_COPY);
TUT_M_vUnregisterControlID(IDC_LIST_CARD_TYPES);
//End of UnRegisters for TUT Module
//////////////
CFormView::OnDestroy();
}
//*******************************************************************************
void CPA_Meca_ControlView::OnButtonCreate()
{
if ( m_fn_pclGetDocument()->m_pclCurrentCardType != NULL )
{
CString csNewCardProposedName = m_fn_pclGetDocument()->m_pclCurrentCardType->m_fn_csGetCardTypeName();
//Erases 's' at the End
if ( csNewCardProposedName.Right(1).CompareNoCase("s") == 0 )
csNewCardProposedName = csNewCardProposedName.Left(csNewCardProposedName.GetLength() - 1);
CString csTrueNewCardProposedName;
csTrueNewCardProposedName.Format("%s_%i", csNewCardProposedName,
m_fn_pclGetDocument()->m_pclCurrentCardType->m_fn_ulGetCardsNumber() + 1);
m_fn_pclGetDocument()->m_fn_vCheckSpacesInString(csTrueNewCardProposedName);
CPA_Meca_NewCardDialog dial(csTrueNewCardProposedName, this);
if ( dial.DoModal() == IDOK )
{
m_fn_pclGetDocument()->m_fn_vCheckSpacesInString(dial.m_csName);
//Adds to Card Type's list of Cards
CPA_Meca_Card *pclNewCard = m_fn_pclGetDocument()->m_pclCurrentCardType->m_fn_pclGetCardsList()->m_fn_pclAddElement(dial.m_csName,
m_fn_pclGetDocument()->m_pclCurrentCardType,
NULL,
m_fn_pclGetDocument()->m_pclCurrentCardType->m_fn_csGetFileName(),
m_fn_pclGetDocument()->m_pclCurrentCardType->m_fn_csGetActionName());
//Adds to the Main list
m_fn_pclGetDocument()->m_clListOfCards.fn_bAddObject(pclNewCard);
//Sets the text for the number of Cards
m_fn_vUpdateCardsNumber(pclNewCard->m_fn_pclGetCardType());
//Updates Dialog List
m_fn_pclGetDocument()->m_pclDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
//Edits new Card
m_fn_pclGetDocument()->m_fn_vEditCard(pclNewCard);
}
}
}
//*******************************************************************************
// Deletes a Card
void CPA_Meca_ControlView::OnButtonDelete()
{
CPA_Meca_Card *pclCurrentCard = m_fn_pclGetDocument()->m_pclCurrentCard;
CPA_Meca_CardType *pclCurrentCardType = pclCurrentCard->m_fn_pclGetCardType();
ERROR_ASSERT( pclCurrentCard != NULL );
ERROR_ASSERT( pclCurrentCardType != NULL );
CString csQuestion = "BE CAREFUL !\nYou are going to destroy a Mechanical Card !";
csQuestion += "Name is '" + pclCurrentCard->GetName() + "', of type '" + pclCurrentCardType->m_fn_csGetCardTypeName() + "'\n";
csQuestion += "Do you really want to continue ?";
CPA_Meca_QuestionDialog dial(this, csQuestion);
if ( dial.DoModal() == IDYES )
{
//Adds to the Main list
m_fn_pclGetDocument()->m_clListOfCards.fn_bRemoveObject(pclCurrentCard);
//Destroys the Card ...
//...from the list
m_fn_pclGetDocument()->m_fn_vRemoveCard(pclCurrentCard);
//Sets the text for the number of Cards
m_fn_vUpdateCardsNumber(pclCurrentCardType);
//Updates Dialog List
m_fn_pclGetDocument()->m_pclDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
//*******************************************************************************
void CPA_Meca_ControlView::OnButtonRename()
{
CPA_Meca_NewCardDialog dial(m_fn_pclGetDocument()->m_pclCurrentCard->m_fn_csGetCardName(),
this);
if ( dial.DoModal() == IDOK )
{
m_fn_pclGetDocument()->m_pclCurrentCard->fn_eRename(dial.m_csName);
//Updates Dialog List
m_fn_pclGetDocument()->m_pclDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
//*******************************************************************************
void CPA_Meca_ControlView::OnButtonCopy()
{
//Creates a copy of the currently selected Card
if ( m_fn_pclGetDocument()->m_pclCurrentCard != NULL )
{
CPA_Meca_Card *pclCopyCard = m_fn_pclGetDocument()->m_pub_fn_vCreateCopyOfCard(m_fn_pclGetDocument()->m_pclCurrentCard);
if (pclCopyCard == NULL)
return;
//ERROR_ASSERT( pclCopyCard != NULL );
//Adds to the Main list
m_fn_pclGetDocument()->m_clListOfCards.fn_bAddObject(pclCopyCard);
//Sets the text for the number of Cards
m_fn_vUpdateCardsNumber(pclCopyCard->m_fn_pclGetCardType());
//Updates Dialog List
m_fn_pclGetDocument()->m_pclDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
//Edits new Card
m_fn_pclGetDocument()->m_fn_vEditCard(pclCopyCard);
}
}
//*******************************************************************************
void CPA_Meca_ControlView::OnSelchangeComboCardTypes()
{
//Gets the new selected type
CPA_Meca_CardType *pclCardType = NULL;
CListBox *pclTypeLB = (CListBox *)GetDlgItem(IDC_LIST_CARD_TYPES);
short wIndex = pclTypeLB->GetCurSel();
if ( wIndex != CB_ERR )
{
pclCardType = (CPA_Meca_CardType *)pclTypeLB->GetItemDataPtr(wIndex);
//Sets document's pointer
m_fn_pclGetDocument()->m_fn_vDisplayCardType(pclCardType);
//Sets the text for the number of Cards
m_fn_vUpdateCardsNumber(pclCardType);
//Sets document's pointer
if ( pclCardType->m_fn_pclGetEditedCard() != NULL )
m_fn_pclGetDocument()->m_fn_vEditCard(pclCardType->m_fn_pclGetEditedCard());
}
//Refreshes controls
((CButton *)GetDlgItem(IDC_BUTTON_CREATE))->EnableWindow( wIndex != CB_ERR );
//Updates Dialog List
if ( pclCardType != NULL )
{
CString csType = "Cards of type '" + pclCardType->m_fn_csGetCardTypeName() + "'";
m_fn_pclGetDocument()->m_pclDialogList->fn_vInitButtonTest( csType,
TRUE,
TRUE);
m_fn_pclGetDocument()->m_pclDialogList->fn_vUpdateSelection(E_lrm_ReinitList);
}
}
//*******************************************************************************
void CPA_Meca_ControlView::m_fn_vUpdateCardsNumber(CPA_Meca_CardType *_pclCardType)
{
if ( _pclCardType != NULL )
{
CString csNumberOfCards;
CString csCard = (_pclCardType->m_fn_pclGetCardsList()->GetCount() > 1) ? "Cards" : "Card";
csNumberOfCards.Format("%i %s", _pclCardType->m_fn_pclGetCardsList()->GetCount(),
LPCTSTR(csCard));
GetDlgItem(IDC_STATIC_CARD_NUMBER)->SetWindowText(csNumberOfCards);
}
}
//*******************************************************************************
void CPA_Meca_ControlView::m_fn_vUpdateCardsName()
{
if ( m_fn_pclGetDocument()->m_pclCurrentCard != NULL )
{
//Displays Card's Name in View's title bar
CString csCardName = m_fn_pclGetDocument()->m_pclCurrentCard->GetName();
if ( m_fn_pclGetDocument()->m_pclCurrentCard->m_pub_fn_bIsNotified() )
csCardName += " (** Modified **)";
GetDlgItem(IDC_TEXT_CARD_NAME)->SetWindowText(csCardName);
}
}
//*******************************************************************************
CPA_Meca_MyDocument* CPA_Meca_ControlView::m_fn_pclGetDocument()
{
return g_pclInterface->m_fn_pclGetDocument();
}
//*******************************************************************************
BOOL CPA_Meca_ControlView::OnHelpInfo(HELPINFO* pHelpInfo)
{
CString csFileAndWindow = g_pclInterface->m_clDocument.m_csHelpFileNameAndPath;
::WinHelp(m_hWnd,
LPCTSTR(csFileAndWindow),
HELP_CONTEXT,
IDH_GENERAL);
return FALSE;
}
//*************************************************************************
//Definition of texts for Tool Tips
BOOL CPA_Meca_ControlView::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
nID = ::GetDlgCtrlID((HWND)nID);
BOOL bReturn = FALSE;
switch ( nID )
{
case IDC_BUTTON_CREATE:
strcpy(pTTT->szText,"Creates a Mechanics Card");
break;
case IDC_BUTTON_RENAME:
strcpy(pTTT->szText,"Renames the current Card");
break;
case IDC_BUTTON_DELETE:
strcpy(pTTT->szText,"Deletes the current Card");
break;
case IDC_BUTTON_COPY:
strcpy(pTTT->szText,"Creates a copy of the current Card");
break;
case IDC_LIST_CARD_TYPES:
strcpy(pTTT->szText,"All types of Mechanics Card");
break;
case IDC_STATIC_CARD_NUMBER:
strcpy(pTTT->szText,"Number of Cards for the current Type");
break;
default:
strcpy(pTTT->szText,"");
break;
};
return (TRUE);
}
#define EdMeca_C_ControlsSpacing 2
#define EdMeca_C_EditHeight 15
//*************************************************************************
void CPA_Meca_ControlView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
//Adjusts controls
CRect crCurrentRect;
long lBottom;
//ListBox
if ( GetDlgItem(IDC_LIST_CARD_TYPES) != NULL )
{
GetDlgItem(IDC_LIST_CARD_TYPES)->GetWindowRect(crCurrentRect);
ScreenToClient(crCurrentRect);
lBottom = cy - EdMeca_C_EditHeight - 2*EdMeca_C_ControlsSpacing;
crCurrentRect.bottom = lBottom;
GetDlgItem(IDC_LIST_CARD_TYPES)->MoveWindow(crCurrentRect);
}
//Edit (for the current Card's name)
if ( GetDlgItem(IDC_TEXT_CARD_NAME) != NULL )
{
GetDlgItem(IDC_TEXT_CARD_NAME)->GetWindowRect(crCurrentRect);
ScreenToClient(crCurrentRect);
crCurrentRect.top = lBottom + EdMeca_C_ControlsSpacing;
crCurrentRect.bottom = crCurrentRect.top + EdMeca_C_EditHeight;
GetDlgItem(IDC_TEXT_CARD_NAME)->MoveWindow(crCurrentRect);
}
}
//*******************************************************************************
//*******************************************************************************
/////////////////////////////////////////////////////////////////////////////
// CPA_Meca_ControlView diagnostics
#ifdef _DEBUG
void CPA_Meca_ControlView::AssertValid() const
{
CFormView::AssertValid();
}
void CPA_Meca_ControlView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG

View File

@@ -0,0 +1,255 @@
// The one and only file to be touched to accomodate this editor with your project
////////////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include <limits.h>
#include <float.h>
#include "EditMDef.hpp"
#include "EMECDoc.hpp"
#include "EMECAllo.hpp"
#include "EMECDtMd.hpp"
#include "EMECFlds.hpp"
#include "EMECClBk.hpp"
#include "EMECCStr.hpp"
#include "_Minterf.hpp"
//External Modules
#include "ErO.h"
#include "CTL.h"
//End of External Modules
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//**********************************************************************************************
void CPA_Meca_MyDocument::m_fn_vFillCardsTypeList()
{
CPA_Meca_CardType *pclCardType;
/// For Controls
CTL_fn_vSetDefaultCallBackFunctionWhenControlMustBeDisplayed(TME_fn_bControlCanBeDisplayedCallBack);
/// End of 'For Controls'
///////// Adds a Card Type ///////////
pclCardType = m_clCardTypeList.m_fn_pclAddElement("Camera Cards", DNM_eCamera);
/// Defines it ///
pclCardType->m_p_fn_vUnallocate = &fn_vUnalloc6;
pclCardType->m_p_fn_vFill = &fn_vFillCard6;
pclCardType->m_p_fn_vSave = &fn_vSaveCard6;
pclCardType->m_fn_vSetFileName("Camera.mec");
pclCardType->m_fn_vSetActionName(C_SectionIdCardCamera);
//+++++++++++++++++++++++++++++++ Describes the Card Type +++++++++++++++++++++++++++++++
pclCardType->m_fn_vAddDecimalControl(-FLT_MAX, FLT_MAX, EDMEC_FLOAT, EDMEC_READ_WRITE, "Linear Speed");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
pclCardType->m_fn_vAddDecimalControl( -FLT_MAX, FLT_MAX, EDMEC_FLOAT, EDMEC_READ_WRITE, "Angular Delta (rad/s)");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
pclCardType->m_fn_vAddDecimalControl(-FLT_MAX, FLT_MAX, EDMEC_FLOAT, EDMEC_READ_WRITE, "Speeding Up (m/s)");
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
///////// Base ///////////
pclCardType = m_clCardTypeList.m_fn_pclAddElement("Base Cards", DNM_eBase);
/// Defines it ///
pclCardType->m_p_fn_vUnallocate = &fn_vUnallocRay2Egypte1;
pclCardType->m_p_fn_vFill = &fn_vFillCardRay2Egypte1;
pclCardType->m_p_fn_vSave = &fn_vSaveCardRay2Egypte1;
pclCardType->m_fn_vSetFileName("Base.mec");
pclCardType->m_fn_vSetActionName(C_SectionIdCardBase);
//+++++++++++++++++++++++++++++++ Describes the Card Type +++++++++++++++++++++++++++++++
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Animation);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Collide);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Gravity);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Tilt);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Gi);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_OnGround);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Climb);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Spider);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Shoot);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Swim);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_CollisionControl);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_KeepSpeedZ);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_SpeedLimit);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Inertia);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Stream);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_StickOnPlatform);
pclCardType->m_fn_vAddBooleanControl(EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Scale);
pclCardType->m_fn_vAddDecimalControl(-100, 100, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_GravityFactor);
pclCardType->m_fn_vAddDecimalControl(-100, 100, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Slide);
pclCardType->m_fn_vAddDecimalControl(-100, 100, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_Rebound);
pclCardType->m_fn_vAddDecimalControl(-90, 90, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_SlopeLimit);
pclCardType->m_fn_vAddDecimalControl(-10, 10, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_InertiaFactorX);
pclCardType->m_fn_vAddDecimalControl(-10, 10, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_InertiaFactorY);
pclCardType->m_fn_vAddDecimalControl(-10, 10, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_InertiaFactorZ);
pclCardType->m_fn_vAddDecimalControl(-10, 10, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_TiltIntensity);
pclCardType->m_fn_vAddDecimalControl(-10, 10, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_TiltInertia);
pclCardType->m_fn_vAddDecimalControl(-10, 10, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_TiltOrigin);
pclCardType->m_fn_vAddDecimalControl(-100, 100, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_MaxSpeed + " x");
pclCardType->m_fn_vAddDecimalControl(-100, 100, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_MaxSpeed + " y");
pclCardType->m_fn_vAddDecimalControl(-100, 100, EDMEC_FLOAT, EDMEC_READ_WRITE,g_c_cs_FieldName_Base_MaxSpeed + " z");
/// For Controls
CTL_fn_vSetDefaultCallBackFunctionWhenControlMustBeDisplayed(NULL);
/// End of 'For Controls'
}
#define TME_M_ADD_OWNER_DATA(a) \
a->m_pub_fn_pclAddOwnerData((void *)pclCard, TME_g_c_cs_DataOwnerData_ParentCard);
//**********************************************************************************************
void fn_vFillCard6(CPA_Meca_Card *pclCard)
{
if ( !pclCard->m_bDataCreated )
{
/// For Controls
CTL_fn_vSetDefaultCallBackFunctionWhenDataHasChanged(TME_fn_vCallBackWhenADataHasChanged);
/// End of 'For Controls'
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, "Linear Speed"));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, "Angular Delta (rad/s)"));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, "Speeding Up (m/s)"));
pclCard->m_bDataCreated = TRUE;
/// For Controls
CTL_fn_vSetDefaultCallBackFunctionWhenDataHasChanged(NULL);
/// End of 'For Controls'
}
if ( pclCard->m_fn_pvGetBaseAddress() == NULL )
{
POSITION pos = pclCard->m_clDataList.GetHeadPosition();
while ( pos != NULL )
(pclCard->m_clDataList.GetNext(pos))->m_fn_vSetMotorDataPtr(NULL);
}
else
{
POSITION pos = pclCard->m_clDataList.GetHeadPosition();
//Gets the struct
DNM_stMecCameraIdCard * pStruct = (DNM_stMecCameraIdCard *)pclCard->m_fn_pvGetBaseAddress();
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xLinearSpeed)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xAngularSpeed)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xSpeedingUp)));
ERROR_ASSERT(pos == NULL);
}
}
void fn_vFillCardRay2Egypte1(CPA_Meca_Card *pclCard)
{
if ( !pclCard->m_bDataCreated )
{
/// For Controls
CTL_fn_vSetDefaultCallBackFunctionWhenDataHasChanged(TME_fn_vCallBackWhenADataHasChanged);
/// End of 'For Controls'
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0001, g_c_cs_FieldName_Base_Animation));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0002, g_c_cs_FieldName_Base_Collide));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0004, g_c_cs_FieldName_Base_Gravity));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0008, g_c_cs_FieldName_Base_Tilt));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0010, g_c_cs_FieldName_Base_Gi));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0020, g_c_cs_FieldName_Base_OnGround));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0040, g_c_cs_FieldName_Base_Climb));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0080, g_c_cs_FieldName_Base_Spider));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0001, g_c_cs_FieldName_Base_Shoot));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0002, g_c_cs_FieldName_Base_Swim));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0002, g_c_cs_FieldName_Base_CollisionControl));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0004, g_c_cs_FieldName_Base_KeepSpeedZ));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0008, g_c_cs_FieldName_Base_SpeedLimit));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0010, g_c_cs_FieldName_Base_Inertia));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0020, g_c_cs_FieldName_Base_Stream));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0040, g_c_cs_FieldName_Base_StickOnPlatform));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddBitFieldBooleanData(0x0080, g_c_cs_FieldName_Base_Scale));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_GravityFactor));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_Slide));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_Rebound));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_SlopeLimit));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_InertiaFactorX));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_InertiaFactorY));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_InertiaFactorZ));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_TiltIntensity));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_TiltInertia));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_TiltOrigin));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_MaxSpeed + " x" ));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_MaxSpeed + " y" ));
TME_M_ADD_OWNER_DATA(pclCard->m_clDataList.m_fn_pclAddDecimalData(EDMEC_FLOAT, g_c_cs_FieldName_Base_MaxSpeed + " z" ));
pclCard->m_bDataCreated = TRUE;
/// For Controls
CTL_fn_vSetDefaultCallBackFunctionWhenDataHasChanged(NULL);
/// End of 'For Controls'
}
if ( pclCard->m_fn_pvGetBaseAddress() == NULL )
{
POSITION pos = pclCard->m_clDataList.GetHeadPosition();
while ( pos != NULL )
(pclCard->m_clDataList.GetNext(pos))->m_fn_vSetMotorDataPtr(NULL);
}
else
{
POSITION pos = pclCard->m_clDataList.GetHeadPosition();
//Gets the struct
DNM_tdstMecBaseIdCard *pStruct = (DNM_tdstMecBaseIdCard *)pclCard->m_fn_pvGetBaseAddress();
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->ulFlags)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 2);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr(((char *)(&(pStruct->ulFlags))) + 1);
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xGravity)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xSlide)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xRebound)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xSlopeLimit)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xInertiaX)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xInertiaY)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xInertiaZ)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xTiltIntensity)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xTiltInertia)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_xTiltOrigin)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_stMaxSpeed.xX)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_stMaxSpeed.xY)));
pclCard->m_clDataList.GetNext(pos)->m_fn_vSetMotorDataPtr((void *)(&(pStruct->m_stMaxSpeed.xZ)));
ERROR_ASSERT(pos == NULL);
}
}
//**********************************************************************************************
//Constructs the objects representing the enum definitions
void CPA_Meca_MyDocument::m_fn_vConstructListOfEnumDescriptors()
{
}

View File

@@ -0,0 +1,10 @@
LIBRARY
EXPORTS
fn_p_szGetCPAVersion
fn_p_stGetDLLIdentity
fn_p_oGetDLL
fn_vInitDll
SECTIONS
.data READ WRITE

View File

@@ -0,0 +1,6 @@
// StdAfx.cpp : source file that includes just the standard includes
// EdCarac.pch will be the pre-compiled header
// StdAfx.obj will contain the pre-compiled type information
#include "StdAfx.h"

View File

@@ -0,0 +1,124 @@
//
// Common functions for Object DLL capabilities
// C. Beaudet
//
#include "StdAfx.h"
#include "afxdllx.h"
#include "ACP_Base.h"
#include "ITF.h"
#include "IncMEC.h"
#define D_State_Define
#include "IncGAM.h"
#undef D_State_Define
#include "GLI.h"
#include "_Minterf.hpp"
#include "EMECStrg.hpp"
//------------------------------------------------------------------------
// Global vars
static CList<CPA_DLLBase*,CPA_DLLBase*> g_oListOfInstances; //private internal
static char *gs_p_szCPAVersion = C_szCPAVersion;
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
#ifdef DLL_ONLY_ONE_INSTANCE
static CPA_Meca_Interface *gs_p_oMecaInterface = NULL;
#endif
//------------------------------------------------------------------------
// functions that are present in all DLL :
//------------------------------------------------------------------------
//========================================================================
// Get current CPA version
//========================================================================
extern "C" char __declspec(dllexport) *fn_p_szGetCPAVersion(void)
{
return gs_p_szCPAVersion;
}
//========================================================================
// Get type of this DLL
//========================================================================
extern "C" tdstDLLIdentity __declspec(dllexport) *fn_p_stGetDLLIdentity(void)
{
g_stMecaDLLIdentity.eType = TOOL_DLL;
g_stMecaDLLIdentity.csName = C_szDLLMecaName;
g_stMecaDLLIdentity.hModule = NULL;
g_stMecaDLLIdentity.p_oListOfInstances = &g_oListOfInstances;
return &g_stMecaDLLIdentity;
}
//========================================================================
// DLL int function
//========================================================================
extern "C" void __declspec(dllexport) fn_vInitDll(void)
{
new CDynLinkLibrary(extensionDLL);
}
//========================================================================
// DLL entry point
//========================================================================
extern "C" int __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(extensionDLL, hInstance))
return 0;
}
return 1;
}
//========================================================================
// Get the DLL
//========================================================================
extern "C" CPA_DLLBase __declspec(dllexport) *fn_p_oGetDLL(long lKey)
{
#ifdef DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
if (gs_p_oMYTOOLInterface == NULL)
{
gs_p_oMecaInterface = new CPA_Meca_Interface();
ERROR_ASSERT(gs_p_oMecaInterface != NULL);
// YB //
g_pclInterface = gs_p_oMecaInterface;
// End YB //
}
return gs_p_oMecaInterface;
break;
default:
return NULL;
}
#else //DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
// YB //
g_pclInterface = new CPA_Meca_Interface();
return g_pclInterface;
// End YB //
break;
default:
return NULL;
}
#endif //DLL_ONLY_ONE_INSTANCE
}
//------------------------------------------------------------------------
// functions that are present in this type of DLL only :
//------------------------------------------------------------------------
#undef DLL_ONLY_ONE_INSTANCE

View File

@@ -0,0 +1,479 @@
// Implementation for the definition of the class representing a Mechanical Card
/////////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "_MecCard.hpp"
#include "_Minterf.hpp"
#include "EMECStrg.hpp"
#include "EMECVwMn.hpp"
#include "Dpt.h"
#include "ErO.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//***************************************************************************
CPA_Meca_Card::CPA_Meca_Card( CString csName,
CPA_Meca_CardType *pclCardType,
CString csEngineFileName,
CString csEngineActionName,
void *pvBaseAddress,
BOOL bCanbBeLoaded /*= FALSE*/)
: CPA_SaveObject( g_pclInterface,
g_c_csMecaCardTypeName,
E_ss_Responsible)
{
//Internal inits
m_pri_bIsNotified = FALSE;
//Section object
SetSectionData(this);
SetCallBackSave(s_m_fn_vCallBackSaveMecaCard);
SetDataPath(fn_szGetMechanicsDataPath());
m_pub_fn_vSetCompleteFileName(csEngineFileName);
m_pub_fn_vSetActionName(csEngineActionName);
SetReferencedSectionName(m_pri_fn_csComputeReferencedSectionName());
//Base objet
fn_bSetOwner(NULL);
//Name
if ( fn_eRename(csName) != E_mc_None )
SetDefaultValidName();
fn_vUpdateSectionName();
if ( pvBaseAddress != NULL )
SetExistingSection(TRUE);
else
{
if ( bCanbBeLoaded )
SetExistingSection(TRUE);
else
SetExistingSection(FALSE);
}
if ( !fn_bSectionExists() )
fn_vNotifySave();
//Specific Inits
m_pclCardType = pclCardType;
m_bDataCreated = FALSE;
//Allocates the structure
if ( pvBaseAddress == NULL )
{
if ( !bCanbBeLoaded )
m_fn_vSetBaseAddress( DNM_fn_xIdentityCardCreate(m_pclCardType->m_fn_tdeGetMotorID()) );
}
else
//There is an exiting Card (loaded by Motor)
m_fn_vSetBaseAddress( pvBaseAddress );
if ( !bCanbBeLoaded )
{
//Calls the filling function
ERROR_ASSERT( m_pclCardType->m_p_fn_vFill != NULL );
m_pclCardType->m_p_fn_vFill(this);
//Updates Editor values with motor ones
m_pri_fn_vGetAllMotorValues();
}
}
//***************************************************************************
CPA_Meca_Card::~CPA_Meca_Card()
{
//Unallocates the structure
ERROR_ASSERT( m_pclCardType->m_p_fn_vUnallocate != NULL );
m_pclCardType->m_p_fn_vUnallocate(this);
}
//***************************************************************************
void *CPA_Meca_Card::GetEngineStruct()
{
return m_fn_pvGetBaseAddress();
}
//***************************************************************************
void *CPA_Meca_Card::m_fn_pvGetBaseAddress()
{
return m_pvBaseAddress;
}
//***************************************************************************
void CPA_Meca_Card::m_fn_vSetBaseAddress(void *pvNewAddress)
{
//Base Object
fn_vUpdateData(pvNewAddress);
//Internal
m_pvBaseAddress = pvNewAddress;
}
//***************************************************************************
CString CPA_Meca_Card::m_fn_csGetCardName()
{
return CString(GetName());
}
//***************************************************************************
void CPA_Meca_Card::m_fn_vSetCardName(CString csNewName)
{
fn_eRename(csNewName);
}
//***************************************************************************
CPA_Meca_CardType *CPA_Meca_Card::m_fn_pclGetCardType()
{
return m_pclCardType;
}
//***************************************************************************
void CPA_Meca_Card::m_fn_pclSetCardType(CPA_Meca_CardType *pclNewType)
{
m_pclCardType = pclNewType;
}
//***************************************************************************
void CPA_Meca_Card::m_pri_fn_vGetAllMotorValues()
{
POSITION pos = m_clDataList.GetHeadPosition();
while ( pos != NULL )
m_clDataList.GetNext(pos)->m_fn_vGetMotorData();
}
//******************************************************************************
CString CPA_Meca_Card::m_pri_fn_csComputeReferencedSectionName()
{
CString csReferencedSectioName;
csReferencedSectioName = m_pub_fn_csGetReferencedFileName() + '^' + m_pub_fn_csGetActionName() + ':' + GetName();
return csReferencedSectioName;
}
//******************************************************************************
//Not to be used ...
CString CPA_Meca_Card::m_pri_fn_csComputeCompleteSectionName()
{
CString csCompleteSectioName;
CString csFileName /*= GetFileName()*/;
//Adds the Path to the file name
short wIndex = csFileName.ReverseFind('\\');
//If no Path is present
if ( wIndex == -1 )
{
//Security...
if ( csFileName == "NoFileName" )
{
csFileName = m_pclCardType->m_fn_csGetFileName();
// SetActionName(m_pclCardType->m_fn_csGetActionName());
}
csFileName = "GameData\\World\\Libraries\\Mechanics\\" + csFileName;
// SetFileName(csFileName);
}
// csCompleteSectioName = GetFileName() + '^' + GetActionName() + ':' + GetName();
return csCompleteSectioName;
}
//For Save
//******************************************************************************
/*void CPA_Meca_Card::fn_vNotify(SCR_tde_Ntfy_Action _eAction)
{
switch( _eAction )
{
case SCR_EA_Ntfy_RebuildSection:
case SCR_EA_Ntfy_ModifySection:
case SCR_EA_Ntfy_AddSection:
SCR_fn_v_SvL1_RegisterNotify( (char*)LPCTSTR(GetCompleteSectionName()),
s_m_fn_vCallBackSaveMecaCard,
(void *)this,
_eAction);
break ;
case SCR_EA_Ntfy_DeleteSection:
SCR_fn_v_SvL1_RegisterNotify( (char*)LPCTSTR(GetCompleteSectionName()),
NULL,
(void *)this,
_eAction);
break ;
}
}
*/
//******************************************************************************
CString CPA_Meca_Card::m_pub_fn_csGetActionName()
{
return m_pri_csActionName;
}
//******************************************************************************
void CPA_Meca_Card::m_pub_fn_vSetActionName(CString csNewName)
{
m_pri_csActionName = csNewName;
}
//******************************************************************************
CString CPA_Meca_Card::m_pub_fn_csGetCompleteFileName()
{
return m_pri_csCompleteFileName;
}
//******************************************************************************
CString CPA_Meca_Card::m_pub_fn_csGetReferencedFileName()
{
return m_pri_csReferencedFileName;
}
//******************************************************************************
void CPA_Meca_Card::m_pub_fn_vSetCompleteFileName(CString csNewName)
{
m_pri_csCompleteFileName = csNewName;
short wIndexInString = csNewName.ReverseFind('\\');
if ( wIndexInString != -1 )
m_pri_csReferencedFileName = csNewName.Right(csNewName.GetLength() - wIndexInString - 1);
else
m_pri_csReferencedFileName = m_pri_csCompleteFileName;
}
//******************************************************************************
BOOL CPA_Meca_Card::m_pub_fn_bIsNotified()
{
return m_pri_bIsNotified;
}
//Notifications
//******************************************************************************
void CPA_Meca_Card::fn_vNotifySave()
{
CPA_SaveObject::fn_vNotifySave();
//Marks the Card
if ( !m_pri_bIsNotified )
{
m_pri_bIsNotified = TRUE;
g_pclInterface->m_clDocument.m_pclControlView->m_fn_vUpdateCardsName();
}
}
//******************************************************************************
void CPA_Meca_Card::fn_vNotifyUnSave()
{
CPA_SaveObject::fn_vNotifyUnSave();
//Marks the Card
if ( m_pri_bIsNotified )
{
m_pri_bIsNotified = FALSE;
g_pclInterface->m_clDocument.m_pclControlView->m_fn_vUpdateCardsName();
}
}
//******************************************************************************
void CPA_Meca_Card::fn_vNotifyRestore()
{
CPA_SaveObject::fn_vNotifyRestore();
//Marks the Card
if ( !m_pri_bIsNotified )
{
m_pri_bIsNotified = TRUE;
g_pclInterface->m_clDocument.m_pclControlView->m_fn_vUpdateCardsName();
}
}
//******************************************************************************
void CPA_Meca_Card::fn_vNotifyRename()
{
CPA_SaveObject::fn_vNotifyRename();
//Marks the Card
if ( !m_pri_bIsNotified )
{
m_pri_bIsNotified = TRUE;
g_pclInterface->m_clDocument.m_pclControlView->m_fn_vUpdateCardsName();
}
}
//******************************************************************************
void CPA_Meca_Card::s_m_fn_vCallBackSaveMecaCard( SCR_tdst_File_Description *_p_stFile,
char *_p_szSectionName,
void *_p_vData,
SCR_tde_Ntfy_Action _eAction)
{
CPA_Meca_Card *p_clMecaCard = (CPA_Meca_Card *)_p_vData ;
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,"Saving a Mechanical Card",
"CPA_Meca_Card::s_m_fn_vCallBackSaveMecaCard(...)",
E_ERROR_GRAVITY_FATAL,
"Pointer on Card is NULL ; Card could not be saved.");
ERROR_ASSERT( p_clMecaCard != NULL );
if ( p_clMecaCard != NULL )
{
switch ( _eAction )
{
case SCR_EA_Ntfy_AddSection:
case SCR_EA_Ntfy_AddOrModifySection:
case SCR_EA_Ntfy_AddOrRebuildSection:
case SCR_EA_Ntfy_RebuildSection:
case SCR_EA_Ntfy_ModifySection:
//Saves Mecanichal Card
p_clMecaCard->m_fn_vSaveMecaCard(_p_stFile, _eAction);
p_clMecaCard->m_pri_bIsNotified = FALSE;
p_clMecaCard->fn_vSectionSaved();
break ;
case SCR_EA_Ntfy_DeleteIfExists:
case SCR_EA_Ntfy_DeleteSection:
p_clMecaCard->fn_vSectionDeleted();
break;
}
}
}
//******************************************************************************
BOOL CPA_Meca_Card::m_fn_bLoadIfUnloaded()
{
if ( !fn_bIsAvailable() )
{
//Loads the corresponding section
CString csSectionName = GetCompleteSectionName();
SCR_tdst_Cxt_Values *p_stValues;
p_stValues = SCR_fnp_st_RdL0_AnalyseSection((char *)LPCTSTR(csSectionName),
SCR_CDF_uw_Anl_Normal);
//Displays the last loaded Actor
void *pvBaseAddress = (void *)p_stValues->a_ulValues[0];
m_fn_vSetBaseAddress(pvBaseAddress);
//Calls the filling function
ERROR_ASSERT( m_pclCardType->m_p_fn_vFill != NULL );
m_pclCardType->m_p_fn_vFill(this);
// update parameter
DNM_tdstMecBaseIdCard *pMecCard = (DNM_tdstMecBaseIdCard *)m_fn_pvGetBaseAddress();
DNM_M_vBaseIdCardSetSlopeLimit ( pMecCard, MTH_M_xRadToDeg ( MTH_M_xATan (DNM_M_xBaseIdCardGetSlopeLimit(pMecCard))) );
//Updates Editor values with motor ones
m_pri_fn_vGetAllMotorValues();
SetAvailable(TRUE);
//Edits
g_pclInterface->m_clDocument.m_fn_vEditCard(this);
m_pclCardType->m_bAtLeastOneCardOfTheCardTypeHasBeenLoaded = TRUE;
return TRUE;
}
else
return FALSE;
}
//**************************************************************************************
//Virtual functions
//**************************************************************************************
//**************************************************************************************
long CPA_Meca_Card::GetDataType(void)
{
return 0;
}
//**************************************************************************************
void *CPA_Meca_Card::GetData(void)
{
return m_fn_pvGetBaseAddress();
}
//**************************************************************************************
BOOL CPA_Meca_Card::fn_bCanBeNotified(void)
{
return TRUE;
}
//**************************************************************************************
//** CPA_Meca_CardList class ***********************************************************
//**************************************************************************************
CPA_Meca_CardList::CPA_Meca_CardList()
{
}
//**************************************************************************************
CPA_Meca_CardList::~CPA_Meca_CardList()
{
m_fn_vEmptyList();
}
//**************************************************************************************
CPA_Meca_Card* CPA_Meca_CardList::m_fn_pclAddElement( CString csName,
CPA_Meca_CardType *pclCardType,
void *pvBaseAddress,
CString csFileName /*= ""*/,
CString csSectionName /*= ""*/,
BOOL bCanbBeLoaded /*= FALSE*/)
{
CPA_Meca_Card *pclNewElement = new CPA_Meca_Card( csName,
pclCardType,
csFileName,
csSectionName,
pvBaseAddress,
bCanbBeLoaded);
AddTail(pclNewElement);
return pclNewElement;
}
//**************************************************************************************
void CPA_Meca_CardList::m_fn_vEmptyList()
{
POSITION pos = GetHeadPosition();
while( pos != NULL )
delete (GetNext(pos));
RemoveAll();
}
//**************************************************************************************
//Returns the first available (i.e. loaded) Card in the List
CPA_Meca_Card *CPA_Meca_CardList::m_pub_fn_pclGetFirstAvailableCard()
{
CPA_Meca_Card *pclCurrentCard;
BOOL bFound = FALSE;
POSITION pos = GetHeadPosition();
while ( (pos != NULL) && (!bFound) )
{
pclCurrentCard = GetNext(pos);
bFound = pclCurrentCard->fn_bIsAvailable();
}
if ( bFound )
return pclCurrentCard;
else
return NULL;
}

View File

@@ -0,0 +1,575 @@
//#################################################################################
//
// BASE CLASS OF YOUR DLL interface
//
//#################################################################################
#include "StdAfx.h"
#include "ACP_Base.h"
#include "ITF.h"
#include "IncMEC.h"
#define D_State_Define
#include "IncGAM.h"
#undef D_State_Define
#include "GLI.h"
#include "SCR.h"
#include "_Minterf.hpp"
#include "EMECStrg.hpp"
#include "EMECVwMn.hpp"
#include "Meca_Res.h"
#include "ErO.h"
#include "IncTUT.h"
#include "X:\CPA\Main\Inc\_EditID.h"
// infos
static CString g_csTMEName = C_szDLLMecaName;
static CString g_csTMEAuthor = "Y. Babitch";
static CString g_csTMEVersion = "V 4.0.2 18/03/99";
static CString g_csTMEFrenchHelpFile = "Meca.hlp";
static CString g_csTMEEnglishHelpFile = "";
BOOL g_bTipFirstTime = TRUE;
CPA_Meca_Interface *g_pclInterface;
#define C_EdMeca_MenuID_OpenID 31
#define C_EdMeca_MenuID_CloseID 32
#define C_EdMeca_MenuID_SaveDimensions 35
#define C_EdMeca_PopupID_Exit_Editor 41
// the DLL global definition
tdstDLLIdentity g_stMecaDLLIdentity;
//--------------------------------------------------------------------------------
// CONSTRUCTOR.
// You must put here all your DLL interface definitions.
//--------------------------------------------------------------------------------
CPA_Meca_Interface::CPA_Meca_Interface(void)
{
// ************************** private internal
m_p_stDLLIdentity = &g_stMecaDLLIdentity;
// Does your DLL can output in main game view ?
m_stBaseDLLDefinition.bCanOutputIn3DView = FALSE;
// Does your DLL can be refresh by engine ?
m_stBaseDLLDefinition.bCanBeRefreshedByEngine = FALSE;
// Specific Init.
m_pclMecaMainFrame = NULL;
m_csEditorVersion = "4.0.0 [" + CString(__DATE__) + "] (<using CTL version " + CTL_fn_csGetVersion() + ">)";
SetEditorInfo(g_csTMEName, g_csTMEAuthor, g_csTMEVersion, g_csTMEFrenchHelpFile, g_csTMEEnglishHelpFile);
SetCurrent(FALSE);
//For errors
ERROR_g_fn_vAddAModuleDescriptor( g_c_csMecaModuleNameForErrors,
m_csEditorVersion,
"Yves BABITCH",
"01 48 18 53 74 (Montreuil)",
"ybabitch@ubisoft.fr",
"Daniel PALIX",
"04 50 51 26 63 (Annecy)",
"dpalix@ubisoft.fr",
"",
"",
""
);
m_pri_pclSelectedCard = NULL;
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vJustAfterRegistered(void)
{
CString a_csTypes[] =
{
g_c_csMecaCardTypeName,
};
fn_vRegisterObjectsType(a_csTypes, 1);
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vConstruct()
{
//Windows constructions
//Creates the main frame
if ( m_pclMecaMainFrame == NULL )
{
m_pclMecaMainFrame = new CPA_Meca_MainFrame;
m_pclMecaMainFrame->CreateBase( "",
1,
2,
GetInterface()->GetMainWorld() );
m_pclMecaMainFrame->mfn_vEnableCaption(FALSE);
m_pclMecaMainFrame->m_iInitWidth = m_clDocument.m_ulEditorWidth;
m_pclMecaMainFrame->m_bKeepPos = TRUE;
m_pclMecaMainFrame->m_stWinRight.cLinkSame = FRM_C_MoveLeft;
}
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Construction of Mechanics Editor",
"CPA_Meca_Interface::fn_vConstruct()",
E_ERROR_GRAVITY_FATAL,
"Dialog List could not be created for this Editor");
ERROR_ASSERT( m_clDocument.m_pclDialogList != NULL );
m_clDocument.m_pclDialogList->fn_vInitAllLists();
m_clDocument.m_pclDialogList->fn_vReinitDialog();
//////////////
//////////////
//Registers for TUT Module
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_pclMecaMainFrame->m_hWnd, "TME_MainFrame", TUT_e_Window);
//End of Registers for TUT Module
//////////////
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vLevelChanges()
{
//Researches for existing Mechanics (loaded by Motor)
m_fn_pclGetDocument()->m_fn_vSearchForLoadedCards();
//Loads others
m_fn_pclGetDocument()->m_fn_vLoadUnloadedCards();
//Displays in the Editor
m_fn_pclGetDocument()->m_fn_vReInitDisplay();
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vAfterSaveAll(void)
{
m_fn_pclGetDocument()->m_pclControlView->m_fn_vUpdateCardsName();
}
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bLoadBaseObject(CPA_BaseObject *p_oObject)
{
ERROR_PREPARE_M(g_c_csMecaModuleNameForErrors,
"Trying to load a mechanical Card",
"CPA_Meca_Interface::fn_bLoadBaseObject(...)",
E_ERROR_GRAVITY_FATAL,
"The given object is not of the right type");
ERROR_ASSERT( p_oObject->fn_bIsOfType(C_szMecaCardTypeName) );
//Loads the Card
return ((CPA_Meca_Card *)p_oObject)->m_fn_bLoadIfUnloaded();
}
//**************************************************************************************
tdePermission CPA_Meca_Interface::fn_eAcceptNewEditor(CPA_EditorBase *pNewEditor)
{
return C_Allow;
}
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bCanActivateEditor(CPA_List<CPA_BaseObject> *pParams)
{
return TRUE;
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vOnActivateEditor(CPA_List<CPA_BaseObject> *pParams,
BOOL bBackActivated)
{
m_fn_vShowEditor();
}
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bCanCloseEditor(void)
{
return TRUE;
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vOnCloseEditor(void)
{
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vBeforeEngine(void)
{
m_fn_vHideEditor();
//ANNECY jt {
CPA_BaseObject* poBaseObject;
Position xPos;
CPA_BaseObjectList* poListOfCard = GetInterface()->GetMainWorld()->fn_p_oGetOriginalObjectList (g_c_csMecaCardTypeName);
for ( poBaseObject = poListOfCard->GetHeadElement(xPos); xPos; poBaseObject = poListOfCard->GetNextElement(xPos) )
{
if ( poBaseObject->fn_bIsValid() )
{
CPA_Meca_Card* poCard = (CPA_Meca_Card*)poBaseObject;
if (poCard->m_bDataCreated)
{
if (poCard->m_fn_pclGetCardType()->m_fn_csGetCardTypeName()=="Base Cards")
{
DNM_tdstMecBaseIdCard *pMecCard = (DNM_tdstMecBaseIdCard *)poCard->m_fn_pvGetBaseAddress();
DNM_M_vBaseIdCardSetSlopeLimit ( pMecCard, MTH_M_xTan (MTH_M_xDegToRad (DNM_M_xBaseIdCardGetSlopeLimit(pMecCard))) );
}
}
}
}
//ENDANNECY jt }
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vBeforeEditor(void)
{
if ( fn_bIsCurrentEditor() )
m_fn_vShowEditor();
//ANNECY jt {
CPA_BaseObject* poBaseObject;
Position xPos;
CPA_BaseObjectList* poListOfCard = GetInterface()->GetMainWorld()->fn_p_oGetOriginalObjectList (g_c_csMecaCardTypeName);
for ( poBaseObject = poListOfCard->GetHeadElement(xPos); xPos; poBaseObject = poListOfCard->GetNextElement(xPos) )
{
if ( poBaseObject->fn_bIsValid() )
{
CPA_Meca_Card* poCard = (CPA_Meca_Card*)poBaseObject;
if (poCard->m_bDataCreated)
{
if (poCard->m_fn_pclGetCardType()->m_fn_csGetCardTypeName()=="Base Cards")
{
DNM_tdstMecBaseIdCard *pMecCard = (DNM_tdstMecBaseIdCard *)poCard->m_fn_pvGetBaseAddress();
DNM_M_vBaseIdCardSetSlopeLimit ( pMecCard, MTH_M_xRadToDeg ( MTH_M_xATan (DNM_M_xBaseIdCardGetSlopeLimit(pMecCard))) );
poCard->m_pri_fn_vGetAllMotorValues();
}
}
}
}
//ENDANNECY jt }
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vHasLostFocus(void)
{
}
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bHasGainedFocus(void)
{
// display Tip of the Day
GetInterface()->fn_vDisplayTipOfDay("Mechanics", "TME", g_bTipFirstTime);
g_bTipFirstTime = FALSE;
return TRUE;
}
//**************************************************************************************
//Begin Mircea Dunka 31 Aug 1998 - DialogBar interface
void CPA_Meca_Interface::fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn)
{
if(wCategory == C_DlgBarCategoryEditor)
{
_pDlgBarBtn->hIcon = ::LoadIcon((HINSTANCE)(GetDLLIdentity()->hModule), MAKEINTRESOURCE(IDI_TME_DLGBAR_ICON));
CString oCst;
oCst = C_szDLLMecaName;
if( (M_GetMainApp()) && (M_GetMainApp()->mp_oAppKeyboard) )
{
oCst += " (";
oCst += M_GetMainApp()->mp_oAppKeyboard->mfn_oConvertIniStringToKeyString((const CString*)&CString("Activate Mechanic Editor"));
oCst += ")";
}
strcpy(_pDlgBarBtn->szToolTip, (char*)(LPCTSTR)oCst);
_pDlgBarBtn->uID = (UINT)this;
}
}
//end Mircea Dunka 31 Aug 1998
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bDefineSubMenu(EDT_SubMenu *_p_oEDTSubMenu)
{
if ( _p_oEDTSubMenu->GetSubMenuType() == C_SubMenuEditor )
{
CString csMenuDescString;
CString csMenuAccelString = M_GetMainApp()->mp_oAppKeyboard->mfn_oConvertIniStringToKeyString((const CString*)&CString("Activate Mechanic Editor"));
csMenuDescString.Format("%s\t%s", C_szDLLMecaName, csMenuAccelString);
if ( fn_bIsCurrentEditor() )
_p_oEDTSubMenu->AddAnEntry(this, M_MAKECHAR(csMenuDescString), C_EdMeca_MenuID_CloseID, TRUE);
else
_p_oEDTSubMenu->AddAnEntry(this, M_MAKECHAR(csMenuDescString), C_EdMeca_MenuID_OpenID, FALSE);
}
else if ( _p_oEDTSubMenu->GetSubMenuType() == C_SubMenuPreference )
{
if ( fn_bIsCurrentEditor() )
_p_oEDTSubMenu->AddAnEntry(this, "Save dimensions (Mechanics)", C_EdMeca_MenuID_SaveDimensions, FALSE);
}
return TRUE;
}
//**************************************************************************************
void CPA_Meca_Interface::_OnSubMenuCommand( EDT_SubMenu *_p_oEDTSubMenu,
UINT uiMsgID)
{
switch (uiMsgID)
{
case C_EdMeca_MenuID_OpenID:
if ( !fn_bIsCurrentEditor() )
GetMainWorld()->fn_bActivateEditor(this, NULL);
break;
case C_EdMeca_MenuID_CloseID:
if ( fn_bIsCurrentEditor() )
GetMainWorld()->fn_bCloseEditor(this);
break;
case C_EdMeca_MenuID_SaveDimensions:
if ( fn_bIsCurrentEditor() )
m_clDocument.m_pub_fn_bSavePreferences();
break;
}
}
//**************************************************************************************
//**************************************************************************************
// Popup
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bDefinePopupMenu(EDT_PopUpMenu *pPopup,
CPA_List<CPA_SuperObject> *pSelection,
BOOL bIsAlone)
{
BOOL bReturn = FALSE;
if ( !bIsAlone )
{
if ( fn_bIsCurrentEditor() )
{
pPopup->AddAnEntry(this, "Exit Mechanics Editor", C_EdMeca_PopupID_Exit_Editor);
bReturn = TRUE;
}
}
return bReturn;
}
//**************************************************************************************
void CPA_Meca_Interface::_OnPopUpMenuCommand(UINT m_IDCmdMsg)
{
switch (m_IDCmdMsg)
{
case C_EdMeca_PopupID_Exit_Editor:
if ( fn_bIsCurrentEditor() )
GetMainWorld()->fn_bCloseEditor(this);
break;
}
}
//**************************************************************************************
//**************************************************************************************
//Lists Dialog
//**************************************************************************************
#define C_szCards "Cards"
//**************************************************************************************
void CPA_Meca_Interface::GetListsForDialog(CPA_DialogList *pDialog)
{
pDialog->fn_vAddANewList(C_szCards, &(m_clDocument.m_clListOfCards));
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vInitDefaultParameters(CPA_DialogList *pDialog)
{
pDialog->SetDefaultButtonState(FALSE);
pDialog->SetDefaultTestName("<< No Filter >>");
pDialog->SetDefaultTypeName(C_szCards);
}
//**************************************************************************************
void CPA_Meca_Interface::fn_vSetANewTest( CPA_DialogList *pDialog,
CString csCurrentList)
{
CString csButtonText = "All cards";
BOOL bButtonMustBeEnabled = TRUE;
BOOL bButtonState = FALSE;
if ( csCurrentList.Compare(C_szCards) == 0 )
{
if ( m_fn_pclGetDocument()->m_pclCurrentCardType != NULL )
csButtonText = CString("Cards of type '")
+ m_fn_pclGetDocument()->m_pclCurrentCardType->m_fn_csGetCardTypeName()
+ CString("'");
else
csButtonText = "All cards";
bButtonMustBeEnabled = TRUE;
bButtonState = TRUE;
}
pDialog->fn_vInitButtonTest((char *)LPCTSTR(csButtonText),
bButtonState,
bButtonMustBeEnabled);
}
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bTestFunction(CString csCurrentType,
CString csTestName,
CPA_BaseObject *pEdObj)
{
BOOL bReturnValue = TRUE;
if ( csCurrentType.Compare(C_szCards) == 0 )
{
if ( m_fn_pclGetDocument()->m_pclCurrentCardType != NULL )
bReturnValue = ( ((CPA_Meca_Card *)pEdObj)->m_fn_pclGetCardType() == m_fn_pclGetDocument()->m_pclCurrentCardType );
}
return bReturnValue;
}
//**************************************************************************************
BOOL CPA_Meca_Interface::fn_bOnButtonTest(CPA_DialogList *pDialog,
CString csTypeName,
tdeListDrawMode eDraw)
{
BOOL bReturnValue = FALSE;
//Shows all Cards
m_fn_pclGetDocument()->m_pclCurrentCardType = NULL;
pDialog->fn_vUpdateSelection(E_lrm_ReinitList);
pDialog->fn_vInitButtonTest("All cards",
TRUE,
TRUE);
return bReturnValue;
}
//***********************************************************************
BOOL CPA_Meca_Interface::fn_bOnSelChangeComboList(CPA_DialogList *pDialog,
CString csTypeName)
{
if ( csTypeName.CompareNoCase(C_szCards) == 0 )
{
//Shows all Cards
m_fn_pclGetDocument()->m_pclCurrentCardType = NULL;
pDialog->fn_vUpdateSelection(E_lrm_ReinitList);
pDialog->fn_vInitButtonTest("All cards",
TRUE,
TRUE);
}
return FALSE;
}
//***********************************************************************
BOOL CPA_Meca_Interface::fn_bOnSelChangeListObjects(CPA_DialogList *pDialog,
CString csTypeName,
CPA_BaseObject *pSelectedObject,
BOOL bUnselect)
{
if ( csTypeName.CompareNoCase(C_szCards) == 0 )
{
//Displays Card
CPA_Meca_Card *pclCard = (CPA_Meca_Card *)pSelectedObject;
if ( bUnselect )
m_pri_pclSelectedCard = NULL;
else
{
if ( pclCard->fn_bIsAvailable() )
{
m_fn_pclGetDocument()->m_fn_vEditCard(pclCard);
m_pri_pclSelectedCard = pclCard;
}
// else
// if ( m_fn_pclGetDocument()->m_pclCurrentCardType != NULL )
// m_pri_pclSelectedCard = m_fn_pclGetDocument()->m_pclCurrentCardType ->m_fn_pclGetEditedCard();
}
pDialog->fn_vUpdateSelection(E_lrm_ChangeSelection);
}
return TRUE;
}
//***********************************************************************
CPA_BaseObject *CPA_Meca_Interface::GetDialogSelection( CPA_DialogList *pDialog,
CString csTypeName,
tdeListDrawMode eDrawMode)
{
if ( csTypeName.CompareNoCase(C_szCards) == 0 )
return m_pri_pclSelectedCard;
return NULL;
}
//**************************************************************************************
//**************************************************************************************
//**************************************************************************************
// Specific members
//***********************************************************************
void CPA_Meca_Interface::m_fn_vShowEditor()
{
g_oFrameGest.mfn_vSetRefresh(FALSE);
if ( m_pclMecaMainFrame != NULL )
g_oFrameGest.mfn_vActivateWindow(m_pclMecaMainFrame);
g_oFrameGest.mfn_vSetRefresh(TRUE);
}
//***********************************************************************
void CPA_Meca_Interface::m_fn_vHideEditor()
{
g_oFrameGest.mfn_vSetRefresh(FALSE);
if ( m_pclMecaMainFrame != NULL )
g_oFrameGest.mfn_vDisactivateWindow(m_pclMecaMainFrame);
g_oFrameGest.mfn_vSetRefresh(TRUE);
}
//**************************************************************************************
CPA_Meca_MyDocument *CPA_Meca_Interface::m_fn_pclGetDocument()
{
ERROR_ASSERT ( AfxIsValidAddress(&m_clDocument, sizeof(CPA_Meca_MyDocument)) );
return &m_clDocument;
}
//**************************************************************************************
long CPA_Meca_Interface::OnQueryAction(CPA_EditorBase * /*p_oSender*/, WPARAM _wParam, LPARAM _lParam)
{
switch (_wParam )
{
case Cw_TME_Query_updateAfterLoading:
//Researches for existing Mechanics (loaded by Motor)
m_fn_pclGetDocument()->m_fn_vUpdateUnLoadedCards();
break;
}
return 0L;
}

View File

@@ -0,0 +1,36 @@
// TME.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "TME.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// This is an example of an exported variable
TME_API int nTME=0;
// This is an example of an exported function.
TME_API int fnTME(void)
{
return 42;
}
// This is the constructor of a class that has been exported.
// see TME.h for the class definition
CTME::CTME()
{
return;
}

View File

@@ -0,0 +1,22 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the TME_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// TME_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef TME_EXPORTS
#define TME_API __declspec(dllexport)
#else
#define TME_API __declspec(dllimport)
#endif
// This class is exported from the TME.dll
class TME_API CTME {
public:
CTME(void);
// TODO: add your methods here.
};
extern TME_API int nTME;
TME_API int fnTME(void);

View File

@@ -0,0 +1,270 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="TME"
ProjectGUID="{777447D6-F738-464E-A161-A0A575808D81}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x:\CPA\EXE\main\EDT_Data\Tools"
IntermediateDirectory="Debug"
ConfigurationType="2"
UseOfMFC="2"
CharacterSet="0">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="inc,X:\CPA\Public"
PreprocessorDefinitions="CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG"
MinimalRebuild="FALSE"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="maidfevd.lib ctl___vd.lib ero___vd.lib"
OutputFile="X:\CPA\EXE\Main\EDT_Data\Tools\TMEDFEvd.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="x:\cpa\exe\main\edt_data;x:\cpa\exe\main;x:\cpa\libd"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/TME.pdb"
SubSystem="2"
ImportLibrary="x:\CPA\EXE\main\EDT_Data\Tools/TMEDFEvd.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TME_EXPORTS"
RuntimeLibrary="0"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/TME.dll"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/TME.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\Src\_DLLcom.cpp">
</File>
<File
RelativePath=".\Src\_MecCard.cpp">
</File>
<File
RelativePath=".\Src\_Minterf.cpp">
</File>
<File
RelativePath=".\Src\EditMDef.cpp">
</File>
<File
RelativePath=".\Src\EMACSave.cpp">
</File>
<File
RelativePath=".\Src\EMECAllo.cpp">
</File>
<File
RelativePath=".\Src\EMECClBk.cpp">
</File>
<File
RelativePath=".\Src\EMECCrdT.cpp">
</File>
<File
RelativePath=".\Src\EMECDgIf.cpp">
</File>
<File
RelativePath=".\Src\EMECDgNC.cpp">
</File>
<File
RelativePath=".\Src\EMECDgQu.cpp">
</File>
<File
RelativePath=".\Src\EMECDgSp.cpp">
</File>
<File
RelativePath=".\Src\EMECDoc.cpp">
</File>
<File
RelativePath=".\Src\EMECDtMd.cpp">
</File>
<File
RelativePath=".\Src\EMECFmMn.cpp">
</File>
<File
RelativePath=".\Src\EMECIni.cpp">
</File>
<File
RelativePath=".\Src\EMECSave.cpp">
</File>
<File
RelativePath=".\Src\EMECVwMn.cpp">
</File>
<File
RelativePath=".\Src\EMECVwMS.cpp">
</File>
<File
RelativePath=".\Src\StdAfx.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\Inc\_MecCard.hpp">
</File>
<File
RelativePath=".\Inc\_Minterf.hpp">
</File>
<File
RelativePath=".\Inc\EditMDef.hpp">
</File>
<File
RelativePath=".\Inc\EMECAllo.hpp">
</File>
<File
RelativePath=".\Inc\EMECClBk.hpp">
</File>
<File
RelativePath=".\Inc\EMECCnst.hpp">
</File>
<File
RelativePath=".\Inc\EMECCrdT.hpp">
</File>
<File
RelativePath=".\Inc\EMECCStr.hpp">
</File>
<File
RelativePath=".\Inc\EMECDgIf.hpp">
</File>
<File
RelativePath=".\Inc\EMECDgNC.hpp">
</File>
<File
RelativePath=".\Inc\EMECDgQu.hpp">
</File>
<File
RelativePath=".\Inc\EMECDgSp.hpp">
</File>
<File
RelativePath=".\Inc\EMECDoc.hpp">
</File>
<File
RelativePath=".\Inc\EMECDtMd.hpp">
</File>
<File
RelativePath=".\Inc\EMECFlds.hpp">
</File>
<File
RelativePath=".\Inc\EMECFmMn.hpp">
</File>
<File
RelativePath=".\Inc\EMECStrg.hpp">
</File>
<File
RelativePath=".\Inc\EMECVwMn.hpp">
</File>
<File
RelativePath=".\Inc\EMECVwMS.hpp">
</File>
<File
RelativePath=".\Inc\help_def.h">
</File>
<File
RelativePath=".\Inc\Meca_Res.h">
</File>
<File
RelativePath=".\Inc\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\Inc\EdMeca.rc">
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

View File

@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// TME.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

View File

@@ -0,0 +1,13 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here