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

Кнопка, которая имеет номер More...

#include <Numbed_button.h>

Inheritance diagram for Graphix_calc::Numbed_button:
Collaboration diagram for Graphix_calc::Numbed_button:

Public Member Functions

 Numbed_button (Graph_lib::Point _loc, pix_amount _width, pix_amount _height, const std::string &label, unsigned long long _number, void callback(void *, void *))
 
 Numbed_button (Graph_lib::Point _loc, pix_amount _width, pix_amount _height, const std::string &label, void callback(void *, void *))
 
 ~Numbed_button ()=default
 
void attach (Window &)
 
unsigned long long get_number () const
 
virtual void hide ()
 
virtual void move (int dx, int dy)
 
void set_number (unsigned long long value)
 
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

unsigned long long number
 

Detailed Description

Кнопка, которая имеет номер

Constructor & Destructor Documentation

◆ Numbed_button() [1/2]

Graphix_calc::Numbed_button::Numbed_button ( Graph_lib::Point _loc,
pix_amount _width,
pix_amount _height,
const std::string & label,
void callbackvoid *, void * )
inline
14 : Graph_lib::Button{_loc, _width, _height, label, callback}, number{0} {}
std::string label
Definition Widgets.h:66
unsigned long long number
Definition Numbed_button.h:35
Definition Widgets.h:74

◆ Numbed_button() [2/2]

Graphix_calc::Numbed_button::Numbed_button ( Graph_lib::Point _loc,
pix_amount _width,
pix_amount _height,
const std::string & label,
unsigned long long _number,
void callbackvoid *, void * )
inline
19 : Graph_lib::Button{_loc, _width, _height, label, callback},
20 number{_number} {}

◆ ~Numbed_button()

Graphix_calc::Numbed_button::~Numbed_button ( )
default

Member Function Documentation

◆ attach()

void Graph_lib::Button::attach ( Window & win)
virtualinherited

Implements Graph_lib::Widget.

20 {
21 // (FLTK работает на int'ах, так что преобразуем)
22 ptr_wid = new Fl_Button{int(loc.x), int(loc.y), int(width), int(height),
23 label.c_str()};
24 // (великий и ужасный...)
25 ptr_wid->callback(reinterpret_cast<Fl_Callback*>(cb), this);
26 own = &win;
27}
Window * own
Окно, которому принадлежит виджет
Definition Widgets.h:57
pix_amount width
Definition Widgets.h:63
pix_amount height
Definition Widgets.h:64
Callback cb
Definition Widgets.h:67
Point loc
Definition Widgets.h:62
Fl_Widget * ptr_wid
Указатель на FLTK виджет
Definition Widgets.h:60
W & reference_to(void *ptr_wid)
Definition Widgets.h:16
pix_amount y
Definition Point.h:30
pix_amount x
Definition Point.h:30

◆ get_number()

unsigned long long Graphix_calc::Numbed_button::get_number ( ) const
inline
26{ return number; }
Here is the caller graph for this function:

◆ hide()

virtual void Graph_lib::Widget::hide ( )
inlinevirtualinherited
41{ ptr_wid->hide(); }
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_number()

void Graphix_calc::Numbed_button::set_number ( unsigned long long value)
inline
28{ number = value; }
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

◆ label

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

◆ loc

Point Graph_lib::Widget::loc
protectedinherited

◆ number

unsigned long long Graphix_calc::Numbed_button::number
private

◆ own

Window* Graph_lib::Widget::own
protectedinherited

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

◆ ptr_wid

Fl_Widget* Graph_lib::Widget::ptr_wid
protectedinherited

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

◆ width

pix_amount Graph_lib::Widget::width
protectedinherited

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