Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

131 lines
2.8 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: LgUICameraListWnd.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of LgUICameraListWnd.cpp
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "LgUICameraListWnd.h"
#include "LgUICameraEngine.h"
CLgUICameraListWnd::CLgUICameraListWnd()
{
}
CLgUICameraListWnd::~CLgUICameraListWnd()
{
DestroyWindow();
}
BOOL CLgUICameraListWnd::Link( CLgLink<CLgUICameraVideoWnd,CLgUICameraListWnd>* pVideoWnd )
{
if( !CLgLink<CLgUICameraListWnd,CLgUICameraVideoWnd>::Link( pVideoWnd ) )
return FALSE;
if( CLgListWnd::IsExist( *pVideoWnd ) )
return TRUE;
if( !CLgListWnd::Add( *pVideoWnd ) )
return FALSE;
return TRUE;
}
BOOL CLgUICameraListWnd::Unlink( CLgLink<CLgUICameraVideoWnd,CLgUICameraListWnd>* pVideoWnd )
{
if( !CLgLink<CLgUICameraListWnd,CLgUICameraVideoWnd>::Unlink( pVideoWnd ) )
return FALSE;
if( !CLgListWnd::IsExist( *pVideoWnd ) )
return TRUE;
if( !CLgListWnd::Remove( *pVideoWnd ) )
return FALSE;
return TRUE;
}
BEGIN_MESSAGE_MAP(CLgUICameraListWnd, CLgListWnd)
//{{AFX_MSG_MAP(CLgUICameraListWnd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CLgUICameraListWnd::Create( CWnd *pParentWnd, int x, int y, int nWidth, int nHeight )
{
if( !CLgListWnd::Create( pParentWnd, x, y, nWidth, nHeight ) )
return FALSE;
CLgListWnd::ModifyStyle( 0, WS_DLGFRAME | WS_CLIPSIBLINGS );
if( !SetItemSize( CSize(160,120) ) )
return FALSE;
return TRUE;
}
BOOL CLgUICameraListWnd::DestroyWindow()
{
CLgLink<CLgUICameraListWnd,CLgUICameraVideoWnd>::Unlink();
return CLgListWnd::DestroyWindow();
}
void CLgUICameraListWnd::OnItemMove( void* pItem, CRect *pRect, BOOL bShow, BOOL bActive )
{
CWnd *pWnd = (CWnd*)pItem;
if( !pWnd )
return;
if( bShow )
{
pWnd->ShowWindow( SW_SHOW );
pWnd->MoveWindow( pRect );
}
else
pWnd->ShowWindow( SW_HIDE );
}
void CLgUICameraListWnd::OnItemAdd( void* pItem )
{
CWnd *pWnd = (CWnd*)pItem;
if( !pWnd )
return;
pWnd->SetParent( this );
pWnd->ShowWindow( SW_SHOW );
}
void CLgUICameraListWnd::OnItemRemove( void *pItem )
{
CWnd *pWnd = (CWnd*)pItem;
if( !pWnd )
return;
if( pWnd->GetSafeHwnd() )
pWnd->ShowWindow( SW_HIDE );
}
BOOL CLgUICameraListWnd::SetActiveVideo( CLgUICameraVideoWnd* pVideoWnd )
{
// check pointer
if( !pVideoWnd )
return FALSE;
// get associated engine
CLgUICameraEngine *pEngine = *this;
if( !pEngine )
return FALSE;
return pEngine->SetActiveVideo( pVideoWnd );
}