|
// DemographicsFrame.cpp : implementation of the CDemographicsFrame class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resourcesp.h"
#include "aboutdlg.h"
#include "DemographicsView.h"
#include "DemographicsFrame.h"
#include "GPSDevice.h"
BOOL CDemographicsFrame::PreTranslateMessage(MSG* pMsg)
{
if(CFrameWindowImpl<CDemographicsFrame>::PreTranslateMessage(pMsg))
return TRUE;
return m_view.IsWindow() ? m_view.PreTranslateMessage(pMsg) : FALSE;
}
bool CDemographicsFrame::AppHibernate( bool bHibernate)
{
// Insert your code here or delete member if not relevant
return bHibernate;
}
bool CDemographicsFrame::AppNewInstance( LPCTSTR lpstrCmdLine)
{
// Insert your code here or delete member if not relevant
return false;
}
void CDemographicsFrame::AppSave()
{
// Insert your code here
}
void CDemographicsFrame::AppBackKey()
{
::SHNavigateBack();
}
BOOL CDemographicsFrame::OnIdle()
{
UIUpdateToolBar();
return FALSE;
}
LRESULT CDemographicsFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CAppInfo info;
m_bUseGPS = FALSE;
CreateSimpleCEMenuBar();
AtlActivateBackKey(m_hWndCECommandBar);
UIAddToolBar(m_hWndCECommandBar);
m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
// register object for message filtering and idle updates
CMessageLoop* pLoop = _Module.GetMessageLoop();
ATLASSERT(pLoop != NULL);
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);
return 0;
}
LRESULT CDemographicsFrame::OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
UseGPS( FALSE );
PostMessage(WM_CLOSE);
return 0;
}
LRESULT CDemographicsFrame::OnAction(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: add code
return 0;
}
LRESULT CDemographicsFrame::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CAboutDlg dlg;
FSDoModal(dlg);
return 0;
}
LRESULT CDemographicsFrame::OnUseGPS(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
m_bUseGPS = !m_bUseGPS;
UISetCheck( ID_MENU_USEGPS, m_bUseGPS );
UseGPS( m_bUseGPS );
return 0;
}
VOID CDemographicsFrame::UseGPS( BOOL bUse )
{
if( bUse )
CGPSDevice::TurnOn(&m_view);
else
CGPSDevice::TurnOff();
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.