reman3/Rayman_X/cpa/public/Tut.h

90 lines
4.2 KiB
C

/*******************************************************************************/
/** Tut.hpp **/
/*******************************************************************************/
/** **/
/** Public file of the TUT dll **/
/** **/
/*******************************************************************************/
/** Author : Alexis Vaisse **/
/*******************************************************************************/
#ifndef __TUT_H__
#define __TUT_H__
#define TUT_C_lQueryRegisterControl 1
#define TUT_C_lQueryUnregisterControl 2
#define TUT_C_lQueryRegisterMenu 3
typedef enum TUT_eControlType_ { TUT_e_Window , TUT_e_MdiWindow ,
TUT_e_Button , TUT_e_TextEdit ,
TUT_e_ListBox , TUT_e_ComboBox ,
TUT_e_TreeCtrl , TUT_e_ListCtrl ,
TUT_e_Spin , TUT_e_Slider ,
TUT_e_ScrollBar , TUT_e_UserWindow,
TUT_e_3DView } TUT_tdeControlType;
typedef struct TUT_stQueryWindowStructure_
{
HWND hHandleOfControl;
CString csNameOfControl;
TUT_tdeControlType eTypeOfControl;
} TUT_tdstQueryWindowStructure;
typedef struct TUT_stQueryMenuStructure_
{
HMENU hHandleOfMenu;
HWND hHandleOfWindow;
int iX , iY;
} TUT_tdstQueryMenuStructure;
#define TUT_M_vGetTutDll() CPA_ToolDLLBase * p_oTutDll = ((CPA_ProjectApp *) AfxGetApp ()) -> fn_p_oGetMainWorld () -> GetToolDLLWithName (C_szDLLTutorialName);
/* Register with a handle*/
#define TUT_M_vRegisterControl(hHandle,csName,eType) \
if (p_oTutDll) \
{ \
TUT_tdstQueryWindowStructure stQueryStructure; \
stQueryStructure . hHandleOfControl = hHandle; \
stQueryStructure . csNameOfControl = csName; \
stQueryStructure . eTypeOfControl = eType; \
p_oTutDll -> OnQueryAction (NULL , TUT_C_lQueryRegisterControl , (LPARAM) & stQueryStructure); \
}
#define TUT_M_vUnregisterControl(hHandle) \
if (p_oTutDll) \
{ \
p_oTutDll -> OnQueryAction (NULL , TUT_C_lQueryUnregisterControl , (LPARAM) hHandle); \
}
#define TUT_M_vRegisterMenu(hWindow,hMenu,iXMenu,iYMenu) \
if (p_oTutDll) \
{ \
TUT_tdstQueryMenuStructure stQueryStructure; \
stQueryStructure . hHandleOfMenu = hMenu; \
stQueryStructure . hHandleOfWindow = hWindow; \
stQueryStructure . iX = iXMenu; \
stQueryStructure . iY = iYMenu; \
p_oTutDll -> OnQueryAction (NULL , TUT_C_lQueryRegisterMenu , (LPARAM) & stQueryStructure); \
}
/* Register with an ID*/
#define TUT_M_vRegisterControlID(iID,csName,eType) TUT_M_vRegisterControl (GetDlgItem (iID) -> m_hWnd , csName , eType);
#define TUT_M_vUnregisterControlID(iID) TUT_M_vUnregisterControl (GetDlgItem (iID) -> m_hWnd);
/* Register a CPA_DialogList*/
#define TUT_M_vRegisterDialogList(p_oDialogList,csListName,csTreeName,csComboName,csTestButtonName) \
TUT_M_vRegisterControl (p_oDialogList -> GetListHandle () , csListName , TUT_e_ListCtrl); \
TUT_M_vRegisterControl (p_oDialogList -> GetTreeHandle () , csTreeName , TUT_e_TreeCtrl); \
TUT_M_vRegisterControl (p_oDialogList -> GetComboHandle () , csComboName , TUT_e_ComboBox); \
TUT_M_vRegisterControl (p_oDialogList -> GetTestButtonHandle () , csTestButtonName , TUT_e_Button );
#endif /* __TUT_H__*/