my850page.cpp

来自「数据采集器pt850程序」· C++ 代码 · 共 68 行

CPP
68
字号

#include "My850Page.h"
#include <ufc/Middle/UMsgBox.h>

CMy850Page::CMy850Page()
{
}

CMy850Page::~CMy850Page()
{
}

void CMy850Page::OnInit(void)
{
	CUPage::OnInit();

	RECT r;
	r.top = 25;
	r.bottom = WIN_HEIGHT - 15;
	r.left = 10;
	r.right = WIN_WIDTH - 10;

	m_mMenu.Create(this, "Select a Item", 0, &r);
	m_mMenu.AppendMenu("Item 1", 1);
	m_mMenu.AppendMenu("Item 2", 10);
	m_mMenu.AppendMenu("Item 3", 100);
	m_mMenu.AppendMenu("Item 4", 1000);
	m_mMenu.Show();
}

void CMy850Page::OnNotify(CUWin *pWin, int nData, void *pDataEx)
{
	//When the Menu has been selected
	if (pWin == &m_mMenu && nData == NOTIFY_COMMAND)
	{
		switch(int(pDataEx))
		{
		case 1:
			{
				CUMsgBox box("ID 1 has been selected");
				box.DoModal();
				break;
			}
		case 10:
			{
				CUMsgBox box("ID 10 has been selected");
				box.DoModal();
				break;
			}
		case 100:
			{
				CUMsgBox box("ID 100 has been selected");
				box.DoModal();
				break;
			}
		case 1000:
			{
				CUMsgBox box("ID 1000 has been selected");
				box.DoModal();
				break;
			}
		default:
			break;
		}
	}

	CUPage::OnNotify(pWin, nData, pDataEx);
}

⌨️ 快捷键说明

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