typedef struct _StateInfo
{
CEdit msgList;
} StateInfo;
if ( xml. FindChildElem ( _T ( "MsgList" ) ) )
{
int x = _tstoi ( xml. GetChildAttrib ( _T ( "x" ) ) ) ;
int y = _tstoi ( xml. GetChildAttrib ( _T ( "y" ) ) ) ;
int width = _tstoi ( xml. GetChildAttrib ( _T ( "width" ) ) ) ;
int height = _tstoi ( xml. GetChildAttrib ( _T ( "height" ) ) ) ;
CRect rc;
rc. top = y;
rc. left = x;
rc. right = rc. left + width;
rc. bottom = rc. top + height;
m_pStateInfo- > msgList. Create ( WS_CHILD | WS_VISIBLE | WS_BORDER | ES_MULTILINE | WS_VSCROLL | WS_TABSTOP | ES_LEFT,
rc,
this ,
nStartID + i) ;
m_pStateInfo- > msgList. EnableWindow ( TRUE) ;
}
void CSimulationDlg:: ShowInfo ( CString str)
{
CTime curTime;
curTime = CTime:: GetCurrentTime ( ) ;
CString c_s;
c_s = curTime. Format ( _T ( "[%c]" ) ) ;
str = c_s + str + _T ( "\r\n" ) ;
int nLen = m_pStateInfo- > msgList. GetLineCount ( ) ;
if ( nLen > 1000 )
{
m_pStateInfo- > msgList. Clear ( ) ;
m_pStateInfo- > msgList. SetWindowText ( _T ( "" ) ) ;
}
else
{
m_pStateInfo- > msgList. SetFocus ( ) ;
m_pStateInfo- > msgList. ReplaceSel ( str) ;
}
}