xtd 0.2.0
console_cursor_size.cpp

Shows how to use xtd::console::cursor_size property.

#include <xtd/console>
using namespace xtd;
auto main() -> int {
auto m0 = "This example increments the cursor size from 1% to 100%:\n";
auto m1 = "Cursor size = {0}%. (Press any key to continue...)";
auto sizes = { 1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
auto save_cursor_size = console::cursor_size();
for (auto size : sizes) {
}
console::cursor_size(save_cursor_size);
}
// This code produces the following output :
//
// This example increments the cursor size from 1% to 100%:
//
// Cursor size = 1%. (Press any key to continue...)
// Cursor size = 10%. (Press any key to continue...)
// Cursor size = 20%. (Press any key to continue...)
// Cursor size = 30%. (Press any key to continue...)
// Cursor size = 40%. (Press any key to continue...)
// Cursor size = 50%. (Press any key to continue...)
// Cursor size = 60%. (Press any key to continue...)
// Cursor size = 70%. (Press any key to continue...)
// Cursor size = 80%. (Press any key to continue...)
// Cursor size = 90%. (Press any key to continue...)
// Cursor size = 100%. (Press any key to continue...)
static int32 cursor_size()
Gets or sets the height of the cursor within a character cell.
static console_key_info read_key()
Obtains the next character or function key pressed by the user. The pressed key is displayed in the c...
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8