-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_example.cpp
More file actions
82 lines (69 loc) · 2.71 KB
/
Copy pathbasic_example.cpp
File metadata and controls
82 lines (69 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* TUIX Basic Example
*
* This example demonstrates the basic features of the TUIX library
* including colors, text formatting, and simple UI elements.
*/
#include <tuix/tuix.hpp>
#include <iostream>
using namespace tuix;
int main() {
// Print a banner
utils::print_banner("TUIX Basic Example", "1.0.0");
// Print a title
print_title("Welcome to TUIX!", 50);
std::cout << "\n";
// Demonstrate colors
std::cout << color::bold("Text Colors:") << "\n";
std::cout << color::red("This text is red") << "\n";
std::cout << color::green("This text is green") << "\n";
std::cout << color::blue("This text is blue") << "\n";
std::cout << color::yellow("This text is yellow") << "\n";
std::cout << "\n";
// Demonstrate text styles
std::cout << color::bold("Text Styles:") << "\n";
std::cout << color::bold("This text is bold") << "\n";
std::cout << color::italic("This text is italic") << "\n";
std::cout << color::underline("This text is underlined") << "\n";
std::cout << color::dim("This text is dimmed") << "\n";
std::cout << "\n";
// Demonstrate text alignment
std::cout << color::bold("Text Alignment:") << "\n";
std::cout << left("Left aligned text", 40, '.') << "|\n";
std::cout << center("Centered text", 40, '.') << "|\n";
std::cout << right("Right aligned text", 40, '.') << "|\n";
std::cout << "\n";
// Demonstrate a simple box
std::cout << color::bold("Box Example:") << "\n";
box simple_box("This is a simple box with a title and some content.\n"
"Boxes are great for highlighting important information.");
simple_box.set_title("Information");
std::cout << simple_box << "\n";
// Demonstrate a simple table
std::cout << color::bold("Table Example:") << "\n";
table simple_table;
simple_table.set_headers({"Name", "Age", "City"})
.add_row({"John", "25", "New York"})
.add_row({"Alice", "30", "London"})
.add_row({"Bob", "22", "Paris"});
std::cout << simple_table << "\n";
// Demonstrate logging
std::cout << color::bold("Logging Example:") << "\n";
log_info("This is an info message");
log_warning("This is a warning message");
log_error("This is an error message");
log_success("This is a success message");
std::cout << "\n";
// Demonstrate a bullet list
std::cout << color::bold("Bullet List Example:") << "\n";
print_bullet_list({
"First item in the list",
"Second item in the list",
"Third item in the list"
});
std::cout << "\n";
// End the program
std::cout << "Press Enter to exit...";
std::cin.get();
return 0;
}