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

📄 demo.cpp

📁 winsail v2.0是用于DOS下的图形界面空间系统
💻 CPP
字号:
#include <Symbol.h>
#include <MyFrame.h>


int main3(int argc, char** argv)
{

	//Initlize Sysem Kernel 
	if (!::InitSystem(argc, argv))//初始化系统内核
	{
		::CloseSystem();//关闭系统内核
		printf("\nInit System Error!");
		return(0);
	}

	//Create a Dialog On the Center of Desktop
	CDialog* pDialog = new CDialog;//分配实例
	pDialog->CreateWindow(0, 0, 447, 201, "单选按钮演示");//建立窗口
	pDialog->Center();//窗口对中

	//Register Callback Function for Window
	pDialog->SetTimeFc(NULL);//注册定时器回调函数
	pDialog->SetDrawFc(NULL);//注册画图回调函数
	pDialog->SetHelpFc(NULL);//注册帮助回调函数
	pDialog->SetKeyboardFc(NULL);//注册虚拟键盘回调函数

	//Create Close's Button Control
	CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮

	//Create a Button Control
	CButton* pButton1 = new CButton(pDialog);
	pButton1->CreateObject(15, 162, 192, 24, "确定(\x3\E\x3)");
	pButton1->SetShortcutKey(VK_ALT_E);
	pButton1->SetFc(ClickEnterButton);
	pButton1->SetID(BUTTONBASE + 1 - 1);

	//Create a Button Control
	CButton* pButton2 = new CButton(pDialog);
	pButton2->CreateObject(231, 162, 192, 24, "取消(\x3\C\x3)");
	pButton2->SetShortcutKey(VK_ALT_C);
	pButton2->SetFc(ClickCancelButton);
	pButton2->SetID(BUTTONBASE + 2 - 1);

	//Create Group Control
	CStatic* pGroup1 = new CStatic(pDialog);
	pGroup1->CreateObject(10, 32, 204, 117, "星期");
	pGroup1->SetID(GROUPBASE + 1 - 1);

	//Create Radio Control
	CRadio* pRadio1 = new CRadio(pDialog);
	pRadio1->CreateObject(22, 53, 73, 24, "星期一");
	pRadio1->SetStatic(TRUE);
	pRadio1->SetRadio(TRUE);
	pRadio1->SetID(RADIOBASE + 1 - 1);

	//Create Radio Control
	CRadio* pRadio2 = new CRadio(pDialog);
	pRadio2->CreateObject(22, 83, 73, 24, "星期二");
	pRadio2->SetID(RADIOBASE + 2 - 1);

	//Create Radio Control
	CRadio* pRadio3 = new CRadio(pDialog);
	pRadio3->CreateObject(22, 113, 73, 24, "星期三");
	pRadio3->SetID(RADIOBASE + 3 - 1);

	//Create Group Control
	CStatic* pGroup2 = new CStatic(pDialog);
	pGroup2->CreateObject(226, 32, 204, 117, "性别");
	pGroup2->SetID(GROUPBASE + 2 - 1);

	//Create Radio Control
	CRadio* pRadio4 = new CRadio(pDialog);
	pRadio4->CreateObject(240, 53, 57, 24, "男性");
	pRadio4->SetStatic(TRUE);
	pRadio4->SetRadio(TRUE);
	pRadio4->SetID(RADIOBASE + 4 - 1);

	//Create Radio Control
	CRadio* pRadio5 = new CRadio(pDialog);
	pRadio5->CreateObject(240, 83, 57, 24, "女性");
	pRadio5->SetID(RADIOBASE + 5 - 1);


	//Show Window
	pDialog->ShowWindow();//显示窗口

	//go into Message Loop
	pDialog->DoModal();//进入窗口消息循环

	//Destroy Window 
	delete pDialog;//删除对话框


	//Close Sysem Kernel 
	::CloseSystem();//关闭系统内核

	return(1);

}

⌨️ 快捷键说明

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