⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demographicsframe.cpp

📁 GPS and Web Service using C++ ATLWTL 源代码
💻 CPP
字号:
// 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();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -