Add rayman2 source files
This commit is contained in:
18
Rayman_X/cpa/tempgrp/Tut/Inc/StdAfx.h
Normal file
18
Rayman_X/cpa/tempgrp/Tut/Inc/StdAfx.h
Normal 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__
|
||||
|
51
Rayman_X/cpa/tempgrp/Tut/Inc/TutInter.hpp
Normal file
51
Rayman_X/cpa/tempgrp/Tut/Inc/TutInter.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
//*****************************************************************************
|
||||
//* TutInter.hpp *
|
||||
//*****************************************************************************
|
||||
//* *
|
||||
//* This file contains the declaration of the TUT_Interface class, *
|
||||
//* the interface of the TUT dll. *
|
||||
//* *
|
||||
//*****************************************************************************
|
||||
//* Author : Alexis Vaisse *
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
#ifndef __TUTINTER_HPP__
|
||||
#define __TUTINTER_HPP__
|
||||
|
||||
#define DLL_ONLY_ONE_INSTANCE
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class TUT_Interface : public CPA_ToolDLLBase
|
||||
{
|
||||
public:
|
||||
TUT_Interface (); // Constructor;
|
||||
|
||||
void fn_vConstruct (void);
|
||||
long OnQueryAction (CPA_EditorBase * _pCallingDll , WPARAM , LPARAM);
|
||||
BOOL _OnKeyDown (UINT nChar , UINT nRepCnt , UINT nFlags);
|
||||
//Menus
|
||||
BOOL fn_bDefineSubMenu (EDT_SubMenu *_p_oEDTSubMenu);
|
||||
void _OnSubMenuCommand (EDT_SubMenu *_p_oEDTSubMenu,UINT uiMsgID);
|
||||
private:
|
||||
BOOL m_bAutoRun; // TRUE if the Script must be run in the fn_vConstruct
|
||||
BOOL m_bBackGroundActive; // TRUE if the "CTRL+SHIFT" is actived
|
||||
CString m_csScriptFileName; // Name of the Script File to execute
|
||||
CString m_csScriptPathName; // Name of the Script File to execute
|
||||
BOOL m_bScriptRecursive;
|
||||
BOOL m_bRecording;
|
||||
private:
|
||||
void m_fn_vLoadPreferences (void);
|
||||
void m_fn_vWritePreferences (void);
|
||||
void m_fn_vStartStopRecord (void);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
extern tdstDLLIdentity g_stTUT_Identity;
|
||||
|
||||
|
||||
#endif // __TUTINTER_HPP__
|
70
Rayman_X/cpa/tempgrp/Tut/Inc/dlginput.hpp
Normal file
70
Rayman_X/cpa/tempgrp/Tut/Inc/dlginput.hpp
Normal file
@@ -0,0 +1,70 @@
|
||||
#if !defined(AFX_DLGINPUT_HPP__AD22A6C5_994B_11D1_B302_0060973673C5__INCLUDED_)
|
||||
#define AFX_DLGINPUT_HPP__AD22A6C5_994B_11D1_B302_0060973673C5__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
// dlginput.hpp : header file
|
||||
//
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInput dialog
|
||||
|
||||
class CDialogInput : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDialogInput(const CString _csStaticText, const CString _csPathText = "",
|
||||
const CString _csFileText = "", BOOL _bRecursive = FALSE , CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CDialogInput)
|
||||
enum { IDD = IDD_DIALOG_INPUTTEXT };
|
||||
// NOTE: the ClassWizard will add data members here
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
CString m_fn_csGetEditText(void) { return m_csEditText; }
|
||||
CString m_fn_csGetPath(void) { return m_csPathText; }
|
||||
BOOL m_fn_bGetRecurse(void) { return m_bRecursive; }
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDialogInput)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDialogInput)
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnBtBrowse();
|
||||
afx_msg void OnBtRead();
|
||||
afx_msg void OnSelChange();
|
||||
afx_msg void OnDoubleClick();
|
||||
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
CString m_csStaticText;
|
||||
CString m_csEditText;
|
||||
CString m_csPathText;
|
||||
CString m_csFileText;
|
||||
BOOL m_bRecursive;
|
||||
private:
|
||||
void m_fn_vFillList ( void );
|
||||
void m_fn_vRecurFillList( const CString _csBeginPathName , const CString _csCurrentPathName, BOOL _bRecursive );
|
||||
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_DLGINPUT_HPP__AD22A6C5_994B_11D1_B302_0060973673C5__INCLUDED_)
|
BIN
Rayman_X/cpa/tempgrp/Tut/Make/Debug/Tut.res
Normal file
BIN
Rayman_X/cpa/tempgrp/Tut/Make/Debug/Tut.res
Normal file
Binary file not shown.
340
Rayman_X/cpa/tempgrp/Tut/Make/Tut.dsp
Normal file
340
Rayman_X/cpa/tempgrp/Tut/Make/Tut.dsp
Normal file
@@ -0,0 +1,340 @@
|
||||
# Microsoft Developer Studio Project File - Name="TUT" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=TUT - Win32 Debug Glide with Editors
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Tut.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Tut.mak" CFG="TUT - Win32 Debug Glide with Editors"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "TUT - Win32 Debug Glide with Editors" (based on\
|
||||
"Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""$/CPA/TempGrp/Tut/Make", ZJKAAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 2
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug Glide with Editors"
|
||||
# PROP BASE Intermediate_Dir "Debug Glide with Editors"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 2
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x:\CPA\EXE\main\EDT_Data\Tools"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "X:\CPA\Public" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /Z7 /Od /I "\CPA\Public" /I "..\inc" /I "..\res" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /Fr /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo /o"Debug\TUT.bsc"
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 X:\CPA\Exe\GAM\GAMP5Evd.lib /nologo /subsystem:windows /dll /pdb:"x:\CPA\EXE\GAMEDT_Data\Tools\TUT.pdb" /debug /machine:I386 /out:"X:\CPA\EXE\GAM\EDT_Data\Tools\TUT.dll" /pdbtype:sept
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 winmm.lib /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"X:\CPA\EXE\main\EDT_Data\Tools/TutDFEvd.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "TUT - Win32 Debug Glide with Editors"
|
||||
# Begin Group "Src"
|
||||
|
||||
# PROP Default_Filter "*.c *.cpp"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\dlginput.cpp
|
||||
# ADD CPP /I "X:\cpa\tempgrp\Tut\Res"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\DllCom.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\TUT.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\TutInter.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Inc"
|
||||
|
||||
# PROP Default_Filter "*.h *.hpp"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Inc\dlginput.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\public\IncTUT.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Inc\StdAfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\public\Tut.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Inc\TutInter.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Lib (Debug)"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Exe\Main\MaiDFEvd.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Lib\tut_d.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "SCRIPTS"
|
||||
|
||||
# PROP Default_Filter "*.tut"
|
||||
# Begin Group "Test 4.2"
|
||||
|
||||
# PROP Default_Filter "*.tut"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\CreateNamesList.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\CreateWay.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\CreateZA.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\Globals.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II2.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II3.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II4.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II5.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II6.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II7.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\TUT\Test 4.2\II7bis.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\II8.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\TUT\Test 4.2\II8bis.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV1.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV10.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV11.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV12.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV2.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV3.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV4.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV5.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV6.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV7.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV8.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\IV9.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\Main.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\RenameObject.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\RenameState.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\RenameZA.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\Save.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\V1.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\V2.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\VerifyStateField.tut"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\exe\main\Tut\Test 4.2\VerifyZA.tut"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Tools"
|
||||
|
||||
# PROP Default_Filter "*.tut"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\Check_ListBox_Item.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\Display_Message.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\Drag_Model.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\Instantiate_Actor.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\Open_Editor.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\OpenEDT.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\OpenOAC.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\OpenOZO.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\OpenTAC.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\TACInput.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\VerifyEdit.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\VerifyNumEdit.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\VerifyTypeName.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\VerifyZone.tut
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\exe\main\Tut\Tools\WriteIALine.tut
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Group "Res"
|
||||
|
||||
# PROP Default_Filter "*.h; *.rc; *.ico; *.bmp"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Res\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Res\Tut.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Tut.mak
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
332
Rayman_X/cpa/tempgrp/Tut/Make/Tut.vcproj
Normal file
332
Rayman_X/cpa/tempgrp/Tut/Make/Tut.vcproj
Normal file
@@ -0,0 +1,332 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="TUT"
|
||||
ProjectGUID="{39E960B1-6170-4C22-B260-16A652F7032B}"
|
||||
SccProjectName=""$/CPA/TempGrp/Tut/Make", ZJKAAAAA"
|
||||
SccLocalPath="."
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug Glide with Editors|Win32"
|
||||
OutputDirectory="x:\CPA\EXE\main\EDT_Data\Tools"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="\CPA\Public,..\inc,..\res"
|
||||
PreprocessorDefinitions="CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/Tut.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
BrowseInformationFile=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="winmm.lib maidfevd.lib tut_d.lib"
|
||||
OutputFile="X:\CPA\EXE\main\EDT_Data\Tools/TutDFEvd.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="X:\cpa\exe\main;X:\cpa\libd"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
ModuleDefinitionFile="..\Src\TUT.def"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="x:\CPA\EXE\main\EDT_Data\Tools/TutDFEvd.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="x:\CPA\EXE\main\EDT_Data\Tools/TutDFEvd.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName="x:\CPA\EXE\main\EDT_Data\Tools/Tut.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1036"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Src"
|
||||
Filter="*.c *.cpp">
|
||||
<File
|
||||
RelativePath="..\Src\dlginput.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="X:\cpa\tempgrp\Tut\Res"
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Src\DllCom.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Src\TUT.def">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Src\TutInter.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Inc"
|
||||
Filter="*.h *.hpp">
|
||||
<File
|
||||
RelativePath="..\Inc\dlginput.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\public\IncTUT.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Inc\StdAfx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\public\Tut.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Inc\TutInter.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="SCRIPTS"
|
||||
Filter="*.tut">
|
||||
<Filter
|
||||
Name="Test 4.2"
|
||||
Filter="*.tut">
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\CreateNamesList.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\CreateWay.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\CreateZA.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\Globals.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II2.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II3.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II4.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II5.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II6.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II7.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\TUT\Test 4.2\II7bis.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\II8.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\TUT\Test 4.2\II8bis.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV1.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV10.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV11.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV12.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV2.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV3.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV4.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV5.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV6.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV7.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV8.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\IV9.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\Main.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\RenameObject.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\RenameState.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\RenameZA.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\Save.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\V1.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\V2.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\VerifyStateField.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Test 4.2\VerifyZA.tut">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Tools"
|
||||
Filter="*.tut">
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\Check_ListBox_Item.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\Display_Message.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\Drag_Model.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\Instantiate_Actor.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\Open_Editor.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\OpenEDT.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\OpenOAC.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\OpenOZO.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\OpenTAC.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\TACInput.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\VerifyEdit.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\VerifyNumEdit.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\VerifyTypeName.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\VerifyZone.tut">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\exe\main\Tut\Tools\WriteIALine.tut">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Res"
|
||||
Filter="*.h; *.rc; *.ico; *.bmp">
|
||||
<File
|
||||
RelativePath="..\Res\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Res\Tut.rc">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="\cpa\tempgrp\Tut\Res"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="Tut.mak">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
5
Rayman_X/cpa/tempgrp/Tut/Make/mssccprj.scc
Normal file
5
Rayman_X/cpa/tempgrp/Tut/Make/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a source code control file
|
||||
|
||||
[Tut.vcproj]
|
||||
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
|
||||
SCC_Project_Name = Perforce Project
|
109
Rayman_X/cpa/tempgrp/Tut/Res/Tut.rc
Normal file
109
Rayman_X/cpa/tempgrp/Tut/Res/Tut.rc
Normal file
@@ -0,0 +1,109 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_DIALOG_INPUTTEXT DIALOGEX 0, 0, 248, 247
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Input the Name of the Main Tutorial Script"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,191,226,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,7,226,50,14
|
||||
LTEXT "Static",IDC_STATIC_TEXT,7,190,234,11,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT IDC_EDIT_TEXT,7,206,234,12,ES_AUTOHSCROLL
|
||||
LTEXT "Path",IDC_STATIC_TEXT,7,8,16,8
|
||||
EDITTEXT IDC_EDIT_PATH,29,7,191,14,ES_AUTOHSCROLL
|
||||
CONTROL "Recursive",IDC_CHECK_RECURSIVE,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,26,48,10
|
||||
PUSHBUTTON "Read",IDC_BUTTON_READ,191,26,50,14
|
||||
LISTBOX IDC_LIST_FILE,7,47,234,137,LBS_SORT | LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "...",IDC_BUTTON_BROWSE,225,7,16,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_DIALOG_INPUTTEXT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 241
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 240
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // French (France) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
24
Rayman_X/cpa/tempgrp/Tut/Res/resource.h
Normal file
24
Rayman_X/cpa/tempgrp/Tut/Res/resource.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by TUT.rc
|
||||
//
|
||||
#define IDD_DIALOG1 101
|
||||
#define IDD_DIALOG_INPUTTEXT 101
|
||||
#define IDC_EDIT_TEXT 1000
|
||||
#define IDC_EDIT_PATH 1001
|
||||
#define IDC_CHECK_RECURSIVE 1002
|
||||
#define IDC_BUTTON_READ 1003
|
||||
#define IDC_LIST_FILE 1004
|
||||
#define IDC_BUTTON_BROWSE 1005
|
||||
#define IDC_STATIC_TEXT -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1006
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
208
Rayman_X/cpa/tempgrp/Tut/Src/DllCom.cpp
Normal file
208
Rayman_X/cpa/tempgrp/Tut/Src/DllCom.cpp
Normal file
@@ -0,0 +1,208 @@
|
||||
//*****************************************************************************
|
||||
//* DllCom.cpp *
|
||||
//*****************************************************************************
|
||||
//* *
|
||||
//* This file contains the communication functions for the TUT dll *
|
||||
//* *
|
||||
//*****************************************************************************
|
||||
//* Author : Alexis Vaisse *
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "afxdllx.h"
|
||||
|
||||
#include "ACP_Base.h"
|
||||
#include "ITF.h"
|
||||
#include "..\..\..\Main\Inc\_EditID.h"
|
||||
|
||||
#include "TUT.h"
|
||||
#include "TutInter.hpp"
|
||||
#include "..\TutLib\Inc\Tut_Mngr.hpp"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static char * gs_p_szCPAVersion = C_szCPAVersion;
|
||||
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
|
||||
|
||||
#ifdef DLL_ONLY_ONE_INSTANCE
|
||||
static TUT_Interface * gs_p_oTUT_Interface = NULL;
|
||||
#endif
|
||||
|
||||
static CList<CPA_DLLBase*,CPA_DLLBase*> g_oListOfInstances;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// functions that are present in all DLL :
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_p_szGetCPAVersion : Get current CPA version
|
||||
//-----------------------------------------------------------------------------
|
||||
extern "C" char __declspec(dllexport) *fn_p_szGetCPAVersion(void)
|
||||
{
|
||||
return gs_p_szCPAVersion;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_p_stGetDLLIdentity : Get type of this DLL
|
||||
//-----------------------------------------------------------------------------
|
||||
extern "C" tdstDLLIdentity __declspec (dllexport) * fn_p_stGetDLLIdentity (void)
|
||||
{
|
||||
g_stTUT_Identity . eType = TOOL_DLL;
|
||||
g_stTUT_Identity . csName = C_szDLLTutorialName;
|
||||
g_stTUT_Identity . hModule = NULL;
|
||||
g_stTUT_Identity . p_oListOfInstances = & g_oListOfInstances;
|
||||
|
||||
return & g_stTUT_Identity;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_vInitDll : DLL init function
|
||||
//-----------------------------------------------------------------------------
|
||||
extern "C" void __declspec(dllexport) fn_vInitDll (void)
|
||||
{
|
||||
new CDynLinkLibrary (extensionDLL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// DllMain : 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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_p_oGetDLL : 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_oTUT_Interface == NULL)
|
||||
{
|
||||
gs_p_oTUT_Interface = new TUT_Interface ();
|
||||
ASSERT(gs_p_oTUT_Interface != NULL);
|
||||
}
|
||||
return gs_p_oTUT_Interface;
|
||||
break;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#else //DLL_ONLY_ONE_INSTANCE
|
||||
|
||||
switch(lKey)
|
||||
{
|
||||
case 0: // the game world
|
||||
return new TUT_Interface ();
|
||||
break;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif //DLL_ONLY_ONE_INSTANCE
|
||||
}
|
||||
|
||||
#undef DLL_ONLY_ONE_INSTANCE
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_vRegisterControl : Register a control
|
||||
//-----------------------------------------------------------------------------
|
||||
void __declspec(dllexport) fn_vRegisterControl (HWND _hWnd , const CString _csName , TUT_tdeControlType _eType)
|
||||
{
|
||||
TUT_g_oTutorialManager . m_fn_vRegisterWnd (_hWnd , _csName , (TUT_tdeWndType) _eType);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_bUnregisterControl : Unregister a control
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL __declspec(dllexport) fn_bUnregisterControl (HWND _hWnd)
|
||||
{
|
||||
return TUT_g_oTutorialManager . m_fn_bUnregisterWnd (_hWnd);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
* SpyGetMsgProc
|
||||
*
|
||||
* The Get Message hook function.
|
||||
*
|
||||
\*****************************************************************************/
|
||||
LRESULT CALLBACK SpyGetMsgProc(INT hc, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PMSG pmsg;
|
||||
|
||||
pmsg = (PMSG)lParam;
|
||||
|
||||
if (hc >= 0 && pmsg && pmsg->hwnd)
|
||||
{
|
||||
return TUT_g_oTutorialManager . m_fn_bHookMsgProc(pmsg->hwnd, pmsg->message, pmsg->wParam, pmsg->lParam);
|
||||
}
|
||||
|
||||
//
|
||||
// Note that CallNextHookEx ignores the first parameter (hhook) so
|
||||
// it is acceptable (barely) to pass in a NULL.
|
||||
//
|
||||
return CallNextHookEx(NULL, hc, wParam, lParam);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
* SpyGetMsgProc
|
||||
*
|
||||
* The Get Message hook function.
|
||||
*
|
||||
\*****************************************************************************/
|
||||
LRESULT CALLBACK SpyGetWndProc(INT hc, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PCWPSTRUCT pcwps;
|
||||
|
||||
pcwps = (PCWPSTRUCT)lParam;
|
||||
|
||||
if (hc >= 0 && pcwps && pcwps->hwnd)
|
||||
{
|
||||
return TUT_g_oTutorialManager . m_fn_bHookWndProc(pcwps->hwnd, pcwps->message, pcwps->wParam, pcwps->lParam);
|
||||
}
|
||||
|
||||
//
|
||||
// Note that CallNextHookEx ignores the first parameter (hhook) so
|
||||
// it is acceptable (barely) to pass in a NULL.
|
||||
//
|
||||
return CallNextHookEx(NULL, hc, wParam, lParam);
|
||||
}
|
||||
|
||||
/*****************************************************************************\
|
||||
* SpyGetMsgProc
|
||||
*
|
||||
* The Get Message hook function.
|
||||
*
|
||||
\*****************************************************************************/
|
||||
LRESULT CALLBACK SpyGetWndProcRet(INT hc, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PCWPRETSTRUCT pcwpret;
|
||||
|
||||
pcwpret = (PCWPRETSTRUCT)lParam;
|
||||
|
||||
if (hc >= 0 && pcwpret && pcwpret->hwnd)
|
||||
{
|
||||
return TUT_g_oTutorialManager . m_fn_bHookWndProcRet(pcwpret->hwnd, pcwpret->message, pcwpret->wParam, pcwpret->lParam);
|
||||
}
|
||||
|
||||
//
|
||||
// Note that CallNextHookEx ignores the first parameter (hhook) so
|
||||
// it is acceptable (barely) to pass in a NULL.
|
||||
//
|
||||
return CallNextHookEx(NULL, hc, wParam, lParam);
|
||||
}
|
15
Rayman_X/cpa/tempgrp/Tut/Src/TUT.def
Normal file
15
Rayman_X/cpa/tempgrp/Tut/Src/TUT.def
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
LIBRARY
|
||||
EXPORTS
|
||||
fn_p_szGetCPAVersion
|
||||
fn_p_stGetDLLIdentity
|
||||
fn_p_oGetDLL
|
||||
fn_vInitDll
|
||||
fn_vRegisterControl
|
||||
fn_bUnregisterControl
|
||||
SpyGetMsgProc
|
||||
SpyGetWndProc
|
||||
SpyGetWndProcRet
|
||||
SECTIONS
|
||||
.data READ WRITE
|
282
Rayman_X/cpa/tempgrp/Tut/Src/TutInter.cpp
Normal file
282
Rayman_X/cpa/tempgrp/Tut/Src/TutInter.cpp
Normal file
@@ -0,0 +1,282 @@
|
||||
//*****************************************************************************
|
||||
//* TutInter.cpp *
|
||||
//*****************************************************************************
|
||||
//* *
|
||||
//* This file contains the definition of the TUT_Interface class, *
|
||||
//* the interface of the TUT dll. *
|
||||
//* *
|
||||
//*****************************************************************************
|
||||
//* Author : Alexis Vaisse *
|
||||
//*****************************************************************************
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ACP_Base.h"
|
||||
#include "ITF.h"
|
||||
|
||||
#include "TUT.h"
|
||||
#include "TutInter.hpp"
|
||||
#include "DlgInput.hpp"
|
||||
#include "..\TutLib\Inc\Tut_Mngr.hpp"
|
||||
|
||||
|
||||
tdstDLLIdentity g_stTUT_Identity;
|
||||
|
||||
#define C_uiTUTPopupRun 10
|
||||
#define C_uiTUTPopupAutoRun 11
|
||||
#define C_uiTUTPopupBackGround 12
|
||||
#define C_uiTUTPopupSet 14
|
||||
#define C_uiTUTPopupRecord 15
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
TUT_Interface::TUT_Interface ()
|
||||
{
|
||||
m_p_stDLLIdentity = & g_stTUT_Identity;
|
||||
|
||||
m_stBaseDLLDefinition . bCanOutputIn3DView = FALSE;
|
||||
m_stBaseDLLDefinition . bCanBeRefreshedByEngine = FALSE;
|
||||
|
||||
SetEditorInfo ("Tutorial", "Alexis Vaisse", "V 2.0.0 (not updated)", "", "");
|
||||
|
||||
m_bAutoRun = FALSE;
|
||||
m_bBackGroundActive = FALSE;
|
||||
m_csScriptFileName = "Test.tut";
|
||||
m_csScriptPathName = "x:\\Cpa\\Exe\\Main";
|
||||
m_bScriptRecursive = FALSE;
|
||||
m_bRecording = FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - fn_vConstruct
|
||||
//-----------------------------------------------------------------------------
|
||||
void TUT_Interface::fn_vConstruct (void)
|
||||
{
|
||||
fn_vSetReceivingWindowMessages (TRUE);
|
||||
m_fn_vLoadPreferences ();
|
||||
|
||||
TUT_g_oTutorialManager . m_fn_vSetBackGroundActive (m_bBackGroundActive) ;
|
||||
if (m_bAutoRun && ! m_csScriptFileName . IsEmpty() ) TUT_g_oTutorialManager . m_fn_vLaunchScript (m_csScriptFileName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - OnQueryAction
|
||||
//-----------------------------------------------------------------------------
|
||||
long TUT_Interface::OnQueryAction (CPA_EditorBase * _pCallingEditor , WPARAM _wParam , LPARAM _lParam)
|
||||
{
|
||||
switch (_wParam)
|
||||
{
|
||||
case TUT_C_lQueryRegisterControl :
|
||||
{
|
||||
|
||||
TUT_tdstQueryWindowStructure * p_stQueryStructure = (TUT_tdstQueryWindowStructure *) _lParam;
|
||||
TUT_g_oTutorialManager . m_fn_vRegisterWnd (p_stQueryStructure -> hHandleOfControl ,
|
||||
p_stQueryStructure -> csNameOfControl ,
|
||||
(TUT_tdeWndType) p_stQueryStructure -> eTypeOfControl);
|
||||
break;
|
||||
}
|
||||
case TUT_C_lQueryUnregisterControl :
|
||||
{
|
||||
TUT_g_oTutorialManager . m_fn_bUnregisterWnd ((HWND) _lParam);
|
||||
break;
|
||||
}
|
||||
|
||||
case TUT_C_lQueryRegisterMenu :
|
||||
{
|
||||
TUT_tdstQueryMenuStructure * p_stQueryStructure = (TUT_tdstQueryMenuStructure *) _lParam;
|
||||
TUT_g_oTutorialManager . m_fn_vRegisterMenu (p_stQueryStructure -> hHandleOfWindow ,
|
||||
p_stQueryStructure -> hHandleOfMenu ,
|
||||
p_stQueryStructure -> iX ,
|
||||
p_stQueryStructure -> iY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - _OnKeyDown
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_Interface::_OnKeyDown (UINT nChar , UINT nRepCnt , UINT nFlags)
|
||||
{
|
||||
/*
|
||||
// Alt+T -> lauch the script
|
||||
if (nChar == 'T' && (nFlags & 0x2000) != 0)
|
||||
TUT_g_oTutorialManager . m_fn_vLaunchScript ("Test.tut");
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - fn_bDefineSubMenu
|
||||
// Add an entry in the editor menu
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_Interface::fn_bDefineSubMenu (EDT_SubMenu * _p_oEDTSubMenu)
|
||||
{
|
||||
if (_p_oEDTSubMenu -> GetSubMenuType () == C_SubMenuTool)
|
||||
{
|
||||
EDT_SubMenu *p_oSubMenu = _p_oEDTSubMenu -> fn_p_oGetNewSubMenu("Tutorial");
|
||||
CString csEntry = "Run File";
|
||||
|
||||
if (! m_csScriptFileName . IsEmpty()) csEntry += " : \"" + m_csScriptFileName + "\"";
|
||||
|
||||
p_oSubMenu -> AddAnEntry (this , (char*)(LPCTSTR)csEntry , C_uiTUTPopupRun , FALSE , ! TUT_g_oTutorialManager . m_fn_bIsRunning());
|
||||
p_oSubMenu -> AddASeparator ();
|
||||
p_oSubMenu -> AddAnEntry (this , "AutoRun" , C_uiTUTPopupAutoRun , m_bAutoRun);
|
||||
p_oSubMenu -> AddAnEntry (this , "Choose Main File" , C_uiTUTPopupSet);
|
||||
p_oSubMenu -> AddAnEntry (this , "Active On BackGround" , C_uiTUTPopupBackGround , m_bBackGroundActive);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Script recording
|
||||
p_oSubMenu -> AddAnEntry (this , m_bRecording ? "Stop recording" : "Start recording" , C_uiTUTPopupRecord);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
_p_oEDTSubMenu -> AddASubMenu (p_oSubMenu);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - _OnSubMenuCommand
|
||||
// Called when the user selects an entry in the menu
|
||||
//-----------------------------------------------------------------------------
|
||||
void TUT_Interface::_OnSubMenuCommand (EDT_SubMenu * _p_oEDTSubMenu , UINT uiMsgID)
|
||||
{
|
||||
if (_p_oEDTSubMenu -> GetSubMenuType () == C_SubMenuTool)
|
||||
{
|
||||
if (uiMsgID == C_uiTUTPopupRun)
|
||||
{
|
||||
CDialogInput *p_oDlg = new CDialogInput ("File Name" , m_csScriptPathName, m_csScriptFileName, m_bScriptRecursive);
|
||||
|
||||
if (p_oDlg && p_oDlg -> DoModal () == IDOK)
|
||||
{
|
||||
m_csScriptFileName = p_oDlg -> m_fn_csGetEditText ();
|
||||
m_csScriptPathName = p_oDlg -> m_fn_csGetPath();
|
||||
m_bScriptRecursive = p_oDlg -> m_fn_bGetRecurse();
|
||||
m_fn_vWritePreferences ();
|
||||
if (! m_csScriptFileName . IsEmpty()) TUT_g_oTutorialManager . m_fn_vLaunchScript (m_csScriptFileName);
|
||||
}
|
||||
if (p_oDlg) delete p_oDlg;
|
||||
}
|
||||
else if (uiMsgID == C_uiTUTPopupAutoRun)
|
||||
{
|
||||
m_bAutoRun = ! m_bAutoRun;
|
||||
m_fn_vWritePreferences ();
|
||||
}
|
||||
else if (uiMsgID == C_uiTUTPopupBackGround)
|
||||
{
|
||||
m_bBackGroundActive = ! m_bBackGroundActive;
|
||||
TUT_g_oTutorialManager . m_fn_vSetBackGroundActive (m_bBackGroundActive) ;
|
||||
m_fn_vWritePreferences ();
|
||||
}
|
||||
else if (uiMsgID == C_uiTUTPopupSet)
|
||||
{
|
||||
CDialogInput *p_oDlg = new CDialogInput ("File Name" , m_csScriptFileName);
|
||||
|
||||
if (p_oDlg && p_oDlg -> DoModal () == IDOK)
|
||||
{
|
||||
m_csScriptFileName = p_oDlg -> m_fn_csGetEditText ();
|
||||
m_fn_vWritePreferences ();
|
||||
}
|
||||
if (p_oDlg) delete p_oDlg;
|
||||
}
|
||||
else if (uiMsgID == C_uiTUTPopupRecord)
|
||||
{
|
||||
m_fn_vStartStopRecord ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - m_fn_vLoadPreferences
|
||||
// Load preferences from a .INI file
|
||||
//-----------------------------------------------------------------------------
|
||||
void TUT_Interface::m_fn_vLoadPreferences (void)
|
||||
{
|
||||
CString csFileName = M_GetMainApp()->m_csEditorDataPath + "Tools\\Tut\\Tut.ini";
|
||||
char *p_szFileName = (char*)(LPCSTR)csFileName;
|
||||
char szDimension[256];
|
||||
|
||||
// AutoRun Mode
|
||||
GetPrivateProfileString ("Preference" , "AutoRun" , "FALSE" , szDimension , 256 , (char*)(LPCSTR)p_szFileName);
|
||||
m_bAutoRun = !strcmpi( szDimension, "TRUE" );
|
||||
|
||||
// Main Script File
|
||||
GetPrivateProfileString ("Preference" , "Script File" , "" , szDimension , 256 , (char*)(LPCSTR)p_szFileName);
|
||||
m_csScriptFileName = szDimension;
|
||||
|
||||
// Main Path Name
|
||||
GetPrivateProfileString ("Preference" , "Path Name" , "" , szDimension , 256 , (char*)(LPCSTR)p_szFileName);
|
||||
m_csScriptPathName = szDimension;
|
||||
|
||||
// Recursive Read
|
||||
GetPrivateProfileString ("Preference" , "Recursive Read" , "FALSE" , szDimension , 256 , (char*)(LPCSTR)p_szFileName);
|
||||
m_bScriptRecursive = !strcmpi( szDimension, "TRUE" );
|
||||
|
||||
// Main BackGround Active Mode
|
||||
GetPrivateProfileString ("Preference" , "BackGround Active" , "FALSE" , szDimension , 256 , (char*)(LPCSTR)p_szFileName);
|
||||
m_bBackGroundActive = !strcmpi( szDimension, "TRUE" );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - m_fn_vWritePreferences
|
||||
// Save preferences on a .INI file
|
||||
//-----------------------------------------------------------------------------
|
||||
void TUT_Interface::m_fn_vWritePreferences (void)
|
||||
{
|
||||
CString csFileName;
|
||||
|
||||
csFileName = M_GetMainApp()->m_csEditorDataPath + "Tools\\Tut\\Tut.ini";
|
||||
|
||||
char *p_szFileName = (char*)(LPCSTR)csFileName;
|
||||
|
||||
// AutoRun Mode
|
||||
WritePrivateProfileString ("Preference" , "AutoRun" , m_bAutoRun ? "TRUE" : "FALSE" , p_szFileName);
|
||||
|
||||
// Main Script File
|
||||
WritePrivateProfileString ("Preference" , "Script File" , m_csScriptFileName , p_szFileName);
|
||||
|
||||
// Main Path Name
|
||||
WritePrivateProfileString ("Preference" , "Path Name" , m_csScriptPathName , p_szFileName);
|
||||
|
||||
// Recursive Read
|
||||
WritePrivateProfileString ("Preference" , "Recursive Read" , m_bScriptRecursive ? "TRUE" : "FALSE" , p_szFileName);
|
||||
|
||||
// Main BackGround Active Mode
|
||||
WritePrivateProfileString ("Preference" , "BackGround Active" , m_bBackGroundActive ? "TRUE" : "FALSE" , p_szFileName);
|
||||
|
||||
// write on file
|
||||
WritePrivateProfileString (NULL , NULL , NULL , p_szFileName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Class TUT_Interface - m_fn_vStartStopRecord
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
void TUT_Interface::m_fn_vStartStopRecord (void)
|
||||
{
|
||||
m_bRecording = !m_bRecording;
|
||||
|
||||
if (m_bRecording)
|
||||
{
|
||||
// Start recording
|
||||
TUT_g_oTutorialManager . m_fn_vStartRecord (GetDLLIdentity () -> hModule , M_GetMainApp() -> m_nThreadID);
|
||||
}
|
||||
else
|
||||
{
|
||||
CFileDialog oDlg (FALSE, "*.tut" , NULL , OFN_EXPLORER | OFN_HIDEREADONLY | OFN_NOREADONLYRETURN | OFN_OVERWRITEPROMPT | OFN_SHOWHELP , NULL , NULL );
|
||||
|
||||
if (oDlg . DoModal() == IDOK)
|
||||
{
|
||||
// stop and save recording
|
||||
TUT_g_oTutorialManager . m_fn_vStopRecord (GetDLLIdentity () -> hModule , M_GetMainApp() -> m_nThreadID , oDlg . GetPathName ());
|
||||
}
|
||||
else
|
||||
{
|
||||
// stop and not save recording
|
||||
TUT_g_oTutorialManager . m_fn_vStopRecord (GetDLLIdentity () -> hModule , M_GetMainApp() -> m_nThreadID , NULL);
|
||||
}
|
||||
}
|
||||
}
|
314
Rayman_X/cpa/tempgrp/Tut/Src/dlginput.cpp
Normal file
314
Rayman_X/cpa/tempgrp/Tut/Src/dlginput.cpp
Normal file
@@ -0,0 +1,314 @@
|
||||
// dlginput.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <direct.h>
|
||||
#include <shlobj.h>
|
||||
#include "ACP_Base.h"
|
||||
#include "ITF.h"
|
||||
|
||||
#include "dlginput.hpp"
|
||||
|
||||
#include "TUT.h"
|
||||
#include "..\Main\Inc\_EditID.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInput dialog
|
||||
#define M_DeleteOnEnd( string, charact )\
|
||||
{\
|
||||
if( string . GetLength() )\
|
||||
{\
|
||||
string . MakeReverse();\
|
||||
while( string[0] == charact ) string = string . Mid( 1 );\
|
||||
string . MakeReverse();\
|
||||
}\
|
||||
}
|
||||
|
||||
CDialogInput::CDialogInput(const CString _csStaticText, const CString _csPathText /*=""*/,
|
||||
const CString _csFileText /*=""*/, BOOL _bRecursive /*=FALSE*/, CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDialogInput::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDialogInput)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
m_csStaticText = _csStaticText;
|
||||
m_csPathText = _csPathText;
|
||||
m_csFileText = _csFileText;
|
||||
m_bRecursive = _bRecursive;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CDialogInput::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDialogInput)
|
||||
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDialogInput, CDialog)
|
||||
//{{AFX_MSG_MAP(CDialogInput)
|
||||
ON_WM_DRAWITEM()
|
||||
ON_WM_DESTROY()
|
||||
ON_WM_CANCELMODE()
|
||||
ON_BN_CLICKED(IDC_BUTTON_READ, OnBtRead)
|
||||
ON_BN_CLICKED(IDC_BUTTON_BROWSE, OnBtBrowse)
|
||||
ON_LBN_SELCHANGE(IDC_LIST_FILE, OnSelChange)
|
||||
ON_LBN_DBLCLK(IDC_LIST_FILE, OnDoubleClick)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDialogInput message handlers
|
||||
|
||||
void CDialogInput::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
GetDlgItem( IDC_EDIT_TEXT ) -> GetWindowText( m_csEditText );
|
||||
if( m_csEditText . GetLength() )
|
||||
{
|
||||
GetDlgItem( IDC_EDIT_PATH ) -> GetWindowText( m_csPathText );
|
||||
m_bRecursive = ((CButton*) GetDlgItem( IDC_CHECK_RECURSIVE )) -> GetCheck();
|
||||
CDialog::OnOK();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CDialogInput::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
GetDlgItem( IDC_EDIT_TEXT ) -> SetWindowText( m_csFileText );
|
||||
GetDlgItem( IDC_EDIT_PATH ) -> SetWindowText( m_csPathText );
|
||||
GetDlgItem( IDC_STATIC_TEXT ) -> SetWindowText( m_csStaticText );
|
||||
((CButton*) GetDlgItem( IDC_CHECK_RECURSIVE )) -> SetCheck( m_bRecursive );
|
||||
GetDlgItem( IDC_EDIT_TEXT ) -> SetFocus();
|
||||
if( m_csPathText . GetLength() )
|
||||
m_fn_vFillList();
|
||||
//
|
||||
TUT_M_vGetTutDll();
|
||||
TUT_M_vRegisterControlID( IDC_EDIT_TEXT, "TUT_INPUT_TEXT", TUT_e_TextEdit );
|
||||
TUT_M_vRegisterControlID( IDOK, "TUT_INPUT_OK", TUT_e_Button );
|
||||
TUT_M_vRegisterControlID( IDCANCEL, "TUT_INPUT_CANCEL", TUT_e_Button );
|
||||
TUT_M_vRegisterControlID( IDC_BUTTON_READ, "TUT_INPUT_READ", TUT_e_Button );
|
||||
TUT_M_vRegisterControlID( IDC_BUTTON_BROWSE,"TUT_INPUT_BROWSE", TUT_e_Button );
|
||||
TUT_M_vRegisterControlID( IDC_LIST_FILE, "TUT_INPUT_LIST", TUT_e_ListBox );
|
||||
TUT_M_vRegisterControlID( IDC_EDIT_PATH, "TUT_INPUT_PATH", TUT_e_TextEdit );
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CDialogInput::OnDestroy()
|
||||
{
|
||||
TUT_M_vGetTutDll();
|
||||
TUT_M_vUnregisterControlID( IDC_EDIT_TEXT );
|
||||
TUT_M_vUnregisterControlID( IDOK );
|
||||
TUT_M_vUnregisterControlID( IDCANCEL );
|
||||
TUT_M_vUnregisterControlID( IDC_BUTTON_READ );
|
||||
TUT_M_vUnregisterControlID( IDC_BUTTON_BROWSE );
|
||||
TUT_M_vUnregisterControlID( IDC_LIST_FILE );
|
||||
TUT_M_vUnregisterControlID( IDC_EDIT_PATH );
|
||||
|
||||
CDialog::OnDestroy();
|
||||
}
|
||||
|
||||
void CDialogInput::OnBtBrowse()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
BROWSEINFO bi;
|
||||
LPSTR lpBuffer = (LPSTR)malloc(_MAX_PATH);
|
||||
LPITEMIDLIST pidlBrowse; // PIDL selected by user
|
||||
|
||||
|
||||
// Fill in the BROWSEINFO structure.
|
||||
bi.hwndOwner = m_hWnd;
|
||||
bi.pidlRoot = NULL;
|
||||
bi.pszDisplayName = lpBuffer;
|
||||
bi.lpszTitle = "Choose a Path";
|
||||
bi.ulFlags = 0;
|
||||
bi.lpfn = NULL;
|
||||
bi.lParam = 0;
|
||||
|
||||
// Browse for a folder and return its PIDL.
|
||||
pidlBrowse = SHBrowseForFolder(&bi);
|
||||
if (pidlBrowse != NULL)
|
||||
{
|
||||
if (SHGetPathFromIDList(pidlBrowse, lpBuffer))
|
||||
{
|
||||
GetDlgItem( IDC_EDIT_PATH ) -> SetWindowText( lpBuffer );
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up.
|
||||
free(lpBuffer);
|
||||
|
||||
}
|
||||
|
||||
void CDialogInput::OnBtRead()
|
||||
{
|
||||
m_fn_vFillList();
|
||||
}
|
||||
|
||||
void CDialogInput::OnSelChange()
|
||||
{
|
||||
CListBox *pLB = (CListBox*) GetDlgItem( IDC_LIST_FILE );
|
||||
int iIndex = pLB -> GetCurSel();
|
||||
|
||||
if( iIndex != LB_ERR )
|
||||
{
|
||||
CString csText;
|
||||
CString csPath;
|
||||
|
||||
GetDlgItem( IDC_EDIT_PATH ) -> GetWindowText( csPath );
|
||||
|
||||
M_DeleteOnEnd( csPath, '\\' )
|
||||
|
||||
pLB -> GetText( iIndex, csText );
|
||||
if( csText [0] == '\\' )
|
||||
{
|
||||
GetDlgItem( IDC_EDIT_TEXT ) -> SetWindowText( csPath + csText + ".tut" );
|
||||
}
|
||||
else
|
||||
{
|
||||
GetDlgItem( IDC_EDIT_TEXT ) -> SetWindowText( csPath + "\\" + csText + ".tut" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDialogInput::OnDoubleClick()
|
||||
{
|
||||
CListBox *pLB = (CListBox*) GetDlgItem( IDC_LIST_FILE );
|
||||
int iIndex = pLB -> GetCurSel();
|
||||
|
||||
if( iIndex != LB_ERR )
|
||||
OnOK();
|
||||
}
|
||||
|
||||
void CDialogInput::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
|
||||
{
|
||||
if ( (nIDCtl == IDC_LIST_FILE) &&
|
||||
(GetDlgItem( IDC_LIST_FILE )->IsWindowEnabled() ) &&
|
||||
(lpDIS->itemID != LB_ERR) )
|
||||
{
|
||||
CDC *pDC = CDC::FromHandle( lpDIS->hDC );
|
||||
CString csText , csPath;
|
||||
CListBox *pLB = (CListBox*) GetDlgItem( IDC_LIST_FILE );
|
||||
BOOL bSelected = (lpDIS->itemState & ODS_SELECTED );
|
||||
int iPos;
|
||||
CSize oSize;
|
||||
|
||||
pLB -> GetText(lpDIS->itemID, csText ) ;
|
||||
iPos = csText . ReverseFind( '\\' );
|
||||
if( iPos != -1 )
|
||||
{
|
||||
iPos++;
|
||||
csPath = csText . Left( iPos );
|
||||
oSize = pDC -> GetTextExtent( csPath );
|
||||
|
||||
pDC->FillSolidRect( &lpDIS->rcItem, GetSysColor( COLOR_WINDOW ));
|
||||
pDC->SetBkMode( TRANSPARENT);
|
||||
|
||||
pDC->SetTextColor( RGB(0, 0, 255) );
|
||||
lpDIS->rcItem.left += 1;
|
||||
pDC->DrawText( csPath , &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER );
|
||||
|
||||
lpDIS->rcItem.left += oSize . cx;
|
||||
pDC->SetTextColor( RGB(255, 0, 0) );
|
||||
pDC->DrawText( csText . Mid( iPos ) , &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER );
|
||||
|
||||
lpDIS->rcItem.left -= oSize . cx;
|
||||
lpDIS->rcItem.left -= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpDIS->rcItem.left += 1;
|
||||
|
||||
pDC->SetTextColor( RGB(255, 0, 0) );
|
||||
pDC->DrawText( csText , &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER );
|
||||
|
||||
lpDIS->rcItem.left -= 1;
|
||||
}
|
||||
if (bSelected)
|
||||
pDC->InvertRect( &lpDIS->rcItem );
|
||||
}
|
||||
else
|
||||
CDialog::OnDrawItem(nIDCtl, lpDIS);
|
||||
}
|
||||
|
||||
void CDialogInput::m_fn_vFillList()
|
||||
{
|
||||
CListBox *pLB = (CListBox*) GetDlgItem( IDC_LIST_FILE );
|
||||
|
||||
pLB -> ResetContent();
|
||||
|
||||
// get path
|
||||
CString csPath;
|
||||
BOOL bRecursive;
|
||||
|
||||
GetDlgItem( IDC_EDIT_PATH ) -> GetWindowText( csPath );
|
||||
bRecursive = ((CButton*) GetDlgItem( IDC_CHECK_RECURSIVE )) -> GetCheck();
|
||||
|
||||
M_DeleteOnEnd( csPath, '\\' )
|
||||
|
||||
if( ! csPath . IsEmpty() )
|
||||
m_fn_vRecurFillList( csPath , "" , bRecursive );
|
||||
else
|
||||
MessageBox( "The Path is empty" , "Error" , MB_OK + MB_ICONERROR );
|
||||
}
|
||||
|
||||
void CDialogInput::m_fn_vRecurFillList( const CString _csBeginPathName , const CString _csCurrentPathName, BOOL _bRecursive )
|
||||
{
|
||||
WIN32_FIND_DATA stWFD; // structure for searching file
|
||||
HANDLE hFD;
|
||||
BOOL bContinue; // handle for searching file
|
||||
CListBox *pLB = (CListBox*) GetDlgItem( IDC_LIST_FILE );
|
||||
|
||||
// search for files
|
||||
hFD = FindFirstFile( _csBeginPathName + _csCurrentPathName + "\\*.tut", &stWFD );
|
||||
bContinue = ( hFD != INVALID_HANDLE_VALUE );
|
||||
while( bContinue )
|
||||
{
|
||||
if ( !(stWFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
{
|
||||
CString csFileName;
|
||||
|
||||
if( _csCurrentPathName . GetLength() )
|
||||
csFileName = _csCurrentPathName + "\\" + stWFD.cFileName;
|
||||
else
|
||||
csFileName = stWFD.cFileName;
|
||||
|
||||
pLB -> AddString( csFileName . Left( csFileName . GetLength() - 4 ) );
|
||||
}
|
||||
bContinue = FindNextFile( hFD, &stWFD);
|
||||
}
|
||||
|
||||
// close FindData handle
|
||||
FindClose(hFD);
|
||||
|
||||
// search for directory
|
||||
if( _bRecursive )
|
||||
{
|
||||
hFD = FindFirstFile( _csBeginPathName + _csCurrentPathName + "\\*", &stWFD );
|
||||
bContinue = ( hFD != INVALID_HANDLE_VALUE );
|
||||
while( bContinue )
|
||||
{
|
||||
if ((stWFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (stWFD.cFileName[0] != '.') )
|
||||
{
|
||||
// appel recursif
|
||||
m_fn_vRecurFillList( _csBeginPathName , _csCurrentPathName + "\\" + stWFD.cFileName, TRUE );
|
||||
}
|
||||
bContinue = FindNextFile( hFD, &stWFD);
|
||||
}
|
||||
|
||||
// close FindData handle
|
||||
FindClose(hFD);
|
||||
}
|
||||
}
|
BIN
Rayman_X/cpa/tempgrp/Tut/TutLib/Doc/Présentation du tutorial.doc
Normal file
BIN
Rayman_X/cpa/tempgrp/Tut/TutLib/Doc/Présentation du tutorial.doc
Normal file
Binary file not shown.
18
Rayman_X/cpa/tempgrp/Tut/TutLib/Inc/StdAfx.h
Normal file
18
Rayman_X/cpa/tempgrp/Tut/TutLib/Inc/StdAfx.h
Normal 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__
|
||||
|
716
Rayman_X/cpa/tempgrp/Tut/TutLib/Inc/Tut_Mngr.hpp
Normal file
716
Rayman_X/cpa/tempgrp/Tut/TutLib/Inc/Tut_Mngr.hpp
Normal file
@@ -0,0 +1,716 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* Tut_Mngr.hpp : declaration of the TUT_CTutorialManager class *
|
||||
* *
|
||||
* This class can take the control of all windows of the application *
|
||||
* to create a tutorial or an automatic test *
|
||||
* *
|
||||
* Author : Alexis Vaisse *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _TUT_MNGR_HPP_
|
||||
#define _TUT_MNGR_HPP_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <afxtempl.h>
|
||||
|
||||
//--------------------------- error codes -------------------------------------
|
||||
|
||||
#define TUT_C_iNoError 0
|
||||
#define TUT_C_iError_FileNotFound 1
|
||||
#define TUT_C_iError_UnknownCommand 2
|
||||
#define TUT_C_iError_TooManyParameters 3
|
||||
#define TUT_C_iError_ParameterRequired 4
|
||||
#define TUT_C_iError_UnknownButton 5
|
||||
#define TUT_C_iError_ButtonRequired 6
|
||||
#define TUT_C_iError_InvalidCoordinates 7
|
||||
#define TUT_C_iError_NoWindowToWriteText 8
|
||||
#define TUT_C_iError_InvalidNumber 9
|
||||
#define TUT_C_iError_UnknownTextEdit 10
|
||||
#define TUT_C_iError_TextEditRequired 11
|
||||
#define TUT_C_iError_UnknownWindow 12
|
||||
#define TUT_C_iError_UnknownComboBox 13
|
||||
#define TUT_C_iError_ListOrComboRequired 14
|
||||
#define TUT_C_iError_UnknownMdiWindow 15
|
||||
#define TUT_C_iError_MdiWindowRequired 16
|
||||
#define TUT_C_iError_UnknownColor 17
|
||||
#define TUT_C_iError_UnknownControl 18
|
||||
#define TUT_C_iError_SelectCtrlRequired 19
|
||||
#define TUT_C_iError_InvalidTextAlignment 20
|
||||
#define TUT_C_iError_UnknownTreeBox 21
|
||||
#define TUT_C_iError_TreeBoxRequired 22
|
||||
#define TUT_C_iError_FunctionNotCompiled 23
|
||||
#define TUT_C_iError_Unknown3dObject 24
|
||||
#define TUT_C_iError_NoMenuAvailable 25
|
||||
#define TUT_C_iError_UnknownMenuName 26
|
||||
#define TUT_C_iError_NotASubMenu 27
|
||||
#define TUT_C_iError_EndLoopWithoutLoop 28
|
||||
#define TUT_C_iError_TestOperatorRequired 29
|
||||
#define TUT_C_iError_OrIfWithoutAnIf 30
|
||||
#define TUT_C_iError_ElseWithoutAnIf 31
|
||||
#define TUT_C_iError_ElseInTheWrongPlace 32
|
||||
#define TUT_C_iError_EndIfWithoutAnIf 33
|
||||
#define TUT_C_iError_DebugWndAlreadyOpen 34
|
||||
#define TUT_C_iError_DebugWndNotOpen 35
|
||||
#define TUT_C_iError_InvalidMdiHandle 36
|
||||
#define TUT_C_iError_InvalidParentMdiHandle 37
|
||||
#define TUT_C_iError_InvalidListBoxHandle 38
|
||||
#define TUT_C_iError_InvalidComboBoxHandle 39
|
||||
#define TUT_C_iError_InvalidTreeBoxHandle 40
|
||||
#define TUT_C_iError_InvalidMenuHandle 41
|
||||
#define TUT_C_iError_InvalidMenuWndHandle 42
|
||||
#define TUT_C_iError_InvalidButtonHandle 43
|
||||
#define TUT_C_iError_InvalidTextEditHandle 44
|
||||
#define TUT_C_iError_WindowOrMdiRequired 45
|
||||
#define TUT_C_iError_InvalidWndOrMdiHandle 46
|
||||
#define TUT_C_iError_CtrlWithTextRequired 47
|
||||
#define TUT_C_iError_InvalidHandle 48
|
||||
#define TUT_C_iError_BooleanValueRequired 49
|
||||
#define TUT_C_iError_ItemNotFoundInTree 50
|
||||
#define TUT_C_iError_ItemHasNoChild 51
|
||||
#define TUT_C_iError_InvalidChildNumber 52
|
||||
#define TUT_C_iError_NotANumericVariable 53
|
||||
#define TUT_C_iError_DivisionByZero 54
|
||||
#define TUT_C_iError_EmptyVariable 55
|
||||
#define TUT_C_iError_LogFileAlreadyOpen 56
|
||||
#define TUT_C_iError_UnableToOpenLogFile 57
|
||||
#define TUT_C_iError_LogFileNotOpen 58
|
||||
#define TUT_C_iError_InvalidXBorder 59
|
||||
#define TUT_C_iError_InvalidYBorder 60
|
||||
#define TUT_C_iError_InvalidNumberOrPercent 61
|
||||
#define TUT_C_iError_InvalidListCtrlHandle 62
|
||||
#define TUT_C_iError_LabelsWithSameName 63
|
||||
#define TUT_C_iError_LabelNotFound 64
|
||||
#define TUT_C_iError_ModelNotFound 65
|
||||
#define TUT_C_iError_DragAtTheWrongPlace 66
|
||||
#define TUT_C_iError_DropAtTheWrongPlace 67
|
||||
#define TUT_C_iError_InvisibleControl 68
|
||||
#define TUT_C_iError_DisabledControl 69
|
||||
#define TUT_C_iError_NoMultipleSelection 70
|
||||
#define TUT_C_iError_UnknownListBox 71
|
||||
#define TUT_C_iError_ListBoxRequired 72
|
||||
#define TUT_C_iError_UnknownObject 73
|
||||
#define TUT_C_iError_UnknownVariable 74
|
||||
#define TUT_C_iError_CountCtrlRequired 75
|
||||
#define TUT_C_iError_UnknownMessageBoxCtrl 76
|
||||
#define TUT_C_iError_MessageBoxCtrlNotFound 77
|
||||
#define TUT_C_iError_NoReturnValue 78
|
||||
#define TUT_C_iError_UnknownKey 79
|
||||
#define TUT_C_iError_MultiLineRequired 80
|
||||
#define TUT_C_iError_InvalidLineNumber 81
|
||||
#define TUT_C_iError_LocalVariableExist 82
|
||||
#define TUT_C_iError_GlobalVariableExist 83
|
||||
#define TUT_C_iError_ListViewRequired 84
|
||||
#define TUT_C_iError_UncoherentSelectionLimits 85
|
||||
|
||||
#define TUT_C_iQuitImmediately 255
|
||||
|
||||
//----------- error codes for the GetLastError variable -----------------------
|
||||
|
||||
#define TUT_C_iError_ListBoxItemNotFound 1
|
||||
#define TUT_C_iError_ComboBoxItemNotFound 2
|
||||
#define TUT_C_iError_ListCtrlItemNotFound 3
|
||||
#define TUT_C_iError_ListBoxInvalidLine 4
|
||||
#define TUT_C_iError_ComboBoxInvalidLine 5
|
||||
#define TUT_C_iError_ListCtrlInvalidLine 6
|
||||
#define TUT_C_iError_TreeCtrlItemNotFound 7
|
||||
#define TUT_C_iError_SoundError 8
|
||||
#define TUT_C_iError_UnregisteredWindow 9
|
||||
|
||||
//--------------------------- action names ------------------------------------
|
||||
|
||||
// tutorial text windows
|
||||
#define TUT_C_szOpenWindow "OpenWindow"
|
||||
#define TUT_C_szCloseWindow "CloseWindow"
|
||||
#define TUT_C_szSelectWindow "SelectWindow"
|
||||
#define TUT_C_szSetText "SetText"
|
||||
#define TUT_C_szWriteText "Write"
|
||||
|
||||
// debug and log file
|
||||
#define TUT_C_szOpenDebugWindow "OpenDebugWindow"
|
||||
#define TUT_C_szCloseDebugWindow "CloseDebugWindow"
|
||||
#define TUT_C_szOpenLogFile "OpenLogFile"
|
||||
#define TUT_C_szCloseLogFile "CloseLogFile"
|
||||
#define TUT_C_szClearLogFile "ClearLogFile"
|
||||
#define TUT_C_szOpenDebugLogFile "OpenDebugLogFile"
|
||||
#define TUT_C_szClearDebugLogFile "ClearDebugLogFile"
|
||||
#define TUT_C_szCloseDebugLogFile "CloseDebugLogFile"
|
||||
|
||||
// context
|
||||
#define TUT_C_szSaveContext "SaveContext"
|
||||
#define TUT_C_szRestoreContext "RestoreContext"
|
||||
|
||||
// miscellaneous
|
||||
#define TUT_C_szPause "Pause"
|
||||
#define TUT_C_szSetMouseSpeed "SetMouseSpeed"
|
||||
#define TUT_C_szSetKeySpeed "SetKeySpeed"
|
||||
#define TUT_C_szListAllControl "ListAllControl" // Used for debugging
|
||||
#define TUT_C_szExit "Exit" // Quit the current file
|
||||
#define TUT_C_szHalt "Halt" // Stop the current process
|
||||
#define TUT_C_szMessageBox "MessageBox" // To clic into a message box
|
||||
#define TUT_C_szBeep "Beep"
|
||||
#define TUT_C_szPlay "Play"
|
||||
|
||||
// special actions
|
||||
#define TUT_C_szRightButton "RightButton" // Tell to use the right button for the next action
|
||||
#define TUT_C_szDoubleClic "DoubleClic" // Tell to use a double clic for the next action
|
||||
#define TUT_C_szPosition "Position" // To clic on a specific position of a control
|
||||
#define TUT_C_szDrag "Drag" // To begin a drag and drop
|
||||
#define TUT_C_szDrop "Drop" // To end a drag and drop
|
||||
|
||||
|
||||
// buttons
|
||||
#define TUT_C_szIsChecked "IsChecked"
|
||||
|
||||
// all controls
|
||||
#define TUT_C_szSetFocus "SetFocus"
|
||||
#define TUT_C_szIsExisting "IsExisting"
|
||||
#define TUT_C_szIsVisible "IsVisible"
|
||||
#define TUT_C_szIsEnabled "IsEnabled"
|
||||
#define TUT_C_szClic "Clic"
|
||||
#define TUT_C_szGetFocusWindow "GetFocusWindow"
|
||||
#define TUT_C_szHasFocus "HasFocus"
|
||||
|
||||
// variables
|
||||
#define TUT_C_szVar "Var" // to declare a local variable
|
||||
#define TUT_C_szGlobalVar "GlobalVar" // to declare a global variable
|
||||
#define TUT_C_szSet "Set"
|
||||
#define TUT_C_szFree "Free" // delete a variable
|
||||
|
||||
// windows
|
||||
#define TUT_C_szGetTitle "GetTitle"
|
||||
#define TUT_C_szMinimizeWindow "MinimizeWindow" // mdi windows only
|
||||
#define TUT_C_szMaximizeWindow "MaximizeWindow" // mdi windows only
|
||||
#define TUT_C_szRestoreWindow "RestoreWindow" // mdi windows only
|
||||
|
||||
// controls with selection (list, combo, tree)
|
||||
#define TUT_C_szGetSelection "GetSelection"
|
||||
#define TUT_C_szSelectLine "SelectLine" // only for lists and combo
|
||||
#define TUT_C_szSelect "Select"
|
||||
#define TUT_C_szUnselect "Unselect"
|
||||
#define TUT_C_szGetCount "GetCount" // only for lists and combo and text edit
|
||||
#define TUT_C_szIsSelected "IsSelected"
|
||||
#define TUT_C_szIsInList "IsInList" // only for lists and combo
|
||||
#define TUT_C_szAddSelect "AddSelect" // only for multiple select list
|
||||
#define TUT_C_szAddSelectLine "AddSelectLine" // only for multiple select list
|
||||
|
||||
// trees
|
||||
#define TUT_C_szExpand "Expand"
|
||||
#define TUT_C_szCollapse "Collapse"
|
||||
#define TUT_C_szGetNumberOfChildren "GetNumberOfChildren"
|
||||
#define TUT_C_szGetChild "GetChild"
|
||||
#define TUT_C_szGetParent "GetParent"
|
||||
|
||||
// text edits
|
||||
#define TUT_C_szGetText "GetText" // for text edit and button
|
||||
#define TUT_C_szSetEditText "SetEditText"
|
||||
#define TUT_C_szSelectText "SelectText"
|
||||
|
||||
// menu
|
||||
#define TUT_C_szMenu "Menu"
|
||||
#define TUT_C_szPopupMenu "PopupMenu"
|
||||
#define TUT_C_szGetMenuItem "GetMenuItem"
|
||||
#define TUT_C_szGetPopupMenuItem "GetPopupMenuItem"
|
||||
|
||||
// loop
|
||||
#define TUT_C_szLoop "Loop"
|
||||
#define TUT_C_szEndLoop "EndLoop"
|
||||
|
||||
// test
|
||||
#define TUT_C_szIf "If"
|
||||
#define TUT_C_szOrIf "OrIf"
|
||||
#define TUT_C_szElse "Else"
|
||||
#define TUT_C_szEndIf "EndIf"
|
||||
|
||||
// keys
|
||||
#define TUT_C_szKey "Key"
|
||||
#define TUT_C_szPress "Press"
|
||||
#define TUT_C_szRelease "Release"
|
||||
|
||||
// string
|
||||
#define TUT_C_szGetLength "GetLength"
|
||||
#define TUT_C_szFindString "FindString"
|
||||
#define TUT_C_szExtractString "ExtractString"
|
||||
|
||||
// arithmetic operations
|
||||
#define TUT_C_szAdd "Add"
|
||||
#define TUT_C_szSub "Sub"
|
||||
#define TUT_C_szMul "Mul"
|
||||
#define TUT_C_szDiv "Div"
|
||||
|
||||
// functions
|
||||
#define TUT_C_szCall "Call"
|
||||
#define TUT_C_szGetParameters "GetParameters"
|
||||
#define TUT_C_szSetResult "SetResult"
|
||||
#define TUT_C_szGetResult "GetResult"
|
||||
|
||||
// jumps
|
||||
#define TUT_C_szLabel "Label"
|
||||
#define TUT_C_szGoto "Goto"
|
||||
|
||||
|
||||
// 3d view (specific)
|
||||
#define TUT_C_sz3DGetPosition "GetPosition"
|
||||
#define TUT_C_sz3DClic3dView "Clic3dView"
|
||||
#define TUT_C_sz3DIsProtected "IsProtected" // To know if a super object is protected or not
|
||||
#define TUT_C_sz3DMove3d "Move3d"
|
||||
#define TUT_C_sz3DSelectModel "SelectModel" // To select a model into the model window
|
||||
#define TUT_C_sz3DGetModel "GetModel" // Get the selected model
|
||||
#define TUT_C_sz3DGetNumberOfModels "GetNumberOfModels"
|
||||
#define TUT_C_sz3DIsAvailable "IsAvailable" // Return if a object is available or not
|
||||
#define TUT_C_sz3DGetPrefix "GetPrefix" // Return the prefix of the user
|
||||
#define TUT_C_sz3DIsExistingModel "IsExistingModel"
|
||||
#define TUT_C_sz3DGetStatusBarText "GetStatusBarText"
|
||||
|
||||
//----------------------------color names -------------------------------------
|
||||
|
||||
typedef struct TUT_stColorDefinition_
|
||||
{
|
||||
char * szColorName;
|
||||
COLORREF xColor;
|
||||
} TUT_tdstColorDefinition;
|
||||
|
||||
const TUT_tdstColorDefinition g_a_stColorDefinition [] = {
|
||||
{ "Black" , RGB ( 0 , 0 , 0) } ,
|
||||
{ "Red" , RGB (128 , 0 , 0) } ,
|
||||
{ "Green" , RGB ( 0 , 128 , 0) } ,
|
||||
{ "Blue" , RGB ( 0 , 0 , 128) } ,
|
||||
{ "Brown" , RGB (128 , 128 , 0) } ,
|
||||
{ "Magenta" , RGB (128 , 0 , 128) } ,
|
||||
{ "Cyan" , RGB ( 0 , 128 , 128) } ,
|
||||
{ "Gray" , RGB (128 , 128 , 128) } ,
|
||||
{ "LightRed" , RGB (255 , 0 , 0) } ,
|
||||
{ "LightGreen" , RGB ( 0 , 255 , 0) } ,
|
||||
{ "LightBlue" , RGB ( 0 , 0 , 255) } ,
|
||||
{ "Yellow" , RGB (255 , 255 , 0) } ,
|
||||
{ "LightMagenta", RGB (255 , 0 , 255) } ,
|
||||
{ "LightCyan" , RGB ( 0 , 255 , 255) } ,
|
||||
{ "White" , RGB (255 , 255 , 255) } ,
|
||||
{ NULL , 0 } }; // End of array : do not remove
|
||||
|
||||
#define TUT_C_szOk "Ok"
|
||||
#define TUT_C_szCancel "Cancel"
|
||||
#define TUT_C_szAbort "Abort"
|
||||
#define TUT_C_szRetry "Retry"
|
||||
#define TUT_C_szIgnore "Ignore"
|
||||
#define TUT_C_szYes "Yes"
|
||||
#define TUT_C_szNo "No"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define TUT_C_cBeginningOfVariable '@'
|
||||
#define TUT_C_cDeclarationOfVariable '!'
|
||||
|
||||
#define TUT_C_cControl '^'
|
||||
#define TUT_C_cAlt '&'
|
||||
#define TUT_C_cShift '#'
|
||||
|
||||
#define TUT_C_szTextAlignment_Left "Left"
|
||||
#define TUT_C_szTextAlignment_Right "Right"
|
||||
#define TUT_C_szTextAlignment_Center "Center"
|
||||
|
||||
#define TUT_C_szTrue "TRUE"
|
||||
#define TUT_C_szFalse "FALSE"
|
||||
|
||||
#define TUT_C_szBorderLeft "Left"
|
||||
#define TUT_C_szBorderRight "Right"
|
||||
#define TUT_C_szBorderTop "Top"
|
||||
#define TUT_C_szBorderBottom "Bottom"
|
||||
|
||||
#define TUT_C_szGetLastError "GetLastError"
|
||||
#define TUT_C_szGetLastErrorMessage "GetLastErrorMessage"
|
||||
|
||||
#define TUT_C_iErrorNotANumber ((int) 2020202020 )
|
||||
#define TUT_C_dErrorNotANumber ((double) 2020202020.0)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#define TUT_C_xPauseIntervall ((clock_t)(CLOCKS_PER_SEC / 10))
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
typedef enum TUT_eWndType_ { TUT_eWindow , TUT_eMdiWindow ,
|
||||
TUT_eButton , TUT_eTextEdit ,
|
||||
TUT_eListBox , TUT_eComboBox ,
|
||||
TUT_eTreeCtrl , TUT_eListCtrl ,
|
||||
TUT_eSpin , TUT_eSlider , TUT_eScrollBar ,
|
||||
TUT_eUserWindow, TUT_e3DView } TUT_tdeWndType;
|
||||
|
||||
typedef struct TUT_stWndDefinition_
|
||||
{
|
||||
HWND hWnd;
|
||||
CString csName;
|
||||
TUT_tdeWndType eType;
|
||||
} TUT_tdstWndDefinition;
|
||||
|
||||
typedef struct TUT_stMenuDefinition_
|
||||
{
|
||||
HMENU hMenu;
|
||||
HWND hWindow;
|
||||
int iX , iY;
|
||||
} TUT_tdstMenuDefinition;
|
||||
|
||||
typedef struct TUT_stVariableDefinition_
|
||||
{
|
||||
CString csName;
|
||||
CString csValue;
|
||||
int iContextNumber;
|
||||
} TUT_tdstVariableDefinition;
|
||||
|
||||
typedef struct TUT_stLoopDefinition_
|
||||
{
|
||||
TUT_tdstVariableDefinition * p_stVariable;
|
||||
long lCurrentValue; // Current value of the loop variable
|
||||
long lEndValue; // End value of the loop variable
|
||||
long lStep; // Step of the loop variable
|
||||
fpos_t xPosInFile; // Position of the first command inside the loop in the file
|
||||
} TUT_tdstLoopDefinition;
|
||||
|
||||
typedef enum TUT_ePositionInTest_ { TUT_eAfterIf , TUT_eBeforeElse , TUT_eAfterElse } TUT_tdePositionInTest;
|
||||
|
||||
typedef struct TUT_stTestDefinition_
|
||||
{
|
||||
TUT_tdePositionInTest ePositionInTest;
|
||||
BOOL bTestVerified;
|
||||
int iNumberOfSkippedTest; // Number of tests which are inside a not executed block of a test
|
||||
} TUT_tdstTestDefinition;
|
||||
|
||||
typedef struct TUT_stLabelDefinition_
|
||||
{
|
||||
CString csName; // Name of the label
|
||||
fpos_t xPosInFile; // Position of the first command after the label in the file
|
||||
int iContextNumber; // Number of the context (= file) where the label is declared
|
||||
} TUT_tdstLabelDefinition;
|
||||
|
||||
typedef struct TUT_stContextDefinition_
|
||||
{
|
||||
CString csFileName; // Name of the executed file
|
||||
int iLineNumber;
|
||||
} TUT_tdstContextDefinition;
|
||||
|
||||
typedef struct TUT_stLogFileDefinition_
|
||||
{
|
||||
BOOL bOpen; // Is Log File Opened
|
||||
CString csName; // Name of Log File
|
||||
FILE * pFile; // FILE pointer
|
||||
} TUT_tdstLogFileDefinition;
|
||||
|
||||
typedef enum TUT_eArithmeticOperation { TUT_eAdd , TUT_eSub , TUT_eMul , TUT_eDiv } TUT_tdeArithmeticOperation;
|
||||
|
||||
typedef enum TUT_eDragDropType { TUT_eNone , TUT_eMove3d , TUT_eSelectModel } TUT_tdeDragDropType;
|
||||
|
||||
typedef CArray<TUT_tdstWndDefinition * , TUT_tdstWndDefinition *> TUT_td_CArrayOfWnd;
|
||||
typedef CList <TUT_tdstVariableDefinition * , TUT_tdstVariableDefinition *> TUT_td_CListOfVariable;
|
||||
typedef CList <TUT_tdstLoopDefinition * , TUT_tdstLoopDefinition *> TUT_td_CListOfLoop;
|
||||
typedef CList <TUT_tdstTestDefinition * , TUT_tdstTestDefinition *> TUT_td_CListOfTest;
|
||||
typedef CList <TUT_tdstLabelDefinition * , TUT_tdstLabelDefinition *> TUT_td_CListOfLabel;
|
||||
typedef CList <TUT_tdstContextDefinition * , TUT_tdstContextDefinition *> TUT_td_CListOfContext;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class TUT_CTutorialManager
|
||||
{
|
||||
// ***** public functions (Tut_Mngr.cpp) *****
|
||||
public:
|
||||
TUT_CTutorialManager (); // Constructor
|
||||
~TUT_CTutorialManager (); // Destructor
|
||||
|
||||
void m_fn_vRegisterWnd (HWND _hWnd , const CString _csName , TUT_tdeWndType _eType);
|
||||
BOOL m_fn_bUnregisterWnd (HWND _hWnd);
|
||||
void m_fn_vRegisterMenu (HWND _hWnd , HMENU _hMenu , int _iX , int _iY);
|
||||
|
||||
void m_fn_vLaunchScript (const CString _csFileName); // Call this function to execute a script file
|
||||
int m_fn_iExecuteScript (const CString _csFileName); // and not this one
|
||||
|
||||
void m_fn_vSetBackGroundActive (BOOL _bActive);
|
||||
void m_fn_vSetRunMode (BOOL _bRun);
|
||||
BOOL m_fn_bNotInBackGround (void);
|
||||
BOOL m_fn_bIsRunning (void);
|
||||
|
||||
////////////////////////
|
||||
void m_fn_vStartRecord (HMODULE _hModule, DWORD _dThreadID);
|
||||
void m_fn_vStopRecord (HMODULE _hModule, DWORD _dThreadID, LPCTSTR _szFileName);
|
||||
|
||||
BOOL m_fn_bHookMsgProc (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bHookWndProc (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bHookWndProcRet (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
// ***** private functions : execution of a command (Tut_Mngr.cpp) *****
|
||||
private:
|
||||
int m_fn_iExecuteScriptAction (char * _szLine , FILE * pFile);
|
||||
|
||||
int m_fn_iExecuteClic (char * _szParameter);
|
||||
int m_fn_iExecuteOpenWindow (char * _szParameter);
|
||||
int m_fn_iExecuteWriteText (char * _szParameter);
|
||||
int m_fn_iExecutePause (char * _szParameter);
|
||||
int m_fn_iExecuteSetEditText (char * _szParameter);
|
||||
int m_fn_iExecuteCloseWindow (char * _szParameter);
|
||||
int m_fn_iExecuteSetFocus (char * _szParameter);
|
||||
int m_fn_iExecuteSelectWindow (char * _szParameter);
|
||||
int m_fn_iExecuteSelectLine (char * _szParameter , BOOL _bAddToSelection);
|
||||
int m_fn_iExecuteChangeWindowState (char * _szParameter , char * _szAction);
|
||||
int m_fn_iExecuteSetMouseSpeed (char * _szParameter);
|
||||
int m_fn_iExecuteSetText (char * _szParameter);
|
||||
int m_fn_iExecuteSet (char * _szParameter);
|
||||
int m_fn_iExecuteGetSelection (char * _szParameter);
|
||||
int m_fn_iExecuteSelect (char * _szParameter , BOOL _bAddToSelection);
|
||||
int m_fn_iExecuteCall (char * _szParameter);
|
||||
int m_fn_iExecuteExpandOrCollapse (char * _szParameter , BOOL _bExpand);
|
||||
int m_fn_iExecuteListAllControl (char * _szParameter);
|
||||
int m_fn_iExecuteMenu (char * _szParameter , BOOL _bPopupMenu);
|
||||
int m_fn_iExecuteLoop (char * _szParameter , FILE * _pFile);
|
||||
int m_fn_iExecuteEndLoop (char * _szParameter , FILE * _pFile);
|
||||
int m_fn_iExecuteIf (char * _szParameter);
|
||||
int m_fn_iExecuteOrIf (char * _szParameter);
|
||||
int m_fn_iExecuteElse (char * _szParameter);
|
||||
int m_fn_iExecuteEndIf (char * _szParameter);
|
||||
int m_fn_iExecuteRightButton (char * _szParameter);
|
||||
int m_fn_iExecuteDoubleClic (char * _szParameter);
|
||||
int m_fn_iExecuteOpenDebugWindow (char * _szParameter);
|
||||
int m_fn_iExecuteCloseDebugWindow (char * _szParameter);
|
||||
int m_fn_iExecuteGetTitle (char * _szParameter);
|
||||
int m_fn_iExecuteGetText (char * _szParameter);
|
||||
int m_fn_iExecuteIsVisible (char * _szParameter);
|
||||
int m_fn_iExecuteExit (char * _szParameter , FILE * _pFile);
|
||||
int m_fn_iExecuteHalt (char * _szParameter);
|
||||
int m_fn_iExecuteGetNumberOfChildren (char * _szParameter);
|
||||
int m_fn_iExecuteGetChild (char * _szParameter);
|
||||
int m_fn_iExecuteGetParent (char * _szParameter);
|
||||
int m_fn_iExecuteArithmeticOperation (char * _szParameter , TUT_tdeArithmeticOperation _eOperation);
|
||||
int m_fn_iExecuteGetParameters (char * _szParameter);
|
||||
int m_fn_iExecuteOpenLogFile (char * _szParameter , TUT_tdstLogFileDefinition * _p_stLogFile);
|
||||
int m_fn_iExecuteCloseLogFile (char * _szParameter , TUT_tdstLogFileDefinition * _p_stLogFile);
|
||||
int m_fn_iExecuteClearLogFile (char * _szParameter , TUT_tdstLogFileDefinition * _p_stLogFile);
|
||||
int m_fn_iExecutePosition (char * _szParameter);
|
||||
int m_fn_iExecuteLabel (char * _szParameter , FILE * _pFile);
|
||||
int m_fn_iExecuteGoto (char * _szParameter , FILE * _pFile);
|
||||
int m_fn_iExecuteIsChecked (char * _szParameter);
|
||||
int m_fn_iExecuteIsEnabled (char * _szParameter);
|
||||
int m_fn_iExecuteDrag (char * _szParameter);
|
||||
int m_fn_iExecuteDrop (char * _szParameter);
|
||||
int m_fn_iExecuteUnselect (char * _szParameter);
|
||||
int m_fn_iExecuteGetMenuItem (char * _szParameter , BOOL _bPopupMenu);
|
||||
int m_fn_iExecuteFree (char * _szParameter);
|
||||
int m_fn_iExecuteGetCount (char * _szParameter);
|
||||
int m_fn_iExecuteMessageBox (char * _szParameter);
|
||||
int m_fn_iExecuteSetResult (char * _szParameter);
|
||||
int m_fn_iExecuteGetResult (char * _szParameter);
|
||||
int m_fn_iExecuteKey (char * _szParameter);
|
||||
int m_fn_iExecutePressOrRelease (char * _szParameter , BOOL _bKeyPressed);
|
||||
int m_fn_iExecuteSetKeySpeed (char * _szParameter);
|
||||
int m_fn_iExecuteIsExisting (char * _szParameter);
|
||||
int m_fn_iExecuteGetLength (char * _szParameter);
|
||||
int m_fn_iExecuteFindString (char * _szParameter);
|
||||
int m_fn_iExecuteExtractString (char * _szParameter);
|
||||
int m_fn_iExecuteBeep (char * _szParameter);
|
||||
int m_fn_iExecutePlay (char * _szParameter);
|
||||
int m_fn_iExecuteIsSelected (char * _szParameter);
|
||||
int m_fn_iExecuteVar (char * _szParameter);
|
||||
int m_fn_iExecuteGlobalVar (char * _szParameter);
|
||||
int m_fn_iExecuteIsInList (char * _szParameter);
|
||||
int m_fn_iExecuteSaveContext (char * _szParameter);
|
||||
int m_fn_iExecuteRestoreContext (char * _szParameter);
|
||||
int m_fn_iExecuteGetFocusWindow (char * _szParameter);
|
||||
int m_fn_iExecuteHasFocus (char * _szParameter);
|
||||
int m_fn_iExecuteSelectText (char * _szParameter);
|
||||
// 3d view specific
|
||||
int m_fn_iExecute3dGetPosition (char * _szParameter);
|
||||
int m_fn_iExecute3dClic3dView (char * _szParameter);
|
||||
int m_fn_iExecute3dIsProtected (char * _szParameter);
|
||||
int m_fn_iExecute3dMove3d (char * _szParameter);
|
||||
int m_fn_iExecute3dSelectModel (char * _szParameter);
|
||||
int m_fn_iExecute3dGetModel (char * _szParameter);
|
||||
int m_fn_iExecute3dGetNumberOfModels (char * _szParameter);
|
||||
int m_fn_iExecute3dIsAvailable (char * _szParameter);
|
||||
int m_fn_iExecute3dGetPrefix (char * _szParameter);
|
||||
int m_fn_iExecute3dIsExistingModel (char * _szParameter);
|
||||
int m_fn_iExecute3dGetStatusBarText (char * _szParameter);
|
||||
|
||||
// ***** private variables *****
|
||||
private:
|
||||
TUT_td_CArrayOfWnd m_oArrayOfWnd;
|
||||
TUT_td_CListOfVariable m_oListOfVariable;
|
||||
TUT_td_CListOfLoop m_oListOfLoop;
|
||||
TUT_td_CListOfTest m_oListOfTest;
|
||||
TUT_td_CListOfLabel m_oListOfLabel;
|
||||
TUT_td_CListOfContext m_oListOfContext;
|
||||
|
||||
TUT_tdstWndDefinition * m_p_stCurrentUserWindow;
|
||||
|
||||
// Parameters for the mouse move
|
||||
int m_lCurrentMaxDuration;
|
||||
int m_lCurrentMinSpeed;
|
||||
int m_lCurrentAcceleration;
|
||||
|
||||
// Parameter for the keyboard
|
||||
int m_iDurationBetweenKeys;
|
||||
BOOL m_bUseShift;
|
||||
BOOL m_bUseAlt;
|
||||
BOOL m_bUseControl;
|
||||
|
||||
// Parameters for the text attributes
|
||||
COLORREF m_xCurrentColor;
|
||||
long m_lCurrentHeight;
|
||||
long m_lCurrentAlignment;
|
||||
|
||||
// Parameters for the selection
|
||||
BOOL m_bUseRightButton;
|
||||
BOOL m_bUseDoubleClic;
|
||||
BOOL m_bUseDrag;
|
||||
BOOL m_bUseDrop;
|
||||
|
||||
BOOL m_bUsePosition;
|
||||
int m_iXPosition;
|
||||
int m_iYPosition;
|
||||
BOOL m_bRightBorder;
|
||||
BOOL m_bBottomBorder;
|
||||
BOOL m_bPercentForX;
|
||||
BOOL m_bPercentForY;
|
||||
|
||||
// Paramater for the menu
|
||||
TUT_tdstMenuDefinition m_stCurrentPopupMenu;
|
||||
|
||||
// The debug window
|
||||
HWND m_hDebugWnd;
|
||||
|
||||
// The timer
|
||||
UINT m_uiTimerNumber;
|
||||
BOOL m_bBackGroundActive;
|
||||
|
||||
// The ID of the main thread
|
||||
UINT m_uiMainThreadID;
|
||||
BOOL m_bRunMode;
|
||||
|
||||
// The parameters (used by "Call") and the result
|
||||
int m_iNumberOfParameter;
|
||||
CString m_a_csParameter [9];
|
||||
int m_iNumberOfResult;
|
||||
CString m_a_csResult [9];
|
||||
|
||||
// The log file
|
||||
TUT_tdstLogFileDefinition m_stLogFile;
|
||||
|
||||
// The Debug Log File
|
||||
TUT_tdstLogFileDefinition m_stDebugLogFile;
|
||||
|
||||
// The jumps
|
||||
BOOL m_bInsideAGoto;
|
||||
CString m_csLabelToFind;
|
||||
|
||||
// The record of script
|
||||
CStringList m_oListOfCommands;
|
||||
BOOL m_bInPause;
|
||||
clock_t m_xLastCommandTime;
|
||||
long m_lDragDrop;
|
||||
CString m_csDragDropElement;
|
||||
TUT_tdeDragDropType m_eDragDropType;
|
||||
|
||||
// ***** private functions : low level functions (Tut_Mngr.inc)
|
||||
private:
|
||||
CString m_fn_csGetTreeCtrlItemText(HWND _hTreeCtrl , HTREEITEM _hItem);
|
||||
// Get the text of one item of a tree ctrl
|
||||
UINT m_fn_uiGetTreeCtrlState (HWND _hTreeCtrl , HTREEITEM _hItem , UINT _uiFlag);
|
||||
// Get the state of one item of a tree ctrl
|
||||
HTREEITEM m_fn_hFindStringInTree (HWND _hTreeCtrl , HTREEITEM _hRootItem , CString _csText);
|
||||
// Search a string into a tree (recursiv function)
|
||||
BOOL m_fn_bIsItemVisibleInTree (HWND _hTreeCtrl , HTREEITEM _hItem);
|
||||
BOOL m_fn_bSearchWndDefinition (const CString _csName , int * _p_iIndex = NULL);
|
||||
BOOL m_fn_bSearchWndDefinition (HWND _hWnd , int * _p_iIndex = NULL);
|
||||
TUT_tdstWndDefinition * m_fnp_stFindWndDefinition (const CString _csName); // Search a window name into the list
|
||||
|
||||
public:
|
||||
// This function must be public, because it is called by the callback timer function
|
||||
TUT_tdstWndDefinition * m_fnp_stFindWndDefinition (HWND _hWnd); // Search a window handle into the list
|
||||
|
||||
private:
|
||||
TUT_tdstLabelDefinition * m_fnp_stFindLabel (char * _szName); // Search a label name into the list
|
||||
void m_fn_vSetValueToVariable (TUT_tdstVariableDefinition * , long);
|
||||
void m_fn_vSetGetLastError (long _lErrorNumber);
|
||||
int m_fn_iConvertToInt (char * _szString); // Convert a string into a integer.
|
||||
// Return TUT_C_iErrorNotANumber if error
|
||||
double m_fn_dConvertToDouble (char * _szString); // Convert a string into a double
|
||||
// Return TUT_C_dErrorNotANumber if error
|
||||
BOOL m_fn_bAreParametersEqual (char * _szParameter1 , char * _szParameter2);
|
||||
BOOL m_fn_bIsParameter1LessThanParameter2
|
||||
(char * _szParameter1 , char * _szParameter2);
|
||||
BOOL m_fn_bIsParameterTrue (char * _szParameter , int * _p_iReturnValue);
|
||||
BOOL m_fn_bIsTestVerified (char * _szTestOperator , char * _szParameter1 ,
|
||||
char * _szParameter2 , int * _p_iReturnValue);
|
||||
BOOL m_fn_bMustActionBeExecuted (); // Return if the current action must be executed
|
||||
void m_fn_vAddAnActionForTheTest (); // Called each time an action is executed
|
||||
void m_fn_vTestRightButtonDoubleClicAndPosition ();
|
||||
BOOL m_fn_vPreprocessString (char * & _szString);
|
||||
char * m_fn_szStrtok (char * _szString , char _cDelimiter);
|
||||
int m_fn_iGetParameters (char * , int _iMinNumberOfParameter , int _iMaxNumberOfParameter ,
|
||||
int * _p_iNumberOfParameter , ...);
|
||||
void m_fn_vShowError (int _iErrorCode , const CString _csFileName , int _iLineNumber , char * _szLine);
|
||||
void m_fn_vPumpMessage ();
|
||||
void m_fn_vSleep (int _iDuration);
|
||||
void m_fn_vActivateWindow (HWND _hWnd);
|
||||
HWND m_fn_hOpenUserWindow (char * _szWindowName , int _iLeft , int _iTop , int _iRight , int _iBottom);
|
||||
void m_fn_vCloseUserWindow (int _iIndex);
|
||||
void m_fn_vDeleteLocalLabelAndVariable ();
|
||||
void m_fn_vCloseLogFile (TUT_tdstLogFileDefinition * _p_stLogFile);
|
||||
|
||||
public:
|
||||
// These functions must be public because they are called by the TUT_fn_dwBeginThread function
|
||||
void m_fn_vClearAllList (BOOL _bUnregisterControl);
|
||||
void m_fn_vCloseAllUserWindow ();
|
||||
void m_fn_vCloseAllLogFiles ();
|
||||
// This function must be public because it is called by the callback timer function
|
||||
TUT_tdstVariableDefinition * m_fnp_stFindVariable (char * _szName); // Search a variable name into the list
|
||||
char * m_fn_szGetWndNameType (TUT_tdeWndType _eType);
|
||||
HWND m_fn_hGetDebugWindowHandle() { return m_hDebugWnd; }
|
||||
|
||||
private:
|
||||
TUT_tdstVariableDefinition * m_fnp_stFindOrCreateVariable (char * _szName);
|
||||
BOOL m_fn_bFindColor (char * _szColorName , COLORREF * _p_xColor);
|
||||
int m_fn_iFindVirtualKeyCode (char * _szVirtualKeyCode);
|
||||
int m_fn_iFindIdForMessageBox (char * _szControlName);
|
||||
|
||||
void m_fn_vMoveMouseCursor (CPoint _stDestination , HWND _hWnd = NULL);
|
||||
void m_fn_vMoveMouseCursor (HWND _hWnd);
|
||||
|
||||
void m_fn_vClickOnControl (HWND _hButton); // Simulate a click on a button
|
||||
void m_fn_vSetTextInEdit (HWND _hTextEdit , const CString); // Simulate an edition of text,
|
||||
void m_fn_vSelectLineInComboBox (HWND _hComboBox , int _iLineNumber);
|
||||
void m_fn_vSelectLineInListBox (HWND _hListBox , int _iLineNumber , BOOL _bAddToSelection = FALSE );
|
||||
void m_fn_vSelectLineInListCtrl (HWND _hListCtrl , int _iLineNumber);
|
||||
void m_fn_vEnsureVisibleInTree (HWND _hTreeCtrl , HTREEITEM _hItem ,
|
||||
BOOL _bEnsureVisible = TRUE);
|
||||
BOOL m_fn_bSelectItemInTreeBox (HWND _hTreeCtrl , CString _csTextToSelect);
|
||||
void m_fn_vWriteText (HWND _hEditView , CString _csText);
|
||||
void m_fn_vSendKey (int _iVirtualKeyCode , BOOL _bKeyPressed);
|
||||
char *m_fn_szHandleQuote (char * _szString);
|
||||
|
||||
////////////////////////
|
||||
BOOL m_fn_bStartStopHook (HMODULE _hModule, DWORD _dThreadID, BOOL _bStart);
|
||||
BOOL m_fn_bCommandMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bLButtonMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bRButtonMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bFocusMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bNotifyMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bMenuMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bMouseMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
// Record List
|
||||
void m_fn_vHandlePause (void);
|
||||
void m_fn_vAddCommand (CString csCommand);
|
||||
void m_fn_vInsertAfterPause (CString csCommand);
|
||||
void m_fn_vAddPause (void);
|
||||
void m_fn_vRemoveToPause (void);
|
||||
BOOL m_fn_bHaveSomethingAfterPause (void);
|
||||
void m_fn_vDeleteLastCommand (void);
|
||||
// 3DView specific
|
||||
BOOL m_fn_bIsModelView (HWND _hWnd);
|
||||
BOOL m_fn_bLButtonUp3DViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bLButtonDown3DViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bLButtonUpModelViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
BOOL m_fn_bLButtonDownModelViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern TUT_CTutorialManager TUT_g_oTutorialManager;
|
||||
|
||||
#endif // #ifndef _TUT_MNGR_HPP_
|
95
Rayman_X/cpa/tempgrp/Tut/TutLib/Make/TutLib.dsp
Normal file
95
Rayman_X/cpa/tempgrp/Tut/TutLib/Make/TutLib.dsp
Normal file
@@ -0,0 +1,95 @@
|
||||
# Microsoft Developer Studio Project File - Name="TutLib" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=TutLib - Win32 Debug Glide with Editors
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TutLib.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TutLib.mak" CFG="TutLib - Win32 Debug Glide with Editors"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "TutLib - Win32 Debug Glide with Editors" (based on\
|
||||
"Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""$/CPA/TempGrp/Tut/TutLib/Make", NKKAAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
# PROP BASE Use_MFC 2
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Deubg"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 2
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x:\cpa\lib"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\inc" /I "..\..\..\public" /I "..\..\..\..\cpa\public" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_DM_MfcApp_" /D "CPA_WANTS_EXPORT" /D "_AFXDLL" /D "_____ACTIVE_EDITOR" /D "_____TUT_3D" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\inc" /I "..\..\..\public" /I "\cpa\public" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_DM_MfcApp_" /D "CPA_WANTS_IMPORT" /D "_AFXDLL" /D "ACTIVE_EDITOR" /D "TUT_3D" /D "USE_ALTIMAPS" /FR /YX /FD /c
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"..\lib\Tut_d.lib"
|
||||
# ADD LIB32 /nologo /out:"x:\cpa\lib\Tut_d.lib"
|
||||
# Begin Target
|
||||
|
||||
# Name "TutLib - Win32 Debug Glide with Editors"
|
||||
# Begin Group "Src"
|
||||
|
||||
# PROP Default_Filter "c*"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\Tut_3d.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\Tut_Mngr.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\Tut_Mngr.cxx
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Src\Tut_Mngr.inc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Inc"
|
||||
|
||||
# PROP Default_Filter "h*"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Inc\StdAfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Inc\Tut_Mngr.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Doc"
|
||||
|
||||
# PROP Default_Filter "*.doc;*.txt;*.xls"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\Doc\Pr<50>sentation du tutorial.doc"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TutLib.mak
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
135
Rayman_X/cpa/tempgrp/Tut/TutLib/Make/TutLib.vcproj
Normal file
135
Rayman_X/cpa/tempgrp/Tut/TutLib/Make/TutLib.vcproj
Normal file
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="TutLib"
|
||||
ProjectGUID="{7B87BF0D-3EF0-4C6F-B75A-637676F33403}"
|
||||
SccProjectName=""$/CPA/TempGrp/Tut/TutLib/Make", NKKAAAAA"
|
||||
SccLocalPath="."
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug Glide with Editors|Win32"
|
||||
OutputDirectory="x:\cpa\lib"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\inc,..\..\..\public,\cpa\public"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_DM_MfcApp_;CPA_WANTS_IMPORT;ACTIVE_EDITOR;TUT_3D;USE_ALTIMAPS"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/TutLib.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="x:\cpa\libd\Tut_d.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Src"
|
||||
Filter="c*">
|
||||
<File
|
||||
RelativePath="..\Src\Tut_3d.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Src\Tut_Mngr.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Src\Tut_Mngr.cxx">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Src\Tut_Mngr.inc">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Inc"
|
||||
Filter="h*">
|
||||
<File
|
||||
RelativePath="..\Inc\StdAfx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Inc\Tut_Mngr.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Doc"
|
||||
Filter="*.doc;*.txt;*.xls">
|
||||
<File
|
||||
RelativePath="..\Doc\Pr<50>sentation du tutorial.doc">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="TutLib.mak">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
5
Rayman_X/cpa/tempgrp/Tut/TutLib/Make/mssccprj.scc
Normal file
5
Rayman_X/cpa/tempgrp/Tut/TutLib/Make/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a source code control file
|
||||
|
||||
[TutLib.vcproj]
|
||||
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
|
||||
SCC_Project_Name = Perforce Project
|
918
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_3d.cpp
Normal file
918
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_3d.cpp
Normal file
@@ -0,0 +1,918 @@
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* Tut_3d.cpp : definition of the TUT_CTutorialManager class *
|
||||
* *
|
||||
* Contains the methods of the class that are specific to the 3d view *
|
||||
* So it is dependant on the ACP. *
|
||||
* The symbol TUT_3D must be defined for this file to be compiled *
|
||||
* *
|
||||
* Author : Alexis Vaisse *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef TUT_3D
|
||||
#include "stdafx.h"
|
||||
#include "Tut_Mngr.hpp"
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetPosition (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dClic3dView (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dIsProtected (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dMove3d (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dSelectModel (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetModel (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetNumberOfModels (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dIsAvailable (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetPrefix (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dIsExistingModel (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetStatusBarText (char *) { return TUT_C_iError_FunctionNotCompiled; }
|
||||
// 3DView specific
|
||||
BOOL TUT_CTutorialManager::m_fn_bIsModelView (HWND _hWnd) { return FALSE; }
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonDown3DViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { return FALSE;}
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonUp3DViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { return FALSE;}
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonDownModelViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { return FALSE;}
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonUpModelViewProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { return FALSE;}
|
||||
#else
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ACP_Base.h"
|
||||
#include "ITF.h"
|
||||
#include "OGD.h"
|
||||
#include "IncOPD.h"
|
||||
#include "\CPA\Main\inc\_EditID.h"
|
||||
#include "Tut_Mngr.hpp"
|
||||
|
||||
#define TUT_M_GetCurrentWorld() (M_GetMainApp () -> fn_p_oGetMainWorld () -> M_GetWorld ())
|
||||
#define TUT_M_GetCurrentViewPort() ((DEV_ViewPort3D *) (DEV_ViewPort *) M_GetMainDevice2 () -> GetDevice (M_GetMainDevice2 () -> GetFocusDevice () -> GetNumber()) -> GetViewPort())
|
||||
#define TUT_M_GetCurrentEditor() (M_GetMainApp () -> fn_p_oGetMainWorld () -> GetCurrentEditor ())
|
||||
|
||||
MTH3D_tdstVector g_stInitialPoint;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fnp_oFindSuperObjectByName
|
||||
// Find a super objet which has an associated object of the given name
|
||||
// Return NULL if not found
|
||||
//-----------------------------------------------------------------------------
|
||||
CPA_SuperObject * fnp_oFindSuperObjectByName (char * _sz3dObjectName)
|
||||
{
|
||||
CPA_List<CPA_SuperObject> * pListOfSuperObject = TUT_M_GetCurrentWorld () -> GetListAllObjects ();
|
||||
ASSERT (pListOfSuperObject);
|
||||
|
||||
POSITION Pos = pListOfSuperObject -> GetHeadPosition ();
|
||||
while (Pos)
|
||||
{
|
||||
CPA_SuperObject * pSuperObject = (CPA_SuperObject *) pListOfSuperObject -> GetNext (Pos);
|
||||
CPA_BaseObject * pObject = pSuperObject -> GetObject ();
|
||||
|
||||
if (pObject && stricmp (pObject -> fn_p_szGetName () , _sz3dObjectName) == 0) return pSuperObject;
|
||||
}
|
||||
|
||||
return NULL; // Not found
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// fnp_oFindSuperObjectByHandle
|
||||
// Find a super objet which has an associated object of the given engine handle
|
||||
// Return NULL if not found
|
||||
//-----------------------------------------------------------------------------
|
||||
CPA_SuperObject * fnp_oFindSuperObjectByHandle (HIE_tdxHandleToSuperObject _hSupObject)
|
||||
{
|
||||
CPA_List<CPA_SuperObject> * pListOfSuperObject = TUT_M_GetCurrentWorld () -> GetListAllObjects ();
|
||||
ASSERT (pListOfSuperObject);
|
||||
|
||||
POSITION Pos = pListOfSuperObject -> GetHeadPosition ();
|
||||
while (Pos)
|
||||
{
|
||||
CPA_SuperObject * pSuperObject = (CPA_SuperObject *) pListOfSuperObject -> GetNext (Pos);
|
||||
|
||||
if (pSuperObject -> GetData () == (void*)_hSupObject) return pSuperObject;
|
||||
}
|
||||
|
||||
return NULL; // Not found
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// fn_bGetPointOfSuperObject
|
||||
// Compute the coordinate of one point of the given super object
|
||||
// (hope we will select the object when clicking on this point)
|
||||
// Return FALSE if it cannot find one point
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL fn_bGetPointOfSuperObject (CPA_SuperObject * _pSuperObject , MTH3D_tdstVector * _p_stPosition)
|
||||
{
|
||||
POS_tdstCompletePosition * pGlobalMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (_pSuperObject -> GetStruct ());
|
||||
POS_fn_vGetTranslationVector (pGlobalMatrix , _p_stPosition); // Compute origine point in world coordinates
|
||||
|
||||
// Geometric object : we can found one point
|
||||
CPA_BaseObject * pObject = _pSuperObject -> GetObject ();
|
||||
if (pObject && (pObject -> fn_bIsOfType (C_szGeometricObjectTypeName) ||
|
||||
pObject -> fn_bIsOfType (C_szPhysicalObjectTypeName)))
|
||||
{
|
||||
ACP_tdxHandleOfObject hObject;
|
||||
if (pObject -> fn_bIsOfType (C_szGeometricObjectTypeName))
|
||||
hObject = (ACP_tdxHandleOfObject) pObject -> GetData ();
|
||||
else
|
||||
if (pObject -> fn_bIsOfType (C_szPhysicalObjectTypeName ))
|
||||
hObject = (ACP_tdxHandleOfObject) ((EditorPO *) pObject) -> m_fnp_oGetGeometricWithDistance (0.0) -> GetData ();
|
||||
else ASSERT (0);
|
||||
|
||||
if (GEO_xGetGeometricObjectNumberOfPoints (hObject) > 0)
|
||||
{
|
||||
// Compute barycenter
|
||||
MTH3D_tdstVector Total;
|
||||
MTH3D_M_vNullVector (& Total);
|
||||
for (ACP_tdxIndex xNumPoint = 0 ; xNumPoint < GEO_xGetGeometricObjectNumberOfPoints (hObject) ; xNumPoint++)
|
||||
{
|
||||
MTH3D_tdstVector Point;
|
||||
GEO_vGetPointOfObject (hObject , & Point, xNumPoint);
|
||||
MTH3D_M_vAddVector (& Total , & Total , & Point);
|
||||
}
|
||||
MTH3D_M_vDivScalarVector (& Total , & Total , GEO_xGetGeometricObjectNumberOfPoints (hObject));
|
||||
|
||||
POS_fn_vMulMatrixVertex(_p_stPosition , pGlobalMatrix , & Total); // Convert in world coordinates
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
CPA_SuperObject * pChildSuperObject = _pSuperObject -> GetSuperObjectFirstChild ();
|
||||
while (pChildSuperObject)
|
||||
{
|
||||
if (fn_bGetPointOfSuperObject (pChildSuperObject , _p_stPosition)) return TRUE;
|
||||
pChildSuperObject = _pSuperObject -> GetSuperObjectNextChild (pChildSuperObject);
|
||||
}
|
||||
|
||||
return FALSE; // Not found
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// gs_fn_p_oGetModelView
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
//-----------------------------------------------------------------------------
|
||||
C3ListView *gs_fn_p_oGetModelView()
|
||||
{
|
||||
C3ListView *p_oListView = NULL;
|
||||
CPA_EditorBase *p_oCurrentEditor = TUT_M_GetCurrentEditor ();
|
||||
|
||||
if( p_oCurrentEditor && p_oCurrentEditor -> GetCurrentEditorName() == C_szDLLMaterialName )
|
||||
{
|
||||
CSplitFrame * p_oBottomFrame = (CSplitFrame*)g_oFrameGest . ma_p_oWinArray [2] [3];
|
||||
ASSERT (p_oBottomFrame);
|
||||
p_oListView = (C3ListView*)p_oBottomFrame -> m_fn_p_oGetPane (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the model view
|
||||
FRMBase * p_oModelFrame = g_oFrameGest . ma_p_oWinArray [2] [3];
|
||||
ASSERT (p_oModelFrame);
|
||||
CPA_DialogInsert * p_oModelWnd = (CPA_DialogInsert *) p_oModelFrame -> GetWindow (GW_CHILD);
|
||||
ASSERT (p_oModelWnd);
|
||||
EDT_ModelView * p_oModelView = p_oModelWnd -> GetModelView ();
|
||||
ASSERT (p_oModelView);
|
||||
p_oListView = (C3ListView*) p_oModelView;
|
||||
}
|
||||
return p_oListView;
|
||||
}
|
||||
|
||||
CStatusBar *gs_fn_p_oGetStatusBar()
|
||||
{
|
||||
FRMBaseMenu *p_FRMBaseMenu = M_GetMainWnd2();
|
||||
|
||||
if( p_FRMBaseMenu )
|
||||
return & p_FRMBaseMenu -> m_oStatusBar;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dGetPosition
|
||||
// Execute a "get position" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetPosition (char * _szParameter)
|
||||
{
|
||||
// Get parameters : 3d object name and variable name for X, variable name for Y, variable name for Z
|
||||
int iNumberOfParameter;
|
||||
char * sz3dObjectName , * szVariableNameForX , * szVariableNameForY , * szVariableNameForZ;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 4 , 4 , & iNumberOfParameter , & sz3dObjectName ,
|
||||
& szVariableNameForX , & szVariableNameForY , & szVariableNameForZ);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
// Search the super object
|
||||
CPA_SuperObject * pSuperObject = fnp_oFindSuperObjectByName (sz3dObjectName);
|
||||
if (! pSuperObject) return TUT_C_iError_Unknown3dObject;
|
||||
|
||||
// Find the three variables
|
||||
TUT_tdstVariableDefinition * p_stVariableForX = m_fnp_stFindVariable (szVariableNameForX);
|
||||
TUT_tdstVariableDefinition * p_stVariableForY = m_fnp_stFindVariable (szVariableNameForY);
|
||||
TUT_tdstVariableDefinition * p_stVariableForZ = m_fnp_stFindVariable (szVariableNameForZ);
|
||||
if (p_stVariableForX == NULL || p_stVariableForY == NULL || p_stVariableForZ == NULL)
|
||||
return TUT_C_iError_UnknownVariable;
|
||||
|
||||
MTH3D_tdstVector stTranslationVector;
|
||||
fn_bGetPointOfSuperObject (pSuperObject , & stTranslationVector);
|
||||
|
||||
p_stVariableForX -> csValue . Format ("%.6g" , stTranslationVector . xX);
|
||||
p_stVariableForY -> csValue . Format ("%.6g" , stTranslationVector . xY);
|
||||
p_stVariableForZ -> csValue . Format ("%.6g" , stTranslationVector . xZ);
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dClic3dView
|
||||
// Execute a "clic 3d view" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dClic3dView (char * _szParameter)
|
||||
{
|
||||
// Get parameter : 3d object name or three coordinates
|
||||
int iNumberOfParameter;
|
||||
char * szParameter1 , * szParameter2 , * szParameter3;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 1 , 3 , & iNumberOfParameter ,
|
||||
& szParameter1 , & szParameter2 , & szParameter3);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
if (iNumberOfParameter == 2) return TUT_C_iError_ParameterRequired; // Only 1 or 3 parameters
|
||||
|
||||
MTH3D_tdstVector stTranslationVector;
|
||||
CPA_SuperObject * pSuperObject = NULL;
|
||||
double dX , dY , dZ;
|
||||
dX = dY = dZ = 0.0;
|
||||
|
||||
if (iNumberOfParameter == 1) // One parameter : this is the name of the 3d object
|
||||
{
|
||||
// Get the super object
|
||||
pSuperObject = fnp_oFindSuperObjectByName (szParameter1);
|
||||
if (! pSuperObject) return TUT_C_iError_Unknown3dObject;
|
||||
|
||||
// Get the position of the super object
|
||||
fn_bGetPointOfSuperObject (pSuperObject , & stTranslationVector);
|
||||
}
|
||||
else // Three parameters : this is the three coordinates
|
||||
{
|
||||
dX = m_fn_dConvertToDouble (szParameter1);
|
||||
dY = m_fn_dConvertToDouble (szParameter2);
|
||||
dZ = m_fn_dConvertToDouble (szParameter3);
|
||||
|
||||
if (dX == TUT_C_dErrorNotANumber || dY == TUT_C_dErrorNotANumber || dZ == TUT_C_dErrorNotANumber)
|
||||
return TUT_C_iError_InvalidNumber;
|
||||
|
||||
MTH3D_M_vSetVectorElements (& stTranslationVector , MTH_M_xDoubleToReal (dX) , MTH_M_xDoubleToReal (dY) , MTH_M_xDoubleToReal (dZ));
|
||||
}
|
||||
|
||||
// Convert this 3D position into a 2D position
|
||||
GLI_tdst2DVertex st2DPosition;
|
||||
DEV_ViewPort3D * pViewport3d = TUT_M_GetCurrentViewPort ();
|
||||
pViewport3d -> Convert3dTo2d (& st2DPosition , & stTranslationVector);
|
||||
CPoint Pos;
|
||||
Pos . x = (long) st2DPosition . xX;
|
||||
Pos . y = (long) st2DPosition . xY;
|
||||
if (GLI_lWhatIsGLI () == GLI_C_VersionGlide) pViewport3d -> VoodooToClient (Pos);
|
||||
|
||||
// Check if this 2D position is inside the 3D view
|
||||
CRect stViewport3dRect;
|
||||
pViewport3d -> GetClientRect (& stViewport3dRect);
|
||||
if (! stViewport3dRect . PtInRect (Pos))
|
||||
{
|
||||
// If not, zoom the camera to the object or the point and refresh the display
|
||||
if (iNumberOfParameter == 1)
|
||||
{
|
||||
pViewport3d -> GetCameraInterface () -> ZoomOnTarget (pViewport3d -> GetCamera () , pSuperObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
CPA_CameraCoords oCameraCoords (WorldCoordinates , (float) dX , (float) dY , (float) dZ);
|
||||
pViewport3d -> GetCameraInterface () -> SetTargetPoint (pViewport3d -> GetCamera () , & oCameraCoords);
|
||||
pViewport3d -> GetCameraInterface () -> SetTargetType (pViewport3d -> GetCamera () , tPoint);
|
||||
pViewport3d -> GetCameraInterface () -> Update (pViewport3d -> GetCamera ());
|
||||
pViewport3d -> GetCameraInterface () -> SetTargetType (pViewport3d -> GetCamera () , tNone);
|
||||
}
|
||||
pViewport3d -> GetCameraInterface () -> GetInterface () -> fn_vUpdateAll (E_mc_JustDraw);
|
||||
|
||||
// And compute the new 3D position
|
||||
pViewport3d -> Convert3dTo2d (& st2DPosition , & stTranslationVector);
|
||||
Pos . x = (long) st2DPosition . xX;
|
||||
Pos . y = (long) st2DPosition . xY;
|
||||
if (GLI_lWhatIsGLI () == GLI_C_VersionGlide) pViewport3d -> VoodooToClient (Pos);
|
||||
}
|
||||
|
||||
CPoint ScreenPos = Pos;
|
||||
pViewport3d -> ClientToScreen (& ScreenPos);
|
||||
m_fn_vMoveMouseCursor (ScreenPos , pViewport3d -> m_hWnd);
|
||||
|
||||
LPARAM lParam = MAKELPARAM (Pos . x , Pos . y);
|
||||
WPARAM wParam = (m_bUseShift ? MK_SHIFT : 0) | (m_bUseControl ? MK_CONTROL : 0);
|
||||
|
||||
if (m_bUseDrop)
|
||||
{
|
||||
//Sleep (0); // To be sure the last OnMouseMove message has been treated when making a drag and drop
|
||||
//m_fn_vSleep(10);
|
||||
Sleep(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_bUseRightButton) pViewport3d -> PostMessage (WM_RBUTTONDOWN , wParam + MK_RBUTTON , lParam);
|
||||
else pViewport3d -> PostMessage (WM_LBUTTONDOWN , wParam + MK_LBUTTON , lParam);
|
||||
m_fn_vSleep (60);
|
||||
}
|
||||
|
||||
if (m_bUseRightButton) pViewport3d -> PostMessage (WM_RBUTTONUP , wParam , lParam);
|
||||
else pViewport3d -> PostMessage (WM_LBUTTONUP , wParam , lParam);
|
||||
m_fn_vSleep (60);
|
||||
|
||||
if (m_bUseDoubleClic)
|
||||
{
|
||||
if (m_bUseRightButton)
|
||||
{
|
||||
pViewport3d -> PostMessage (WM_RBUTTONDBLCLK , wParam + MK_RBUTTON , lParam);
|
||||
m_fn_vSleep (60);
|
||||
pViewport3d -> PostMessage (WM_RBUTTONUP , wParam , lParam);
|
||||
m_fn_vSleep (60);
|
||||
}
|
||||
else
|
||||
{
|
||||
pViewport3d -> PostMessage (WM_LBUTTONDBLCLK , wParam + MK_LBUTTON , lParam);
|
||||
m_fn_vSleep (60);
|
||||
pViewport3d -> PostMessage (WM_LBUTTONUP , wParam , lParam);
|
||||
m_fn_vSleep (60);
|
||||
}
|
||||
}
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dIsProtected
|
||||
// Execute a "is protected" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dIsProtected (char * _szParameter)
|
||||
{
|
||||
// Get parameters : 3d object name and variable name
|
||||
int iNumberOfParameter;
|
||||
char * sz3dObjectName , * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 2 , 2 , & iNumberOfParameter , & sz3dObjectName , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
// Search the super object
|
||||
CPA_SuperObject * pSuperObject = fnp_oFindSuperObjectByName (sz3dObjectName);
|
||||
if (! pSuperObject) return TUT_C_iError_Unknown3dObject;
|
||||
|
||||
// Find the variable
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
p_stVariableDef -> csValue = pSuperObject -> fn_bIsEditProtected () ? TUT_C_szTrue : TUT_C_szFalse;
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dMove3d
|
||||
// Execute a "move 3D" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dMove3d (char * _szParameter)
|
||||
{
|
||||
// Get parameters : 3d object name, (X,Y) translation coordinates
|
||||
int iNumberOfParameter;
|
||||
char * sz3dObjectName , * szDeltaX , * szDeltaY;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 3 , 3 , & iNumberOfParameter , & sz3dObjectName ,
|
||||
& szDeltaX , & szDeltaY);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
// Search the super object
|
||||
CPA_SuperObject * pSuperObject = fnp_oFindSuperObjectByName (sz3dObjectName);
|
||||
if (! pSuperObject) return TUT_C_iError_Unknown3dObject;
|
||||
|
||||
// Get the coordinates
|
||||
double dDeltaX = m_fn_dConvertToDouble (szDeltaX);
|
||||
double dDeltaY = m_fn_dConvertToDouble (szDeltaY);
|
||||
if (dDeltaX == TUT_C_dErrorNotANumber || dDeltaY == TUT_C_dErrorNotANumber) return TUT_C_iError_InvalidNumber;
|
||||
|
||||
// Get the position of the super object
|
||||
MTH3D_tdstVector stTranslationVector;
|
||||
fn_bGetPointOfSuperObject (pSuperObject , & stTranslationVector);
|
||||
|
||||
// Convert this 3D position into a 2D position
|
||||
GLI_tdst2DVertex st2DPosition;
|
||||
DEV_ViewPort3D * pViewport3d = TUT_M_GetCurrentViewPort ();
|
||||
pViewport3d -> Convert3dTo2d (& st2DPosition , & stTranslationVector);
|
||||
CPoint Pos;
|
||||
|
||||
Pos . x = (long) st2DPosition . xX;
|
||||
Pos . y = (long) st2DPosition . xY;
|
||||
if (GLI_lWhatIsGLI () == GLI_C_VersionGlide) pViewport3d -> VoodooToClient (Pos);
|
||||
|
||||
// Send a LBUTTONDOWN message
|
||||
WPARAM wParam = (m_bUseShift ? MK_SHIFT : 0) | (m_bUseControl ? MK_CONTROL : 0);
|
||||
CPoint ScreenPos = Pos;
|
||||
pViewport3d -> ClientToScreen (& ScreenPos);
|
||||
m_fn_vMoveMouseCursor (ScreenPos , pViewport3d -> m_hWnd);
|
||||
pViewport3d -> SendMessage (WM_LBUTTONDOWN , wParam + MK_LBUTTON , MAKELPARAM (Pos . x , Pos . y));
|
||||
|
||||
// Compute the final position
|
||||
CPA_SuperObject * pCameraSuperObject = pViewport3d -> GetCameraSO ();
|
||||
POS_tdxHandleToPosition hGlobalMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (pCameraSuperObject -> GetStruct ());
|
||||
MTH3D_tdstVector stVectorX , stVectorY , stVectorZ;
|
||||
POS_fn_vGetRotationMatrix (hGlobalMatrix , & stVectorX , & stVectorY , & stVectorZ);
|
||||
|
||||
MTH3D_M_vMulScalarVector (& stVectorX , MTH_M_xDoubleToReal (- dDeltaX) , & stVectorX);
|
||||
MTH3D_M_vMulScalarVector (& stVectorY , MTH_M_xDoubleToReal (- dDeltaY) , & stVectorY);
|
||||
|
||||
MTH3D_tdstVector stDelta;
|
||||
MTH3D_M_vAddVector (& stDelta , & stVectorX , & stVectorY);
|
||||
MTH3D_M_vAddVector (& stTranslationVector , & stDelta , & stTranslationVector);
|
||||
|
||||
// Compute the final 3D position into a 2D position
|
||||
pViewport3d -> Convert3dTo2d (& st2DPosition , & stTranslationVector);
|
||||
Pos . x = (long) st2DPosition . xX;
|
||||
Pos . y = (long) st2DPosition . xY;
|
||||
if (GLI_lWhatIsGLI () == GLI_C_VersionGlide) pViewport3d -> VoodooToClient (Pos);
|
||||
|
||||
// Send a LBUTTONUP message
|
||||
ScreenPos = Pos;
|
||||
pViewport3d -> ClientToScreen (& ScreenPos);
|
||||
m_fn_vMoveMouseCursor (ScreenPos , pViewport3d -> m_hWnd);
|
||||
pViewport3d -> SendMessage (WM_LBUTTONUP , wParam , MAKELPARAM (Pos . x , Pos . y));
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dSelectModel
|
||||
// Execute a "select model" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dSelectModel (char * _szParameter)
|
||||
{
|
||||
// Get parameter : model name
|
||||
int iNumberOfParameter;
|
||||
char * szModelName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 1 , 1 , & iNumberOfParameter , & szModelName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
C3ListView *p_oListView = gs_fn_p_oGetModelView ();
|
||||
ASSERT( p_oListView );
|
||||
|
||||
// Find the model into the view
|
||||
long lIndex = p_oListView -> m_fn_lFindName (-1 , szModelName , p_oListView -> m_fn_cGetOrder ());
|
||||
if (lIndex == TSL_cItemNotFound) return TUT_C_iError_ModelNotFound;
|
||||
|
||||
// To be sure the model will be visible
|
||||
p_oListView -> m_vScrollToMakeItemVisible ((short) lIndex);
|
||||
|
||||
// Get the position of the model
|
||||
CRect stRect;
|
||||
p_oListView -> m_fn_vGetCaseRect ((short) lIndex , & stRect);
|
||||
POINT stCenter = stRect . CenterPoint ();
|
||||
|
||||
// Move the mouse cursor to the model
|
||||
p_oListView -> ClientToScreen (& stRect);
|
||||
m_fn_vMoveMouseCursor (stRect . CenterPoint ());
|
||||
|
||||
WPARAM wParam = (m_bUseShift ? MK_SHIFT : 0) | (m_bUseControl ? MK_CONTROL : 0);
|
||||
// Clic to select the model
|
||||
PostMessage (p_oListView -> m_hWnd , WM_LBUTTONDOWN , wParam + MK_LBUTTON , MAKELPARAM (stCenter . x , stCenter . y));
|
||||
// Release the button if this is not a drag & drop
|
||||
if (! m_bUseDrag)
|
||||
PostMessage (p_oListView -> m_hWnd , WM_LBUTTONUP , wParam , MAKELPARAM (stCenter . x , stCenter . y));
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dGetModel
|
||||
// Execute a "get model" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetModel (char * _szParameter)
|
||||
{
|
||||
// Get parameter : variable name
|
||||
int iNumberOfParameter;
|
||||
char * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 1 , 1 , & iNumberOfParameter , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
C3ListView *p_oListView = gs_fn_p_oGetModelView ();
|
||||
ASSERT( p_oListView );
|
||||
|
||||
// Find the variable
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
// Get the selected item
|
||||
long lIndex = p_oListView -> m_fn_lGetSelectedItem (p_oListView -> m_fn_cGetOrder ());
|
||||
|
||||
// Get the name of the item and fill the variable
|
||||
if (lIndex == TSL_cItemNotFound) p_stVariableDef -> csValue = "";
|
||||
else p_stVariableDef -> csValue = p_oListView -> m_fn_csGetName (lIndex , p_oListView -> m_fn_cGetOrder ());
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dGetNumberOfModels
|
||||
// Execute a "get number of models" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetNumberOfModels (char * _szParameter)
|
||||
{
|
||||
// Get parameter : variable name
|
||||
int iNumberOfParameter;
|
||||
char * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 1 , 1 , & iNumberOfParameter , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
C3ListView *p_oListView = gs_fn_p_oGetModelView ();
|
||||
ASSERT( p_oListView );
|
||||
|
||||
// Get the number of models
|
||||
long lNumberOfModel = p_oListView -> m_fn_lGetCount ();
|
||||
|
||||
// Find the variable and fill it
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
m_fn_vSetValueToVariable (p_stVariableDef , lNumberOfModel);
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dIsAvailable
|
||||
// Execute a "is available" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dIsAvailable (char * _szParameter)
|
||||
{
|
||||
// Get parameters : object name, type name and variable name
|
||||
int iNumberOfParameter;
|
||||
char * szObjectName , * szTypeName , * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 3 , 3 , & iNumberOfParameter ,
|
||||
& szObjectName , & szTypeName , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
CPA_BaseObject * pObject = M_GetMainApp () -> fn_p_oGetMainWorld () ->
|
||||
fn_p_oFindObject (szObjectName , szTypeName , NO_CRITERIA , E_rc_AllObjects);
|
||||
if (! pObject) return TUT_C_iError_UnknownObject;
|
||||
|
||||
p_stVariableDef -> csValue = pObject -> fn_bIsAvailable () ? TUT_C_szTrue : TUT_C_szFalse;
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dGetPrefix
|
||||
// Execute a "get prefix" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetPrefix (char * _szParameter)
|
||||
{
|
||||
// Get parameters : variable name
|
||||
int iNumberOfParameter;
|
||||
char * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 1 , 1 , & iNumberOfParameter , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
p_stVariableDef -> csValue = M_GetMainApp () -> GetInterface () -> GetUserPrefix ();
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dIsExistingModel
|
||||
// Execute a "Is Existing Model" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dIsExistingModel (char * _szParameter)
|
||||
{
|
||||
// Get parameters : variable name
|
||||
int iNumberOfParameter;
|
||||
char * szModelName , * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 2 , 2 , & iNumberOfParameter , & szModelName , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
C3ListView *p_oListView = gs_fn_p_oGetModelView ();
|
||||
ASSERT( p_oListView );
|
||||
|
||||
// Find the model into the view
|
||||
long lIndex = p_oListView -> m_fn_lFindName (-1 , szModelName , p_oListView -> m_fn_cGetOrder ());
|
||||
p_stVariableDef -> csValue = lIndex == TSL_cItemNotFound ? TUT_C_szFalse : TUT_C_szTrue;
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_iExecute3dGetStatusBarText
|
||||
// Execute a "Is Existing Model" tutorial script action
|
||||
// Return 0 if no error
|
||||
//-----------------------------------------------------------------------------
|
||||
int TUT_CTutorialManager::m_fn_iExecute3dGetStatusBarText (char * _szParameter)
|
||||
{
|
||||
// Get parameters : variable name
|
||||
int iNumberOfParameter;
|
||||
char * szPaneNumber , * szVariableName;
|
||||
|
||||
int iReturnValue = m_fn_iGetParameters (_szParameter , 2 , 2 , & iNumberOfParameter , & szPaneNumber , & szVariableName);
|
||||
if (iReturnValue != TUT_C_iNoError) return iReturnValue;
|
||||
|
||||
TUT_tdstVariableDefinition * p_stVariableDef = m_fnp_stFindVariable (szVariableName);
|
||||
if (p_stVariableDef == NULL) return TUT_C_iError_UnknownVariable;
|
||||
|
||||
CStatusBar *p_oStatusBar = gs_fn_p_oGetStatusBar ();
|
||||
ASSERT( p_oStatusBar );
|
||||
|
||||
CStatusBarCtrl &rStat = p_oStatusBar -> GetStatusBarCtrl ();
|
||||
|
||||
char szText[512];
|
||||
int iPane = m_fn_iConvertToInt (szPaneNumber);
|
||||
int iType;
|
||||
|
||||
rStat . GetText (szText , iPane , &iType);
|
||||
p_stVariableDef -> csValue = szText;
|
||||
|
||||
return TUT_C_iNoError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_bIsModelView
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bIsModelView (HWND _hWnd)
|
||||
{
|
||||
C3ListView *p_oListView = NULL;
|
||||
CPA_EditorBase *p_oCurrentEditor = TUT_M_GetCurrentEditor ();
|
||||
|
||||
if( p_oCurrentEditor && p_oCurrentEditor -> GetCurrentEditorName() == C_szDLLMaterialName )
|
||||
{
|
||||
CSplitFrame * p_oBottomFrame = (CSplitFrame*)g_oFrameGest . ma_p_oWinArray [2] [3];
|
||||
if (p_oBottomFrame)
|
||||
{
|
||||
p_oListView = (C3ListView*)p_oBottomFrame -> m_fn_p_oGetPane (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the model view
|
||||
FRMBase * p_oModelFrame = g_oFrameGest . ma_p_oWinArray [2] [3];
|
||||
if (p_oModelFrame)
|
||||
{
|
||||
CPA_DialogInsert * p_oModelWnd = (CPA_DialogInsert *) p_oModelFrame -> GetWindow (GW_CHILD);
|
||||
if (p_oModelWnd)
|
||||
{
|
||||
EDT_ModelView * p_oModelView = p_oModelWnd -> GetModelView ();
|
||||
if (p_oModelView)
|
||||
p_oListView = (C3ListView*) p_oModelView;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (p_oListView && p_oListView -> m_hWnd == _hWnd);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_bLButtonDown3DViewProc
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonDown3DViewProc(int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
CString csText;
|
||||
CPoint oPoint(LOWORD(lParam),HIWORD(lParam));
|
||||
DEV_ViewPort3D * pViewport3d = TUT_M_GetCurrentViewPort ();
|
||||
tdstMousePos stMousePos;
|
||||
HIE_tdxHandleToSuperObject hSupObject;
|
||||
HIE_aDEF_stTabOfPickInfo a_stPickInfo;
|
||||
ACP_tdxIndex xNbPicked;
|
||||
|
||||
pViewport3d -> PointToMousePos (oPoint, &stMousePos);
|
||||
|
||||
//try to pick an object
|
||||
hSupObject = pViewport3d -> GetParentMultiDevice3D()->GetEngineWorld();
|
||||
if (hSupObject != NULL)
|
||||
{
|
||||
xNbPicked = HIE_xIsSuperObjectPick(GLI_C_ModePickingFace,pViewport3d -> m_hDisplayDevice,
|
||||
pViewport3d -> m_hDisplayViewport, &stMousePos.stPos2D, hSupObject, a_stPickInfo);
|
||||
|
||||
if (xNbPicked > 0)
|
||||
{
|
||||
m_lDragDrop = 1;
|
||||
m_eDragDropType = TUT_eMove3d;
|
||||
MTH3D_M_vCopyVector (&g_stInitialPoint , &((((a_stPickInfo[0]).stPickedObject).aDEF_stDataOfElement[0]).stHit));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_bLButtonUp3DViewProc
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonUp3DViewProc(int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
CString csText;
|
||||
CPoint oPoint(LOWORD(lParam),HIWORD(lParam));
|
||||
DEV_ViewPort3D * pViewport3d = TUT_M_GetCurrentViewPort ();
|
||||
tdstMousePos stMousePos;
|
||||
HIE_tdxHandleToSuperObject hSupObject;
|
||||
HIE_aDEF_stTabOfPickInfo a_stPickInfo;
|
||||
ACP_tdxIndex xNbPicked;
|
||||
|
||||
pViewport3d -> PointToMousePos (oPoint, &stMousePos);
|
||||
|
||||
//try to pick an object
|
||||
hSupObject = pViewport3d -> GetParentMultiDevice3D()->GetEngineWorld();
|
||||
if (hSupObject != NULL)
|
||||
{
|
||||
xNbPicked = HIE_xIsSuperObjectPick(GLI_C_ModePickingFace,pViewport3d -> m_hDisplayDevice,
|
||||
pViewport3d -> m_hDisplayViewport, &stMousePos.stPos2D, hSupObject, a_stPickInfo);
|
||||
|
||||
if (xNbPicked > 0)
|
||||
{
|
||||
switch (m_eDragDropType)
|
||||
{
|
||||
case TUT_eMove3d:
|
||||
{
|
||||
if (m_lDragDrop > 1 && !TUT_M_GetCurrentWorld () -> GetListSelected () -> IsEmpty ())
|
||||
{
|
||||
MTH3D_tdstVector stDeplacement;
|
||||
CPA_SuperObject * pCameraSuperObject = pViewport3d -> GetCameraSO ();
|
||||
POS_tdxHandleToPosition hGlobalMatrix = HIE_fn_hGetSuperObjectGlobalMatrix (pCameraSuperObject -> GetStruct ());
|
||||
MTH3D_tdstVector stVectorX , stVectorY , stVectorZ;
|
||||
MTH_tdxReal xDeltaX , xDeltaY;
|
||||
CPA_SuperObject * p_oSuperObject = TUT_M_GetCurrentWorld () -> GetListSelected () -> GetTail ();
|
||||
CPA_BaseObject * pObject = p_oSuperObject -> GetObject ();
|
||||
|
||||
POS_fn_vGetRotationMatrix (hGlobalMatrix , & stVectorX , & stVectorY , & stVectorZ);
|
||||
MTH3D_M_vSubVector (&stDeplacement , &((((a_stPickInfo[0]).stPickedObject).aDEF_stDataOfElement[0]).stHit) , &g_stInitialPoint);
|
||||
|
||||
xDeltaX = MTH3D_M_xDotProductVector (&stDeplacement , &stVectorX);
|
||||
xDeltaY = MTH3D_M_xDotProductVector (&stDeplacement , &stVectorY);
|
||||
|
||||
if (MTH_M_bIsNullWithEpsilon(xDeltaX,MTH_M_xDoubleToReal(0.01)) && MTH_M_bIsNullWithEpsilon(xDeltaY,MTH_M_xDoubleToReal(0.01)))
|
||||
{
|
||||
csText . Format ("%s(\"%s\")" , TUT_C_sz3DClic3dView , pObject -> fn_p_szGetName ());
|
||||
}
|
||||
else
|
||||
{
|
||||
csText . Format ("%s(\"%s\" , \"%.6f\" , \"%.6f\")" , TUT_C_sz3DMove3d , pObject -> fn_p_szGetName () , - xDeltaX , - xDeltaY);
|
||||
}
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!TUT_M_GetCurrentWorld () -> GetListSelected () -> IsEmpty ())
|
||||
{
|
||||
CPA_SuperObject *p_oSuperObject = TUT_M_GetCurrentWorld () -> GetListSelected () -> GetTail ();
|
||||
if (p_oSuperObject)
|
||||
{
|
||||
CPA_BaseObject * pObject = p_oSuperObject -> GetObject ();
|
||||
if (pObject)
|
||||
{
|
||||
csText . Format ("%s(\"%s\")" , TUT_C_sz3DClic3dView , pObject -> fn_p_szGetName ());
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MTH3D_tdstVector *p_stHitPoint = &((((a_stPickInfo[0]).stPickedObject).aDEF_stDataOfElement[0]).stHit);
|
||||
|
||||
csText . Format ("%s(\"%.6f\",\"%.6f\",\"%.6f\")" , TUT_C_sz3DClic3dView , p_stHitPoint->xX ,
|
||||
p_stHitPoint->xY ,
|
||||
p_stHitPoint->xZ);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (m_eDragDropType)
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_bLButtonDownModelViewProc
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonDownModelViewProc(int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
C3ListView *p_oListView = gs_fn_p_oGetModelView ();
|
||||
|
||||
ASSERT(p_oListView);
|
||||
|
||||
// Get the selected item
|
||||
long lIndex = p_oListView -> m_fn_lGetSelectedItem (p_oListView -> m_fn_cGetOrder ());
|
||||
|
||||
// Get the name of the item and fill the variable
|
||||
if (lIndex == TSL_cItemNotFound)
|
||||
{
|
||||
m_csDragDropElement = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
m_csDragDropElement = p_oListView -> m_fn_csGetName (lIndex , p_oListView -> m_fn_cGetOrder ());
|
||||
m_lDragDrop = 1;
|
||||
m_eDragDropType = TUT_eSelectModel;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class TUT_CTutorialManager - m_fn_bLButtonUpModelViewProc
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonUpModelViewProc(int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
CString csText;
|
||||
CPoint oPoint(LOWORD(lParam),HIWORD(lParam));
|
||||
DEV_ViewPort3D * pViewport3d = TUT_M_GetCurrentViewPort ();
|
||||
tdstMousePos stMousePos;
|
||||
HIE_tdxHandleToSuperObject hSupObject;
|
||||
HIE_aDEF_stTabOfPickInfo a_stPickInfo;
|
||||
ACP_tdxIndex xNbPicked;
|
||||
|
||||
pViewport3d -> PointToMousePos (oPoint, &stMousePos);
|
||||
|
||||
//try to pick an object
|
||||
hSupObject = pViewport3d -> GetParentMultiDevice3D()->GetEngineWorld();
|
||||
if (hSupObject != NULL)
|
||||
{
|
||||
xNbPicked = HIE_xIsSuperObjectPick(GLI_C_ModePickingFace,pViewport3d -> m_hDisplayDevice,
|
||||
pViewport3d -> m_hDisplayViewport, &stMousePos.stPos2D, hSupObject, a_stPickInfo);
|
||||
|
||||
if (xNbPicked > 0)
|
||||
{
|
||||
switch (m_eDragDropType)
|
||||
{
|
||||
case TUT_eSelectModel:
|
||||
{
|
||||
if (m_lDragDrop > 1)
|
||||
{
|
||||
MTH3D_tdstVector *p_stHitPoint = &((((a_stPickInfo[0]).stPickedObject).aDEF_stDataOfElement[0]).stHit);
|
||||
|
||||
m_fn_vRemoveToPause ();
|
||||
|
||||
// drag
|
||||
csText . Format ("%s()" , TUT_C_szDrag);
|
||||
m_fn_vAddCommand (csText);
|
||||
// select model
|
||||
csText . Format ("%s(\"%s\")" , TUT_C_sz3DSelectModel , m_csDragDropElement);
|
||||
m_fn_vAddCommand (csText);
|
||||
// drop
|
||||
csText . Format ("%s()" , TUT_C_szDrop);
|
||||
m_fn_vAddCommand (csText);
|
||||
// clic3dView
|
||||
csText . Format ("%s(\"%.6f\",\"%.6f\",\"%.6f\")" , TUT_C_sz3DClic3dView , p_stHitPoint->xX ,
|
||||
p_stHitPoint->xY ,
|
||||
p_stHitPoint->xZ);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (m_eDragDropType)
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif // ifdef TUT_3D
|
3670
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_Mngr.cpp
Normal file
3670
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_Mngr.cpp
Normal file
File diff suppressed because it is too large
Load Diff
850
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_Mngr.cxx
Normal file
850
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_Mngr.cxx
Normal file
@@ -0,0 +1,850 @@
|
||||
const CString TUT_gs_csPause = ";";
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vStartRecord (HMODULE _hModule, DWORD _dThreadID)
|
||||
{
|
||||
m_oListOfCommands . RemoveAll ();
|
||||
m_fn_bStartStopHook (_hModule , _dThreadID , TRUE);
|
||||
m_xLastCommandTime = clock ();
|
||||
m_bInPause = TRUE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vStopRecord (HMODULE _hModule, DWORD _dThreadID, LPCTSTR _szFileName)
|
||||
{
|
||||
m_fn_bStartStopHook (_hModule , _dThreadID , FALSE);
|
||||
|
||||
m_fn_vDeleteLastCommand ();
|
||||
|
||||
if (_szFileName)
|
||||
{
|
||||
FILE *pFile = fopen (_szFileName , "wt");
|
||||
if (pFile)
|
||||
{
|
||||
while (m_oListOfCommands . GetCount ())
|
||||
{
|
||||
CString csCommand = m_oListOfCommands . RemoveHead ();
|
||||
/*if (csCommand != TUT_gs_csPause)*/ fprintf (pFile , "%s\n" , csCommand);
|
||||
}
|
||||
fclose (pFile);
|
||||
}
|
||||
}
|
||||
// remove list
|
||||
while (m_oListOfCommands . GetCount ()) m_oListOfCommands . RemoveHead ();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#define TUT_M_vSetHookProc(hFunc,iHookType,szHookFuncName,hModule,hThreadID)\
|
||||
if (!hFunc)\
|
||||
{\
|
||||
if (!(hFunc = SetWindowsHookEx(iHookType,(HOOKPROC)GetProcAddress(hModule, szHookFuncName), hModule, hThreadID)))\
|
||||
{\
|
||||
return FALSE;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define TUT_M_vUnsetHookProc(hFunc)\
|
||||
if (hFunc)\
|
||||
{\
|
||||
UnhookWindowsHookEx(hFunc);\
|
||||
hFunc = NULL;\
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bStartStopHook (HMODULE _hModule, DWORD _dThreadID, BOOL _bStart)
|
||||
{
|
||||
static HHOOK hhkGetMessage = NULL;
|
||||
static HHOOK hhkCallWndProc = NULL;
|
||||
static HHOOK hhkCallWndProcRet = NULL;
|
||||
|
||||
if (_bStart)
|
||||
{
|
||||
TUT_M_vSetHookProc(hhkGetMessage, WH_GETMESSAGE, "SpyGetMsgProc", _hModule,_dThreadID);
|
||||
TUT_M_vSetHookProc(hhkCallWndProc, WH_CALLWNDPROC, "SpyGetWndProc", _hModule,_dThreadID);
|
||||
TUT_M_vSetHookProc(hhkCallWndProcRet, WH_CALLWNDPROCRET, "SpyGetWndProcRet", _hModule,_dThreadID);
|
||||
}
|
||||
else
|
||||
{
|
||||
TUT_M_vUnsetHookProc(hhkGetMessage);
|
||||
TUT_M_vUnsetHookProc(hhkCallWndProc);
|
||||
TUT_M_vUnsetHookProc(hhkCallWndProcRet);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#define TUT_M_HandleMsg(iType,uiMess,Func) case uiMess: return Func(iType, hwnd , uiMessage , wParam , lParam);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bHookMsgProc (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
m_fn_vHandlePause ();
|
||||
|
||||
switch (uiMessage)
|
||||
{
|
||||
TUT_M_HandleMsg(WH_GETMESSAGE, WM_RBUTTONDOWN, m_fn_bRButtonMsgProc)
|
||||
TUT_M_HandleMsg(WH_GETMESSAGE, WM_LBUTTONUP, m_fn_bLButtonMsgProc)
|
||||
TUT_M_HandleMsg(WH_GETMESSAGE, WM_LBUTTONDOWN, m_fn_bLButtonMsgProc)
|
||||
TUT_M_HandleMsg(WH_GETMESSAGE, WM_LBUTTONDBLCLK, m_fn_bLButtonMsgProc)
|
||||
TUT_M_HandleMsg(WH_GETMESSAGE, WM_MOUSEMOVE, m_fn_bMouseMsgProc)
|
||||
|
||||
default : break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bHookWndProc (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
m_fn_vHandlePause ();
|
||||
|
||||
switch (uiMessage)
|
||||
{
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_COMMAND, m_fn_bCommandMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_KILLFOCUS, m_fn_bFocusMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_NOTIFY, m_fn_bNotifyMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_INITMENU, m_fn_bMenuMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_INITMENUPOPUP, m_fn_bMenuMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_MENUSELECT, m_fn_bMenuMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_EXITMENULOOP, m_fn_bMenuMsgProc)
|
||||
TUT_M_HandleMsg(WH_CALLWNDPROC, WM_MOUSEMOVE, m_fn_bMouseMsgProc)
|
||||
default : break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bHookWndProcRet (HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
m_fn_vHandlePause ();
|
||||
|
||||
switch (uiMessage)
|
||||
{
|
||||
default : break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vHandlePause ()
|
||||
{
|
||||
clock_t xDuration = clock () - m_xLastCommandTime;
|
||||
|
||||
if (!m_bInPause && xDuration > TUT_C_xPauseIntervall)
|
||||
{
|
||||
xDuration = TUT_C_xPauseIntervall;
|
||||
m_fn_vAddPause ();
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vAddCommand (CString csCommand)
|
||||
{
|
||||
m_oListOfCommands . AddTail (csCommand);
|
||||
m_bInPause = FALSE;
|
||||
m_xLastCommandTime = clock ();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vInsertAfterPause (CString csCommand)
|
||||
{
|
||||
POSITION xPos;
|
||||
|
||||
xPos = m_oListOfCommands . GetTailPosition ();
|
||||
|
||||
while (xPos && m_oListOfCommands . GetAt (xPos) != TUT_gs_csPause)
|
||||
{
|
||||
m_oListOfCommands . GetPrev (xPos);
|
||||
}
|
||||
|
||||
if (xPos)
|
||||
{
|
||||
m_oListOfCommands . InsertBefore (xPos , csCommand);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_oListOfCommands . AddTail (csCommand);
|
||||
}
|
||||
m_bInPause = FALSE;
|
||||
m_xLastCommandTime = clock ();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vAddPause (void)
|
||||
{
|
||||
m_oListOfCommands . AddTail (TUT_gs_csPause);
|
||||
m_bInPause = TRUE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vRemoveToPause (void)
|
||||
{
|
||||
while (!m_oListOfCommands . IsEmpty () && m_oListOfCommands . GetTail () != TUT_gs_csPause)
|
||||
{
|
||||
m_oListOfCommands . RemoveTail ();
|
||||
}
|
||||
|
||||
m_bInPause = TRUE;
|
||||
m_xLastCommandTime = clock ();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bHaveSomethingAfterPause (void)
|
||||
{
|
||||
return (m_oListOfCommands . GetCount () && m_oListOfCommands . GetTail () != TUT_gs_csPause);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void TUT_CTutorialManager::m_fn_vDeleteLastCommand (void)
|
||||
{
|
||||
// delete last Pause commands
|
||||
while (!m_oListOfCommands . IsEmpty () && m_oListOfCommands . GetTail () == TUT_gs_csPause)
|
||||
{
|
||||
m_oListOfCommands . RemoveTail ();
|
||||
}
|
||||
|
||||
// delete last command
|
||||
m_fn_vRemoveToPause ();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#define TUT_M_bWND_VALID_AND_USABLE(p_stWndDefinition)\
|
||||
( (p_stWndDefinition) && (p_stWndDefinition) -> hWnd && IsWindowVisible((p_stWndDefinition) -> hWnd) )
|
||||
|
||||
#define TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition)\
|
||||
if (!TUT_M_bWND_VALID_AND_USABLE(p_stWndDefinition)) return FALSE;
|
||||
|
||||
#define TUT_M_ASSERT_CURSOR_UNDER_CONTROL(hwnd)\
|
||||
{\
|
||||
RECT stRect;\
|
||||
POINT xPoint;\
|
||||
GetWindowRect (hwnd , &stRect);\
|
||||
GetCursorPos (&xPoint);\
|
||||
if (!PtInRect (&stRect , xPoint)) return FALSE;\
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bCommandMsgProc (int /*iHookType*/, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
TUT_tdstWndDefinition *p_stWndDefinition = lParam ? m_fnp_stFindWndDefinition ((HWND)lParam) : NULL;
|
||||
UINT uiNotification = HIWORD(wParam);
|
||||
CString csText;
|
||||
|
||||
TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition);
|
||||
|
||||
switch (p_stWndDefinition -> eType)
|
||||
{
|
||||
case TUT_eButton:
|
||||
{
|
||||
if (uiNotification == BN_CLICKED)
|
||||
{
|
||||
csText . Format ("%s(\"%s\")" , TUT_C_szClic , p_stWndDefinition -> csName);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TUT_eListBox:
|
||||
{
|
||||
switch (uiNotification)
|
||||
{
|
||||
case LBN_SELCHANGE:
|
||||
{
|
||||
long lType = GetWindowLong (p_stWndDefinition -> hWnd, GWL_STYLE);
|
||||
if (! (lType & LBS_MULTIPLESEL) )
|
||||
{
|
||||
int iCurSel = SendMessage (p_stWndDefinition -> hWnd, LB_GETCURSEL, 0, 0);
|
||||
if (iCurSel != LB_ERR)
|
||||
{
|
||||
char szText[255];
|
||||
|
||||
SendMessage (p_stWndDefinition -> hWnd, LB_GETTEXT, iCurSel, (DWORD)szText);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LBN_DBLCLK:
|
||||
{
|
||||
if (m_oListOfCommands . GetCount () > 0)
|
||||
{
|
||||
csText . Format ("%s()" , TUT_C_szDoubleClic);
|
||||
m_fn_vInsertAfterPause (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (uiNotification)
|
||||
}
|
||||
break;
|
||||
|
||||
case TUT_eComboBox:
|
||||
{
|
||||
switch (uiNotification)
|
||||
{
|
||||
case CBN_SELCHANGE:
|
||||
{
|
||||
int iCurSel = SendMessage (p_stWndDefinition -> hWnd, CB_GETCURSEL, 0, 0);
|
||||
if (iCurSel != CB_ERR)
|
||||
{
|
||||
char szText[255];
|
||||
|
||||
SendMessage (p_stWndDefinition -> hWnd, CB_GETLBTEXT, iCurSel, (DWORD)szText);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CBN_DBLCLK:
|
||||
{
|
||||
if (m_oListOfCommands . GetCount () > 0)
|
||||
{
|
||||
csText . Format ("%s()" , TUT_C_szDoubleClic);
|
||||
m_fn_vInsertAfterPause (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (uiNotification)
|
||||
}
|
||||
break;
|
||||
} // switch (p_stWndDefinition -> eType)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CString gs_fn_csHandleQuoteInString (char *_szSourceText)
|
||||
{
|
||||
CString csResult;
|
||||
char *p_cBegin = _szSourceText;
|
||||
|
||||
csResult . Empty ();
|
||||
|
||||
while (*p_cBegin)
|
||||
{
|
||||
if (*p_cBegin == '\"')
|
||||
{
|
||||
csResult += "''";
|
||||
}
|
||||
else
|
||||
{
|
||||
csResult += *p_cBegin;
|
||||
}
|
||||
p_cBegin ++;
|
||||
}
|
||||
return csResult;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bFocusMsgProc (int /*iHookType*/, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (uiMessage == WM_KILLFOCUS)
|
||||
{
|
||||
TUT_tdstWndDefinition *p_stWndDefinition = hwnd ? m_fnp_stFindWndDefinition (hwnd) : NULL;
|
||||
CString csText;
|
||||
|
||||
TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition);
|
||||
|
||||
switch (p_stWndDefinition -> eType)
|
||||
{
|
||||
case TUT_eListBox:
|
||||
{
|
||||
long lType = GetWindowLong (p_stWndDefinition -> hWnd , GWL_STYLE);
|
||||
if (lType & LBS_MULTIPLESEL)
|
||||
{
|
||||
int iNbSel = SendMessage (p_stWndDefinition -> hWnd , LB_GETSELCOUNT , 0 , 0);
|
||||
if (iNbSel != LB_ERR)
|
||||
{
|
||||
int *a_iSelItems = (int*) alloca (iNbSel * sizeof (int));
|
||||
|
||||
if (SendMessage (p_stWndDefinition -> hWnd , LB_GETSELITEMS , iNbSel , (DWORD)a_iSelItems))
|
||||
{
|
||||
char szText[255];
|
||||
|
||||
SendMessage (p_stWndDefinition -> hWnd , LB_GETTEXT , a_iSelItems [0] , (DWORD)szText);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
|
||||
for (int i=1 ; i<iNbSel ; i++)
|
||||
{
|
||||
SendMessage (p_stWndDefinition -> hWnd , LB_GETTEXT , a_iSelItems [i] , (DWORD)szText);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szAddSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TUT_eTextEdit:
|
||||
{
|
||||
long lType = GetWindowLong (p_stWndDefinition -> hWnd , GWL_STYLE);
|
||||
if (lType & ES_MULTILINE)
|
||||
{
|
||||
int iSize = GetWindowTextLength (p_stWndDefinition -> hWnd);
|
||||
char *szText = (char *) alloca (iSize+1);
|
||||
char szEndOfLine [3] = { 13 , 10 , 0 };
|
||||
char *p_cBegin , *p_cEnd;
|
||||
int iLineNumber;
|
||||
|
||||
// clear control
|
||||
csText . Format ("%s(0,0,0,0)" , TUT_C_szSelectText);
|
||||
m_fn_vAddCommand (csText);
|
||||
|
||||
GetWindowText (p_stWndDefinition -> hWnd , szText , iSize + 1);
|
||||
p_cBegin = szText;
|
||||
|
||||
iLineNumber = 0;
|
||||
p_cEnd = strstr (p_cBegin , szEndOfLine);
|
||||
while (p_cEnd)
|
||||
{
|
||||
*p_cEnd = 0;
|
||||
if (p_cEnd != p_cBegin)
|
||||
{
|
||||
csText . Format ("%s(\"%s\" , \"%s\" , %d)" , TUT_C_szSetEditText , p_stWndDefinition -> csName , gs_fn_csHandleQuoteInString (p_cBegin) , iLineNumber);
|
||||
m_fn_vAddCommand (csText);
|
||||
}
|
||||
|
||||
//
|
||||
p_cBegin = p_cEnd + 2;
|
||||
iLineNumber ++;
|
||||
p_cEnd = strstr (p_cBegin , szEndOfLine);
|
||||
}
|
||||
|
||||
if (*p_cBegin)
|
||||
{
|
||||
csText . Format ("%s(\"%s\" , \"%s\" , %d)" , TUT_C_szSetEditText , p_stWndDefinition -> csName , gs_fn_csHandleQuoteInString (p_cBegin) , iLineNumber);
|
||||
m_fn_vAddCommand (csText);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int iSize = GetWindowTextLength (p_stWndDefinition -> hWnd);
|
||||
char *szText = (char *) alloca (iSize+1);
|
||||
|
||||
if (GetWindowText (p_stWndDefinition -> hWnd , szText , iSize+1))
|
||||
{
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSetEditText , p_stWndDefinition -> csName , gs_fn_csHandleQuoteInString (szText));
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (p_stWndDefinition -> eType)
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bNotifyMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
LPNMHDR pnmh = (LPNMHDR) lParam;
|
||||
TUT_tdstWndDefinition *p_stWndDefinition = (pnmh && pnmh -> hwndFrom) ? m_fnp_stFindWndDefinition (pnmh -> hwndFrom) : NULL;
|
||||
CString csText;
|
||||
|
||||
TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition);
|
||||
TUT_M_ASSERT_CURSOR_UNDER_CONTROL(p_stWndDefinition -> hWnd);
|
||||
|
||||
switch (p_stWndDefinition -> eType)
|
||||
{
|
||||
case TUT_eListBox:
|
||||
{
|
||||
uiMessage = uiMessage;
|
||||
}
|
||||
break;
|
||||
|
||||
case TUT_eListCtrl:
|
||||
{
|
||||
NM_LISTVIEW *pnmv = (NM_LISTVIEW *) lParam;
|
||||
if (pnmv -> hdr . code == LVN_ITEMCHANGED)
|
||||
{
|
||||
if (pnmv -> iItem && pnmv -> uNewState == (LVIS_SELECTED|LVIS_FOCUSED))
|
||||
{
|
||||
char szText[255];
|
||||
|
||||
ListView_GetItemText (p_stWndDefinition -> hWnd , pnmv -> iItem , 0 , szText , 255);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TUT_eTreeCtrl:
|
||||
{
|
||||
NM_TREEVIEW *pnmtv = (NM_TREEVIEW *) lParam;
|
||||
switch (pnmtv -> hdr . code)
|
||||
{
|
||||
case TVN_SELCHANGED:
|
||||
{
|
||||
if (pnmtv -> itemNew . mask & TVIF_STATE && pnmtv -> itemNew . state & TVIS_SELECTED)
|
||||
{
|
||||
char szText[255];
|
||||
|
||||
pnmtv -> itemNew . pszText = szText;
|
||||
pnmtv -> itemNew . cchTextMax = 255;
|
||||
pnmtv -> itemNew . mask = TVIF_TEXT;
|
||||
|
||||
if (TreeView_GetItem (p_stWndDefinition -> hWnd , & pnmtv -> itemNew))
|
||||
{
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TVN_ITEMEXPANDED:
|
||||
{
|
||||
if (pnmtv -> itemNew . mask & TVIF_STATE)
|
||||
{
|
||||
BOOL bExpanded = (pnmtv -> itemNew . state & TVIS_EXPANDED) ? TRUE : FALSE;
|
||||
char szText[255];
|
||||
|
||||
pnmtv -> itemNew . pszText = szText;
|
||||
pnmtv -> itemNew . cchTextMax = 255;
|
||||
pnmtv -> itemNew . mask = TVIF_TEXT;
|
||||
|
||||
if (TreeView_GetItem (p_stWndDefinition -> hWnd , & pnmtv -> itemNew))
|
||||
{
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , bExpanded ? TUT_C_szExpand : TUT_C_szCollapse , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (pnmtv -> hdr . code)
|
||||
}
|
||||
break;
|
||||
} // switch (p_stWndDefinition -> eType)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bLButtonMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (iHookType)
|
||||
{
|
||||
case WH_CALLWNDPROCRET:
|
||||
case WH_GETMESSAGE:
|
||||
{
|
||||
switch (uiMessage)
|
||||
{
|
||||
case WM_LBUTTONDOWN:
|
||||
{
|
||||
TUT_tdstWndDefinition *p_stWndDefinition = hwnd ? m_fnp_stFindWndDefinition (hwnd) : NULL;
|
||||
|
||||
if (p_stWndDefinition == NULL && m_fn_bIsModelView (hwnd))
|
||||
{
|
||||
return m_fn_bLButtonDownModelViewProc (iHookType, hwnd, uiMessage, wParam, lParam);
|
||||
}
|
||||
|
||||
TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition);
|
||||
|
||||
m_csDragDropElement . Empty ();
|
||||
m_lDragDrop = 0;
|
||||
|
||||
switch (p_stWndDefinition -> eType)
|
||||
{
|
||||
case TUT_e3DView:
|
||||
{
|
||||
return m_fn_bLButtonDown3DViewProc (iHookType, hwnd, uiMessage, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_LBUTTONUP:
|
||||
{
|
||||
TUT_tdstWndDefinition *p_stWndDefinition = hwnd ? m_fnp_stFindWndDefinition (hwnd) : NULL;
|
||||
|
||||
if (p_stWndDefinition == NULL && m_fn_bIsModelView (hwnd))
|
||||
{
|
||||
return m_fn_bLButtonUpModelViewProc (iHookType, hwnd, uiMessage, wParam, lParam);
|
||||
}
|
||||
|
||||
TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition);
|
||||
switch (p_stWndDefinition -> eType)
|
||||
{
|
||||
case TUT_e3DView:
|
||||
{
|
||||
return m_fn_bLButtonUp3DViewProc (iHookType, hwnd, uiMessage, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
}
|
||||
m_csDragDropElement . Empty ();
|
||||
m_lDragDrop = 0;
|
||||
}
|
||||
break;
|
||||
case WM_LBUTTONDBLCLK:
|
||||
{
|
||||
if (m_fn_bHaveSomethingAfterPause ())
|
||||
{
|
||||
CString csText;
|
||||
|
||||
csText . Format ("%s()" , TUT_C_szDoubleClic);
|
||||
m_fn_vInsertAfterPause (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // switch (uiMessage)
|
||||
}
|
||||
break;
|
||||
} // switch (iHookType)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bMouseMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uiMessage)
|
||||
{
|
||||
case WM_MOUSEMOVE:
|
||||
{
|
||||
if (m_lDragDrop > 0) m_lDragDrop++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bRButtonMsgProc (int iHookType, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uiMessage)
|
||||
{
|
||||
case WM_RBUTTONDOWN:
|
||||
{
|
||||
TUT_tdstWndDefinition *p_stWndDefinition = hwnd ? m_fnp_stFindWndDefinition (hwnd) : NULL;
|
||||
CString csText;
|
||||
|
||||
TUT_M_ASSERT_WND_VALID_AND_USABLE(p_stWndDefinition);
|
||||
|
||||
switch (p_stWndDefinition -> eType)
|
||||
{
|
||||
case TUT_e3DView:
|
||||
{
|
||||
csText . Format ("%s()" , TUT_C_szRightButton);
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case TUT_eListBox:
|
||||
{
|
||||
long lType = GetWindowLong (p_stWndDefinition -> hWnd , GWL_STYLE);
|
||||
if (lType & LBS_MULTIPLESEL)
|
||||
{
|
||||
int iNbSel = SendMessage (p_stWndDefinition -> hWnd , LB_GETSELCOUNT , 0 , 0);
|
||||
if (iNbSel != LB_ERR)
|
||||
{
|
||||
int *a_iSelItems = (int*) alloca (iNbSel * sizeof (int));
|
||||
|
||||
if (SendMessage (p_stWndDefinition -> hWnd , LB_GETSELITEMS , iNbSel , (DWORD)a_iSelItems))
|
||||
{
|
||||
char szText[255];
|
||||
|
||||
SendMessage (p_stWndDefinition -> hWnd , LB_GETTEXT , a_iSelItems [0] , (DWORD)szText);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
|
||||
for (int i=1 ; i<iNbSel ; i++)
|
||||
{
|
||||
SendMessage (p_stWndDefinition -> hWnd , LB_GETTEXT , a_iSelItems [i] , (DWORD)szText);
|
||||
csText . Format ("%s(\"%s\" , \"%s\")" , TUT_C_szAddSelect , p_stWndDefinition -> csName , szText);
|
||||
m_fn_vAddCommand (csText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// no break here
|
||||
default:
|
||||
{
|
||||
csText . Format ("%s()" , TUT_C_szRightButton);
|
||||
m_fn_vAddCommand (csText);
|
||||
csText . Format ("%s(\"%s\")" , TUT_C_szClic , p_stWndDefinition -> csName);
|
||||
m_fn_vAddCommand (csText);
|
||||
}
|
||||
break;
|
||||
} // switch (p_stWndDefinition -> eType)
|
||||
|
||||
//
|
||||
}
|
||||
break;
|
||||
} // switch (uiMessage)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void gs_fn_vCleanMenuName(char *_szName)
|
||||
{
|
||||
char *p_cSource = _szName;
|
||||
char *p_cTarget = _szName;
|
||||
|
||||
while (*p_cSource)
|
||||
{
|
||||
if (*p_cSource == '\t') break;
|
||||
if (*p_cSource != '&')
|
||||
{
|
||||
*p_cTarget++ = *p_cSource;
|
||||
}
|
||||
p_cSource++;
|
||||
}
|
||||
*p_cTarget = 0;
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
BOOL TUT_CTutorialManager::m_fn_bMenuMsgProc (int /*iHookType*/, HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static CStringList s_oListOfMenuNames;
|
||||
static CList<HMENU,HMENU> s_oListOfMenuHandles;
|
||||
static char s_oCurrentMenuName[255];
|
||||
static HMENU hCurrentMenu;
|
||||
static HMENU hNextMenu;
|
||||
static BOOL bLastIsAnEntry;
|
||||
CString csText;
|
||||
|
||||
switch (uiMessage)
|
||||
{
|
||||
case WM_INITMENU:
|
||||
{
|
||||
s_oListOfMenuNames . RemoveAll ();
|
||||
s_oListOfMenuHandles . RemoveAll ();
|
||||
*s_oCurrentMenuName = 0;
|
||||
hCurrentMenu = (HMENU)wParam;
|
||||
hNextMenu = NULL;
|
||||
bLastIsAnEntry = FALSE;
|
||||
}
|
||||
break;
|
||||
case WM_INITMENUPOPUP:
|
||||
{
|
||||
hNextMenu = (HMENU) wParam;
|
||||
}
|
||||
break;
|
||||
case WM_MENUSELECT:
|
||||
{
|
||||
UINT uItem = (UINT) LOWORD(wParam); // menu item or submenu index
|
||||
UINT fuFlags = (UINT) HIWORD(wParam); // menu flags
|
||||
HMENU hmenu = (HMENU) lParam; // handle of menu clicked
|
||||
UINT uiFlag = (fuFlags & MF_POPUP) ? MF_BYPOSITION : MF_BYCOMMAND;
|
||||
|
||||
csText = "WM_MENUSELECT : ";
|
||||
if (fuFlags == 0xFFFF)
|
||||
{
|
||||
if (!bLastIsAnEntry)
|
||||
{
|
||||
while (s_oListOfMenuNames . GetCount()) s_oListOfMenuNames . RemoveHead ();
|
||||
while (s_oListOfMenuHandles . GetCount()) s_oListOfMenuHandles . RemoveHead ();
|
||||
*s_oCurrentMenuName = 0;
|
||||
csText += "Clear all";
|
||||
}
|
||||
else
|
||||
{
|
||||
s_oListOfMenuNames . AddTail (s_oCurrentMenuName);
|
||||
csText += "End";
|
||||
}
|
||||
}
|
||||
else if (hmenu == hCurrentMenu)
|
||||
{
|
||||
GetMenuString (hmenu , uItem , s_oCurrentMenuName , 255 , uiFlag);
|
||||
gs_fn_vCleanMenuName (s_oCurrentMenuName);
|
||||
bLastIsAnEntry = (fuFlags & MF_POPUP) ? FALSE : TRUE;
|
||||
csText += "Current => " + CString(s_oCurrentMenuName);
|
||||
}
|
||||
else if (hmenu == hNextMenu)
|
||||
{
|
||||
s_oListOfMenuHandles . AddTail (hCurrentMenu);
|
||||
s_oListOfMenuNames . AddTail (s_oCurrentMenuName);
|
||||
GetMenuString (hmenu , uItem , s_oCurrentMenuName , 255 , uiFlag);
|
||||
gs_fn_vCleanMenuName (s_oCurrentMenuName);
|
||||
hCurrentMenu = hNextMenu;
|
||||
hNextMenu = NULL;
|
||||
bLastIsAnEntry = (fuFlags & MF_POPUP) ? FALSE : TRUE;
|
||||
csText += "Next => " + CString(s_oCurrentMenuName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s_oListOfMenuNames . GetCount()) s_oListOfMenuNames . RemoveTail ();
|
||||
while (s_oListOfMenuHandles . GetCount() && (s_oListOfMenuHandles . GetTail () != hmenu))
|
||||
{
|
||||
s_oListOfMenuHandles . RemoveTail ();
|
||||
if (s_oListOfMenuNames . GetCount()) s_oListOfMenuNames . RemoveTail ();
|
||||
}
|
||||
if (s_oListOfMenuHandles . GetCount()) s_oListOfMenuHandles . RemoveTail ();
|
||||
hCurrentMenu = hmenu;
|
||||
hNextMenu = NULL;
|
||||
GetMenuString (hmenu , uItem , s_oCurrentMenuName , 255 , uiFlag);
|
||||
gs_fn_vCleanMenuName (s_oCurrentMenuName);
|
||||
bLastIsAnEntry = (fuFlags & MF_POPUP) ? FALSE : TRUE;
|
||||
csText += "Back => " + CString(s_oCurrentMenuName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_EXITMENULOOP:
|
||||
{
|
||||
while (s_oListOfMenuHandles . GetCount()) s_oListOfMenuHandles . RemoveHead ();
|
||||
|
||||
if (s_oListOfMenuNames . GetCount())
|
||||
{
|
||||
ASSERT(bLastIsAnEntry);
|
||||
csText . Format ("%s(\"%s\"" , wParam ? TUT_C_szPopupMenu : TUT_C_szMenu , s_oListOfMenuNames . RemoveHead ());
|
||||
while (s_oListOfMenuNames . GetCount())
|
||||
{
|
||||
csText = csText + " , \"" + s_oListOfMenuNames . RemoveHead () + "\"";
|
||||
}
|
||||
csText += ")";
|
||||
m_fn_vAddCommand (csText);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
1617
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_Mngr.inc
Normal file
1617
Rayman_X/cpa/tempgrp/Tut/TutLib/Src/Tut_Mngr.inc
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user