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

📄 program_10_4.cpp

📁 c++程序设计讲义 cppprograming 含源码
💻 CPP
字号:
// Program to illustrate mechanics of API program
#include <iostream>
#include <string>
#include <cassert>
#include <ezwin>
using namespace std;

SimpleWindow HelloWindow("Hello EzWindows", 10., 4., Position(5., 6.));

//ApiMain(): demonstrate using cin with EzWindows
int ApiMain() {
	HelloWindow.Open();
	assert(HelloWindow.GetStatus() == WindowOpen);

	cout << "Enter the location in the window\n"
		<< "to write the text (e.g., 4 6): ";
	int XCoordinate;
	int YCoordinate;
	cin >> XCoordinate >> YCoordinate;

	Position Location(XCoordinate, YCoordinate);
	Position UpperLeft = Location+ Position(-1., -1.);
	Position LowerRight = Location+ Position(1., 1.);

	// Display the text
	HelloWindow.RenderText(UpperLeft, LowerRight, "Hello Ezwindows", Black);

	cout << "Text was rendered at " << XCoordinate
		<< ", " << YCoordinate << endl;
	
	return 0;
}

// ApiEnd(): shutdown the window
int ApiEnd() {
	HelloWindow.Close();

	return 0;
}

⌨️ 快捷键说明

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