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

📄 testview2.cpp

📁 一个小巧的嵌入式图形系统wGUI, 可以用VC编译
💻 CPP
字号:
// TestView2.cpp//// test view for the wGui library////// Copyright (c) 2002 Rob Wiskow// rob-dev@boxedchaos.com//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//#include "TestView2.h"CTestView::CTestView(void) :	wGui::CView(wGui::CRect(0, 0, 800, 600), "Test App 2", false, false){	SetWindowText(std::string("Test App 2 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String());	m_pCreateFrameButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 20, 140, 40)), this, "Create Frame");	m_pExitButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 50, 140, 70)), this, "Exit");	wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK);}bool CTestView::HandleMessage(wGui::CMessage* pMessage){	bool bHandled = false;	if (pMessage)	{		switch (pMessage->MessageType())		{		case wGui::CMessage::CTRL_LCLICK:		{			if (pMessage->Destination() == this)			{				if (pMessage->Source() == m_pCreateFrameButton)				{					new CSimpleTestFrame(wGui::CPoint(rand() % 660, rand() % 520), this);					wGui::CMessageServer::Instance().QueueMessage(new wGui::CMessage(wGui::CMessage::APP_PAINT, 0, this));					bHandled = true;				}				else if (pMessage->Source() == m_pExitButton)				{					wGui::CMessageServer::Instance().QueueMessage(new wGui::CMessage(wGui::CMessage::APP_EXIT, 0, this));					bHandled = true;				}			}		}		default:			bHandled = CView::HandleMessage(pMessage);			break;		}	}	return bHandled;}

⌨️ 快捷键说明

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