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

#include <Point_box.h>

Inheritance diagram for Graphix_calc::Point_box:
Collaboration diagram for Graphix_calc::Point_box:

Public Member Functions

 Point_box (pix_amount window_w, pix_amount window_h, void cb_show(void *, void *), void cb_hide(void *, void *))
 
 ~Point_box ()
 
void attach (Graph_lib::Window &)
 
void detach (Graph_lib::Window &)
 
virtual void hide ()
 
virtual void move (int dx, int dy)
 
virtual void show ()
 
Window & window ()
 

Protected Attributes

Callback cb
 
pix_amount height
 
std::string label
 
Point loc
 
Window * own
 Окно, которому принадлежит виджет
 
Fl_Widget * ptr_wid
 Указатель на FLTK виджет
 
pix_amount width
 

Private Attributes

Graph_lib::Buttonhide_button
 
Graph_lib::Buttonshow_button
 

Constructor & Destructor Documentation

◆ Point_box()

Graphix_calc::Point_box::Point_box ( pix_amount window_w,
pix_amount window_h,
void cb_showvoid *, void *,
void cb_hidevoid *, void * )
17 : show_button{new Button{
18 Point{window_w - btn_w * 2 - margin / 2, window_h - btn_h}, btn_w,
19 btn_h, "Show", cb_show}},
20 hide_button{new Button{Point{window_w - btn_w, window_h - btn_h}, btn_w,
21 btn_h, "Hide", cb_hide}} {}
Graph_lib::Button * hide_button
Definition Point_box.h:30
Graph_lib::Button * show_button
Definition Point_box.h:29
constexpr pix_amount btn_w
Стандартная ширина кнопки
Definition constants.h:43
constexpr pix_amount margin
Вспомогательный отступ
Definition constants.h:40
constexpr pix_amount btn_h
Стандартная высота кнопки
Definition constants.h:45
Definition Widgets.h:74
Definition Point.h:7

◆ ~Point_box()

Graphix_calc::Point_box::~Point_box ( )
23 {
24 delete show_button;
25 delete hide_button;
26}

Member Function Documentation

◆ attach()

void Graphix_calc::Point_box::attach ( Graph_lib::Window & win)
virtual

Implements Graph_lib::Widget.

28 {
29 win.attach(*show_button);
30 win.attach(*hide_button);
31 own = &win;
32}
Window * own
Окно, которому принадлежит виджет
Definition Widgets.h:57

◆ detach()

void Graphix_calc::Point_box::detach ( Graph_lib::Window & win)
34 {
35 win.attach(*show_button);
36 win.attach(*hide_button);
37 own = &win;
38}

◆ hide()

virtual void Graph_lib::Widget::hide ( )
inlinevirtualinherited
41{ ptr_wid->hide(); }
Fl_Widget * ptr_wid
Указатель на FLTK виджет
Definition Widgets.h:60
Here is the caller graph for this function:

◆ move()

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

Reimplemented in Graphix_calc::Function_box.

9 {
10 if (dx + int(loc.x) < 0 || dy + int(loc.y) < 0)
11 throw std::invalid_argument("bad dx or dy");
12
13 hide();
14 ptr_wid->position(loc.x += dx, loc.y += dy);
15 show();
16}
virtual void hide()
Definition Widgets.h:41
virtual void show()
Definition Widgets.h:43
Point loc
Definition Widgets.h:62
pix_amount y
Definition Point.h:30
pix_amount x
Definition Point.h:30
Here is the call graph for this function:
Here is the caller graph for this function:

◆ show()

virtual void Graph_lib::Widget::show ( )
inlinevirtualinherited
43{ ptr_wid->show(); }
Here is the caller graph for this function:

◆ window()

Window & Graph_lib::Widget::window ( )
inlineinherited
47{ return *own; }

Member Data Documentation

◆ cb

Callback Graph_lib::Widget::cb
protectedinherited

◆ height

pix_amount Graph_lib::Widget::height
protectedinherited

◆ hide_button

Graph_lib::Button* Graphix_calc::Point_box::hide_button
private

◆ label

std::string Graph_lib::Widget::label
protectedinherited

◆ loc

Point Graph_lib::Widget::loc
protectedinherited

◆ own

Window* Graph_lib::Widget::own
protectedinherited

Окно, которому принадлежит виджет

◆ ptr_wid

Fl_Widget* Graph_lib::Widget::ptr_wid
protectedinherited

Указатель на FLTK виджет

◆ show_button

Graph_lib::Button* Graphix_calc::Point_box::show_button
private

◆ width

pix_amount Graph_lib::Widget::width
protectedinherited

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