You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+109Lines changed: 109 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,3 +105,112 @@ You can customize the build with the following CMake options:
105
105
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
106
106
4. Push to the branch (`git push origin feature/AmazingFeature`)
107
107
5. Open a Pull Request
108
+
109
+
# SinesBox Library Documentation
110
+
111
+
## Overview
112
+
113
+
SinesBox is a C++ library for creating colorful, customizable text boxes in terminal applications. It provides an easy-to-use interface for drawing text boxes with various styling options, including color selection, bold formatting, and rainbow-styled borders.
114
+
115
+
## Features
116
+
117
+
- Customizable text box drawing
118
+
- Support for multiple text colors
119
+
- Border styling (normal and bold)
120
+
- Background color options
121
+
- Automatic text wrapping
122
+
- Rainbow border mode
123
+
- UTF-8 compatible
124
+
125
+
## Installation
126
+
127
+
### Prerequisites
128
+
- C++ compiler with C++11 support
129
+
- Linux or macOS (uses `sys/ioctl.h` for terminal width detection)
130
+
131
+
### Basic Usage
132
+
133
+
```cpp
134
+
#include"SinesBox.h"
135
+
#include"SinesGlobalSettings.h"
136
+
137
+
intmain() {
138
+
// Initialize global settings (UTF-8 support)
139
+
SinesBoxLib::SinesGlobalSettings::initialize();
140
+
141
+
// Create a SinesBox instance
142
+
SinesBoxLib::SinesBox box;
143
+
144
+
// Set text and styling
145
+
box.setText("Hello, World! This is a sample text box.");
146
+
box.setTextColor("green");
147
+
box.setBorderColor("blue");
148
+
box.setBorderBold(true);
149
+
150
+
// Draw the box
151
+
box.draw();
152
+
153
+
return 0;
154
+
}
155
+
```
156
+
157
+
## API Reference
158
+
159
+
### `SinesBox` Class Methods
160
+
161
+
#### Constructors
162
+
-`SinesBox()`: Creates a new SinesBox instance with default settings
163
+
164
+
#### Text Methods
165
+
-`void setText(const std::string& text)`: Sets the text to be displayed in the box
166
+
- Automatically wraps text to fit terminal width
167
+
168
+
#### Color Methods
169
+
-`void setBorderColor(const std::string& color)`: Sets the border color
170
+
-`void setTextColor(const std::string& color)`: Sets the text color
171
+
-`void setBackgroundColor(const std::string& color)`: Sets the background color
0 commit comments