Graphic Calculator: FIDocalcus
Проект трёх первокурсников (по инженерному практикуму в первом семестре) по созданию графического калькулятора на FLTK C++
Loading...
Searching...
No Matches
Graph_lib::Text Class Reference

#include <Shapes.h>

Inheritance diagram for Graph_lib::Text:
Collaboration diagram for Graph_lib::Text:

Public Member Functions

 Text (Point _loc, const std::string &s)
 
Color color () const
 
void draw () const
 
void draw_lines () const override
 
Color fill_color () const
 
Font font () const
 
unsigned int font_size () const
 
Line_style get_style () const
 
std::string label () const
 
virtual void move (int dx, int dy)
 
size_t number_of_points () const
 
Point point (int i) const
 
void set_color (Color _color)
 
void set_fill_color (Color _color)
 
void set_font (Font f)
 
void set_font_size (unsigned int s)
 
void set_label (const std::string &s)
 
void set_style (Line_style sty)
 

Protected Member Functions

void add (Point p)
 
void set_point (int i, Point p)
 

Private Attributes

Color c {static_cast<Color>(fl_color())}
 
Color f_c {Color::invisible}
 
Font fnt {static_cast<unsigned int>(fl_font())}
 
unsigned int fnt_sz
 
std::string lab
 
Line_style ls {0}
 
std::vector< Pointpoints
 

Constructor & Destructor Documentation

◆ Text()

Graph_lib::Text::Text ( Point _loc,
const std::string & s )
inline
290: lab{s} { add(_loc); }
void add(Point p)
Definition Shapes.h:176
std::string lab
Definition Shapes.h:313
Here is the call graph for this function:

Member Function Documentation

◆ add()

void Graph_lib::Shape::add ( Point p)
inlineprotectedinherited
176{ points.push_back(p); }
std::vector< Point > points
Definition Shapes.h:212
Here is the caller graph for this function:

◆ color()

Color Graph_lib::Shape::color ( ) const
inlineinherited
191{ return c; }
Color c
Definition Shapes.h:213
Here is the caller graph for this function:

◆ draw()

void Graph_lib::Shape::draw ( ) const
inherited
10 {
11 Fl_Color prev_color = fl_color(); // не существует хорошего портативного
12 // способа получения текущего стиля
15 draw_lines();
16 fl_color(prev_color); // reset color (к предыдущему) and style (к дефолтному)
18}
Line_style ls
Definition Shapes.h:214
virtual void draw_lines() const
Definition Shapes.cpp:20
W & reference_to(void *ptr_wid)
Definition Widgets.h:16
unsigned int as_uint() const
Definition Shapes.h:57
pix_amount w() const
Definition Shapes.h:94
unsigned int style() const
Definition Shapes.h:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw_lines()

void Graph_lib::Text::draw_lines ( ) const
overridevirtual

Reimplemented from Graph_lib::Shape.

71 {
72 int prev_font = fl_font();
73 int prev_size = fl_size();
75 fl_draw(lab.c_str(), point(0).x, point(0).y);
76 fl_font(prev_font, prev_size);
77}
unsigned int as_uint() const
Definition Shapes.h:138
Point point(int i) const
Definition Shapes.h:201
unsigned int fnt_sz
Definition Shapes.h:315
Font fnt
Definition Shapes.h:314
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_color()

Color Graph_lib::Shape::fill_color ( ) const
inlineinherited
199{ return f_c; }
Color f_c
Definition Shapes.h:215
Here is the caller graph for this function:

◆ font()

Font Graph_lib::Text::font ( ) const
inline
302{ return Font{fnt}; }

◆ font_size()

unsigned int Graph_lib::Text::font_size ( ) const
inline
306{ return fnt_sz; }

◆ get_style()

Line_style Graph_lib::Shape::get_style ( ) const
inlineinherited
195{ return ls; }

◆ label()

std::string Graph_lib::Text::label ( ) const
inline
298{ return lab; }
Here is the caller graph for this function:

◆ move()

void Graph_lib::Shape::move ( int dx,
int dy )
virtualinherited

Reimplemented in Graph_lib::Image.

28 {
29 for (unsigned int i = 0; i < points.size(); ++i) {
30 points[i].x += dx;
31 points[i].y += dy;
32 }
33}
Here is the caller graph for this function:

◆ number_of_points()

size_t Graph_lib::Shape::number_of_points ( ) const
inlineinherited
203{ return points.size(); }
Here is the caller graph for this function:

◆ point()

Point Graph_lib::Shape::point ( int i) const
inlineinherited
201{ return points[i]; }
Here is the caller graph for this function:

◆ set_color()

void Graph_lib::Shape::set_color ( Color _color)
inlineinherited
189{ c = _color; }
Here is the caller graph for this function:

◆ set_fill_color()

void Graph_lib::Shape::set_fill_color ( Color _color)
inlineinherited
197{ f_c = _color; }

◆ set_font()

void Graph_lib::Text::set_font ( Font f)
inline
300{ fnt = f; }

◆ set_font_size()

void Graph_lib::Text::set_font_size ( unsigned int s)
inline
304{ fnt_sz = s; }
Here is the caller graph for this function:

◆ set_label()

void Graph_lib::Text::set_label ( const std::string & s)
inline
296{ lab = s; }
Here is the caller graph for this function:

◆ set_point()

void Graph_lib::Shape::set_point ( int i,
Point p )
inlineprotectedinherited
178{ points[i] = p; }

◆ set_style()

void Graph_lib::Shape::set_style ( Line_style sty)
inlineinherited
193{ ls = sty; }

Member Data Documentation

◆ c

Color Graph_lib::Shape::c {static_cast<Color>(fl_color())}
privateinherited
213{static_cast<Color>(fl_color())};

◆ f_c

Color Graph_lib::Shape::f_c {Color::invisible}
privateinherited
@ invisible
Definition Shapes.h:41

◆ fnt

Font Graph_lib::Text::fnt {static_cast<unsigned int>(fl_font())}
private
314{static_cast<unsigned int>(fl_font())};

◆ fnt_sz

unsigned int Graph_lib::Text::fnt_sz
private
Initial value:
{(14 < fl_size()) ? static_cast<unsigned int>(fl_size())
: 14}
315 {(14 < fl_size()) ? static_cast<unsigned int>(fl_size())
316 : 14}; // минимум 14

◆ lab

std::string Graph_lib::Text::lab
private

◆ ls

Line_style Graph_lib::Shape::ls {0}
privateinherited
214{0};

◆ points

std::vector<Point> Graph_lib::Shape::points
privateinherited

The documentation for this class was generated from the following files: