157 lines
4.2 KiB
C++
157 lines
4.2 KiB
C++
// IADLstCt.cpp : implementation file
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
#include "stdafx.h"
|
|
|
|
#include "IADLstCt.hpp"
|
|
|
|
#include "IADVwMn.hpp"
|
|
#include "IADDgSN.hpp"
|
|
#include "_IADItrf.hpp"
|
|
|
|
//External modules
|
|
#include "AI.h"
|
|
#include "OAc.h"
|
|
//End External modules
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// IAD_ListControl
|
|
|
|
BEGIN_MESSAGE_MAP(IAD_ListControl, CListCtrl)
|
|
//{{AFX_MSG_MAP(IAD_ListControl)
|
|
ON_WM_LBUTTONUP()
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
//***************************************************************************
|
|
IAD_ListControl::IAD_ListControl()
|
|
{
|
|
|
|
}
|
|
|
|
//***************************************************************************
|
|
IAD_ListControl::~IAD_ListControl()
|
|
{
|
|
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// IAD_ListControl message handlers
|
|
|
|
//***************************************************************************
|
|
void IAD_ListControl::OnLButtonUp(UINT nFlags, CPoint point)
|
|
{
|
|
//Looks where user clicked
|
|
CRect crWindowRect;
|
|
GetWindowRect(crWindowRect);
|
|
ScreenToClient(&crWindowRect);
|
|
|
|
CPoint cpLocalPoint = point;
|
|
|
|
short wFirstCol = GetColumnWidth(0);
|
|
short wSecondCol = GetColumnWidth(1);
|
|
short wLastCol = GetColumnWidth(4);
|
|
|
|
//If 'Size' column was clicked
|
|
if ( (cpLocalPoint.x > (crWindowRect.right - wLastCol))
|
|
&& (cpLocalPoint.x < crWindowRect.right)
|
|
)
|
|
{
|
|
//Gets the corresponding Actor
|
|
IAD_td_stInternalActorDescription *p_stSelectedInternalActor = NULL;
|
|
BOOL bMustStop = FALSE;
|
|
long lI;
|
|
CRect crItemRect;
|
|
for (lI = 0; (lI < GetItemCount()) && (!bMustStop); lI ++)
|
|
{
|
|
GetItemRect(lI, &crItemRect, LVIR_BOUNDS);
|
|
|
|
if ( (cpLocalPoint.y > crItemRect.top)
|
|
&& (cpLocalPoint.y < crItemRect.bottom)
|
|
)
|
|
{
|
|
p_stSelectedInternalActor = (IAD_td_stInternalActorDescription *)GetItemData(lI);
|
|
bMustStop = TRUE;
|
|
}
|
|
}
|
|
|
|
if ( p_stSelectedInternalActor != NULL )
|
|
{
|
|
//Displays an Edit to get new value
|
|
CPoint cpTopLeft;
|
|
cpTopLeft.x = crItemRect.right;
|
|
cpTopLeft.y = crItemRect.top;
|
|
ClientToScreen(&cpTopLeft);
|
|
cpTopLeft.x -= wLastCol;
|
|
IAD_Dialog_SetNumber SNDial(cpTopLeft,
|
|
p_stSelectedInternalActor->lNumberOfEntries,
|
|
this);
|
|
|
|
if ( SNDial.DoModal() == IDOK )
|
|
{
|
|
p_stSelectedInternalActor->lNumberOfEntries = SNDial.m_pub_fn_lGetNumber();
|
|
|
|
// CG PB DEBUGGER 23/06/98 {
|
|
#ifdef ACTIVE_AIDEBUG
|
|
//Sets motor part
|
|
AIDebug_fn_vResizeTrace(g_pclInterface->m_clDocument.m_pub_fn_p_stGetMindOfActor(p_stSelectedInternalActor), (short)p_stSelectedInternalActor->lNumberOfEntries);
|
|
#endif // { CG PB DEBUGGER
|
|
|
|
CString csText;
|
|
csText.Format("%ld", p_stSelectedInternalActor->lNumberOfEntries);
|
|
SetItemText(--lI, 4, csText);
|
|
}
|
|
}
|
|
}
|
|
|
|
//If 'On' column was clicked
|
|
if ( (cpLocalPoint.x > (crWindowRect.left + wFirstCol))
|
|
&& (cpLocalPoint.x < (crWindowRect.left + wFirstCol + wSecondCol))
|
|
)
|
|
{
|
|
//Gets the corresponding Actor
|
|
IAD_td_stInternalActorDescription *p_stSelectedInternalActor = NULL;
|
|
BOOL bMustStop = FALSE;
|
|
long lI;
|
|
CRect crItemRect;
|
|
for (lI = 0; (lI < GetItemCount()) && (!bMustStop); lI ++)
|
|
{
|
|
GetItemRect(lI, &crItemRect, LVIR_LABEL);
|
|
|
|
if ( (cpLocalPoint.y > crItemRect.top)
|
|
&& (cpLocalPoint.y < crItemRect.bottom)
|
|
)
|
|
{
|
|
p_stSelectedInternalActor = (IAD_td_stInternalActorDescription *)GetItemData(lI);
|
|
bMustStop = TRUE;
|
|
}
|
|
}
|
|
|
|
if ( p_stSelectedInternalActor != NULL )
|
|
{
|
|
p_stSelectedInternalActor->bTraceIsEnabled = !p_stSelectedInternalActor->bTraceIsEnabled;
|
|
|
|
//BEGIN ROMTEAM Cristi Petrescu 98-05-
|
|
//for the debug info
|
|
p_stSelectedInternalActor -> pclActor -> m_fn_vMustBuildDebugInfo (p_stSelectedInternalActor->bTraceIsEnabled);
|
|
//END ROMTEAM Cristi Petrescu 98-05-
|
|
|
|
// CG PB DEBUGGER 23/06/98 {
|
|
#ifdef ACTIVE_AIDEBUG
|
|
//Sets motor part
|
|
AIDebug_fn_vSetEnable(g_pclInterface->m_clDocument.m_pub_fn_p_stGetMindOfActor(p_stSelectedInternalActor), p_stSelectedInternalActor->bTraceIsEnabled);
|
|
#endif // CG PB DEBUGGER
|
|
|
|
SetItemText(--lI, 1, p_stSelectedInternalActor->bTraceIsEnabled ? "X" : "");
|
|
}
|
|
}
|
|
|
|
CListCtrl::OnLButtonUp(nFlags, point);
|
|
}
|