|
|
//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright � 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: WholeAreaWnd.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of WholeAreaWnd.cpp
//----------------------------------------------------------------------------
// WholeAreaWnd.cpp: implementation of the CWholeAreaWnd class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "chicago.h"
#include "WholeAreaWnd.h"
#include "ZoomAreaWnd.h"
#include "..\..\LgLib\Version.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;#define new DEBUG_NEW
#endif
/*
BEGIN_MESSAGE_MAP( CWholeAreaWnd, CAreaSensorWnd ) //{{AFX_MSG_MAP(CWholeAreaWnd)
ON_WM_LBUTTONDOWN() //}}AFX_MSG_MAP
END_MESSAGE_MAP()
CWholeAreaWnd::CWholeAreaWnd(){ m_pZoomAreaWnd = NULL;}
CWholeAreaWnd::~CWholeAreaWnd(){
}
void CWholeAreaWnd::OnLButtonDown(UINT nFlags, CPoint point) { m_pZoomAreaWnd->SetCenter( &WindowToArea( &point ) ); CRect WndRect( point.x - 3, point.y - 3, point.x + 3, point.y + 3 ); CLgDRect AreaRect( WindowToArea( &WndRect ) );
CSensor *pActiveSensor = m_pSensorArray->GetSensor( AreaRect ); if( pActiveSensor ) { if( SetActiveSensor( pActiveSensor ) ) { CWnd *pParent = GetParent(); if( pParent ) pParent->SendMessage( WM_SENSOR_SHOW, (WPARAM)m_pActiveSensor, (LPARAM)m_pActiveSensor ); } } else { InvalidateRect( NULL ); }
CAreaWnd ::OnLButtonDown(nFlags, point);}*/
void CWholeAreaWnd::OnUIMapActivateObject( CLgUIMapObject* pActiveObject ){ LGLOG( LOG_LEVEL_REALTIME, LOG_TYPE_INFO, this, _T("CWholeAreaWnd::OnUIMapActivateObject"), _T("Started...") );
if( pActiveObject ) { CWnd *pParent = GetParent(); if( pParent ) pParent->SendMessage( WM_SENSOR_SHOW, (WPARAM)pActiveObject, (LPARAM)pActiveObject ); }
LGLOG( LOG_LEVEL_REALTIME, LOG_TYPE_INFO, this, _T("CWholeAreaWnd::OnUIMapActivateObject"), _T("Done") );}
/*
void CWholeAreaWnd::OnDraw(CDC *pDC){ CAreaSensorWnd::OnDraw( pDC );
if( m_pZoomAreaWnd ) { CRect rect = AreaToWindow( &m_pZoomAreaWnd->GetVisibleArea() );
DWORD pLine[2][4] = {{0,2,2,0},{2,0,0,2}}; LOGBRUSH LogBrush; LogBrush.lbStyle = BS_SOLID; LogBrush.lbColor = RGB(0xFF,0xFF,0xFF);
CPen pen( m_bOddUpdate ? PS_DOT : PS_DASH, 1, LogBrush.lbColor );// CPen pen( PS_USERSTYLE | PS_GEOMETRIC, 1, &LogBrush, 4, m_bOddUpdate ? pLine[0] : pLine[1] );
CPen *pPen = pDC->SelectObject( &pen ); int nROP2 = pDC->SetROP2( R2_XORPEN ); int nBkColor = pDC->SetBkColor( 0 );
pDC->MoveTo( rect.left, rect.top ); pDC->LineTo( rect.right, rect.top ); pDC->LineTo( rect.right, rect.bottom ); pDC->LineTo( rect.left, rect.bottom ); pDC->LineTo( rect.left, rect.top );
pDC->SetROP2( nROP2 ); pDC->SetBkColor( nBkColor ); pDC->SelectObject( pPen ); }}*//*
void CWholeAreaWnd::OnDrawTimer( CDC *pDC ){ CAreaSensorWnd::OnDrawTimer( pDC );
if( m_pZoomAreaWnd ) { CRect rect = AreaToWindow( &m_pZoomAreaWnd->GetVisibleArea() );
COLORREF color[2] = { RGB(0xFF,0xFF,0xFF), RGB(0,0,0) }; CPen pen( PS_DOT, 1, m_bOddUpdate ? color[0] : color[1] );
CPen *pPen = pDC->SelectObject( &pen ); int nBkColor = pDC->SetBkColor( m_bOddUpdate ? color[1] : color[0] );
pDC->MoveTo( rect.left, rect.top ); pDC->LineTo( rect.right, rect.top ); pDC->LineTo( rect.right, rect.bottom ); pDC->LineTo( rect.left, rect.bottom ); pDC->LineTo( rect.left, rect.top );
pDC->SetBkColor( nBkColor ); pDC->SelectObject( pPen ); }}
BOOL CWholeAreaWnd::SetActiveSensor( CSensor *pActiveSensor ){ if( CAreaSensorWnd::SetActiveSensor( pActiveSensor ) ) { if( m_pZoomAreaWnd ) m_pZoomAreaWnd->SetActiveSensor( pActiveSensor );
return TRUE; }
return FALSE;}*/
|