📄 program_10_4.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 + -