NOCL  v0.1.0-2524
Modern C++ Class Library for GUI Projects
nocl::SpinButton Class Reference

Entryfield with buttons to increment or decrement the value in the text field. More...

#include <SpinButton.hpp>

Inheritance diagram for nocl::SpinButton:
Collaboration diagram for nocl::SpinButton:

Public Member Functions

virtual ~SpinButton (void)
 Destructor. More...
 
 SpinButton (void)
 Constructor. More...
 
 SpinButton (const int initial_value, const int min_value, const int max_value)
 Constructor. More...
 
 SpinButton (const double initial_value, const double min_value, const double max_value, const double step_value=0.1)
 Constructor. More...
 
virtual operator GtkSpinButton * (void) const
 Convert an instance of nocl::SpinButton to GtkSpinButton*. More...
 
SpinButtonvalue (const int new_value)
 
SpinButtonvalue (const double new_value)
 
int value_int (void) const
 
double value_double (void) const
 
SpinButtonget_range (int &min_range, int &max_range)
 
SpinButtonget_range (double &min_range, double &max_range)
 
SpinButtonset_range (const int min_range, const int max_range)
 
SpinButtonset_range (const double min_range, const double max_range)
 
bool wrap (void) const
 
SpinButtonwrap (const bool toggle)
 
virtual operator GtkEntry * (void) const
 Convert an instance of nocl::TextField to GtkEntry*. More...
 
std::string text (void) const
 
TextFieldtext (const std::string &new_text)
 
virtual operator GtkWidget * (void) const
 Convert an instance of GUIComponent to GtkWidget*. More...
 
virtual GUIComponentmove_to (const Point &p)
 Move to the specified coordinates. More...
 
virtual Size natural_size (void)
 Get the natural size of a widget. More...
 
virtual Size minimum_size (void)
 Get the minimum size of a widget. More...
 
virtual GUIComponentminimum_size (const Size &s)
 Set the minimum size of a widget. More...
 
virtual GUIComponentminimum_size (const int width, const int height)
 Set the minimum size of a widget. More...
 
virtual GUIComponentshow (const bool toggle=true)
 Make the immediate component visible. More...
 
virtual GUIComponentshow_all (const bool toggle=true)
 Make the component and all child components visible. More...
 
virtual GUIComponenthide (void)
 Hide a single component. More...
 
virtual bool is_visible (void) const
 Determine if the widget is shown. More...
 

Static Public Member Functions

static WidgetToGUIComponentMapwidget_to_gui_component_map (void)
 There are times when we have a pointer to a Gtk+ widget, and we need to map it back to the corresponding NOCL GUI component. More...
 

Public Attributes

Containerparent
 Pointer to the parent to which we've been added. Will be nullptr if this object hasn't been added to a parent container. More...
 
GtkWidget * gtk_widget
 Pointer to the underlying GTK framework. More...
 

Detailed Description

Entryfield with buttons to increment or decrement the value in the text field.

This corresponds to GtkSpinButton.

SpinButton.png
See also
nocl::TextField
https://developer.gnome.org/gtk3/stable/GtkEntry.html

Constructor & Destructor Documentation

◆ ~SpinButton()

nocl::SpinButton::~SpinButton ( void  )
virtual

Destructor.

◆ SpinButton() [1/3]

nocl::SpinButton::SpinButton ( void  )

Constructor.

◆ SpinButton() [2/3]

nocl::SpinButton::SpinButton ( const int  initial_value,
const int  min_value,
const int  max_value 
)

Constructor.

Exceptions
nocl::ExceptionThrows if GTK+ fails to create a new window.

References nocl::GUIComponent::gtk_widget, NOCL_WHERE, and value().

Here is the call graph for this function:

◆ SpinButton() [3/3]

nocl::SpinButton::SpinButton ( const double  initial_value,
const double  min_value,
const double  max_value,
const double  step_value = 0.1 
)

Constructor.

Exceptions
nocl::ExceptionThrows if GTK+ fails to create a new window.

References nocl::GUIComponent::gtk_widget, NOCL_WHERE, and value().

Here is the call graph for this function:

Member Function Documentation

◆ operator GtkSpinButton *()

nocl::SpinButton::operator GtkSpinButton * ( void  ) const
virtual

Convert an instance of nocl::SpinButton to GtkSpinButton*.

Exceptions
nocl::ExceptionObject was not created correctly and cannot be converted to GtkSpinButton*.

References nocl::GUIComponent::gtk_widget, and NOCL_WHERE.

◆ value() [1/2]

nocl::SpinButton & nocl::SpinButton::value ( const int  new_value)

Referenced by SpinButton().

Here is the caller graph for this function:

◆ value() [2/2]

nocl::SpinButton & nocl::SpinButton::value ( const double  new_value)

◆ value_int()

int nocl::SpinButton::value_int ( void  ) const

◆ value_double()

double nocl::SpinButton::value_double ( void  ) const

◆ get_range() [1/2]

nocl::SpinButton & nocl::SpinButton::get_range ( int &  min_range,
int &  max_range 
)

◆ get_range() [2/2]

nocl::SpinButton & nocl::SpinButton::get_range ( double &  min_range,
double &  max_range 
)

◆ set_range() [1/2]

nocl::SpinButton & nocl::SpinButton::set_range ( const int  min_range,
const int  max_range 
)

◆ set_range() [2/2]

nocl::SpinButton & nocl::SpinButton::set_range ( const double  min_range,
const double  max_range 
)

◆ wrap() [1/2]

bool nocl::SpinButton::wrap ( void  ) const

◆ wrap() [2/2]

nocl::SpinButton & nocl::SpinButton::wrap ( const bool  toggle)

◆ operator GtkEntry *()

nocl::TextField::operator GtkEntry * ( void  ) const
virtualinherited

Convert an instance of nocl::TextField to GtkEntry*.

Exceptions
nocl::ExceptionObject was not created correctly and cannot be converted to GtkEntry*.

References nocl::GUIComponent::gtk_widget, and NOCL_WHERE.

◆ text() [1/2]

std::string nocl::TextField::text ( void  ) const
inherited

Referenced by nocl::TextField::TextField().

Here is the caller graph for this function:

◆ text() [2/2]

nocl::TextField & nocl::TextField::text ( const std::string &  new_text)
inherited

◆ operator GtkWidget *()

nocl::GUIComponent::operator GtkWidget * ( void  ) const
virtualinherited

Convert an instance of GUIComponent to GtkWidget*.

References nocl::GUIComponent::gtk_widget.

◆ move_to()

nocl::GUIComponent & nocl::GUIComponent::move_to ( const Point p)
virtualinherited

Move to the specified coordinates.

Todo:

◆ natural_size()

nocl::Size nocl::GUIComponent::natural_size ( void  )
virtualinherited

Get the natural size of a widget.

References nocl::GUIComponent::minimum_size().

Referenced by nocl::GUIComponent::minimum_size().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ minimum_size() [1/3]

nocl::Size nocl::GUIComponent::minimum_size ( void  )
virtualinherited

Get the minimum size of a widget.

References nocl::GUIComponent::natural_size().

Referenced by nocl::GUIComponent::minimum_size(), and nocl::GUIComponent::natural_size().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ minimum_size() [2/3]

nocl::GUIComponent & nocl::GUIComponent::minimum_size ( const Size s)
virtualinherited

Set the minimum size of a widget.

References nocl::Size::height, nocl::GUIComponent::minimum_size(), and nocl::Size::width.

Here is the call graph for this function:

◆ minimum_size() [3/3]

nocl::GUIComponent & nocl::GUIComponent::minimum_size ( const int  width,
const int  height 
)
virtualinherited

Set the minimum size of a widget.

◆ show()

nocl::GUIComponent & nocl::GUIComponent::show ( const bool  toggle = true)
virtualinherited

Make the immediate component visible.

Parameters
[in]toggleSet to true to show the widget, or to false to hide the widget.
See also
hide()
show_all()
is_visible()

References nocl::GUIComponent::gtk_widget, and nocl::GUIComponent::hide().

Here is the call graph for this function:

◆ show_all()

nocl::GUIComponent & nocl::GUIComponent::show_all ( const bool  toggle = true)
virtualinherited

Make the component and all child components visible.

Parameters
[in]toggleSet to true to show the widget and all children, or to false to hide the widget.
See also
show()
hide()
is_visible()

References nocl::GUIComponent::gtk_widget, and nocl::GUIComponent::hide().

Here is the call graph for this function:

◆ hide()

nocl::GUIComponent & nocl::GUIComponent::hide ( void  )
virtualinherited

Hide a single component.

See also
show()
show_all()
is_visible()

References nocl::GUIComponent::gtk_widget.

Referenced by nocl::GUIComponent::show(), and nocl::GUIComponent::show_all().

Here is the caller graph for this function:

◆ is_visible()

bool nocl::GUIComponent::is_visible ( void  ) const
virtualinherited

Determine if the widget is shown.

See also
show()
show_all()
hide()

References nocl::GUIComponent::gtk_widget.

◆ widget_to_gui_component_map()

nocl::WidgetToGUIComponentMap & nocl::GUIComponent::widget_to_gui_component_map ( void  )
staticinherited

There are times when we have a pointer to a Gtk+ widget, and we need to map it back to the corresponding NOCL GUI component.

For example, during event handling, Gtk+ tells us which Gtk+ widget generated the event, but we need the corresponding NOCL object so we can call the event handler with a reference to the correct object.

Note
This is not intended for end-users to access directly!

Referenced by nocl::ButtonHandler::handle_button_events_for(), and nocl::GUIComponent::~GUIComponent().

Here is the caller graph for this function:

Member Data Documentation

◆ parent

Container* nocl::GUIComponent::parent
inherited

Pointer to the parent to which we've been added. Will be nullptr if this object hasn't been added to a parent container.

Referenced by nocl::Container::add_child(), nocl::Grid::add_child(), nocl::Container::remove_child(), and nocl::GUIComponent::~GUIComponent().

◆ gtk_widget


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