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

📄 mainfrm.cpp

📁 一个简单的地理信息系统
💻 CPP
字号:
// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "blc.h"

#include "MainFrm.h"
//#define ID_INDICATOR_COOR USE+1
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CMainFrame)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
	ID_SEPARATOR,           // status line indicator
	ID_INDICATOR_CAPS,
 	ID_INDICATOR_NUM,
 	ID_INDICATOR_SCRL,
  	ID_SEPARATOR, 
	ID_SEPARATOR, 
};

/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
	// TODO: add member initialization code here
//   m_wndStatusBar.SetIndicators(indicators,5);
}

CMainFrame::~CMainFrame()
{
}

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	 //	AfxMessageBox("wajfj");	
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
//	AfxMessageBox("wajfj");	
	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
		
	}  
//	AfxMessageBox("wajfj");	
      m_wndStatusBar.SetPaneText(4,"X:0        mm,Y:0          mm");
  // 	AfxMessageBox("wajfj");	
     m_wndStatusBar.SetPaneInfo(5,0,SBPS_NOBORDERS,28);
     m_wndStatusBar.SetPaneText(5,"王妍");
  // 	AfxMessageBox("wajfj");	
   // TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
 	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);
	if(!m_wndDlgBar.Create(this,IDD_DIALOGBAR,CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY,IDD_DIALOGBAR))
	{
		TRACE0("Failed to Create DialogBar\n");
		return -1;
	}
	
	CComboBox *p_Com1=(CComboBox *)m_wndDlgBar.GetDlgItem(IDC_COMBO1);
/*	p_Com1->ResetContent();
	p_Com1->AddString("PS_SOLID _________");
	p_Com1->AddString("PS_DASH __ __ __ ");
	p_Com1->AddString("PS_DOT _ _ _ _ _");
	p_Com1->AddString("PS_DASHDOT _ __ _ __ _ __");
	p_Com1->AddString("PS_DASHDOTDOT _ _ __ _ _ __");
	p_Com1->AddString("PS_NULL _________");
	p_Com1->AddString("PS_INSIDEEFRAME _________");
	p_Com1->SetCurSel(0);*/
	CComboBox *p_Com2=(CComboBox *)m_wndDlgBar.GetDlgItem(IDC_COMBO2);
/*	p_Com2->ResetContent();
	p_Com2->AddString("1");
	p_Com2->AddString("2 ");
	p_Com2->AddString("3");
	p_Com2->AddString("4");
	p_Com2->AddString("5");
	p_Com2->AddString("6");
	p_Com2->AddString("7");
	p_Com2->SetCurSel(0);*/
	return 0;
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
	CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
	CFrameWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers

⌨️ 快捷键说明

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