Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
terminal_gui/include/textbox.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33 lines (24 sloc)
438 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TEXTBOX_H | |
#define TEXTBOX_H | |
#include <iostream> | |
#include <iomanip> | |
#include <string> | |
#include <sstream> | |
#include "drawable.h" | |
class TextBox : public Drawable | |
{ | |
public: | |
int width; | |
std::stringstream ss; | |
TextBox( int _x, int _y, int _width) | |
: Drawable( _x, _y ), width(_width) {} | |
void draw() const; | |
void clear(); | |
}; | |
template<typename T> | |
TextBox& operator<<( TextBox& os, T t ) | |
{ | |
os.ss << t; | |
return os; | |
} | |
#endif |