SBB Host
Host communication with the self balancing bike.
Loading...
Searching...
No Matches
ComboChoiceEntryLabel Class Reference

A class with a Gtk::ComboBoxText and Gtk::Label. Slightly different from ComboEntryLabel. More...

#include <EntryLabel.h>

Inheritance diagram for ComboChoiceEntryLabel:

Public Member Functions

 ComboChoiceEntryLabel (Glib::ustring lbl)
 Constructor. More...
 
 ComboChoiceEntryLabel (std::vector< int > id_vec, std::vector< std::string > str_vec, Glib::ustring lbl)
 Constructor. More...
 
void set_entries (std::vector< int > id_vec, std::vector< std::string > str_vec)
 Set the choices. More...
 
bool set_selected (int id)
 Set the selected choice. More...
 
int get_selected ()
 Get the ID of the selected choice. More...
 
Gtk::ComboBoxText * get_comboBoxText ()
 Get the Gtk::ComboBoxText pointer. More...
 

Public Attributes

Gtk::ComboBoxText entry
 Gtk::ComboBoxText object. More...
 

Protected Attributes

Gtk::Box box
 Gtk::Box object of the widget. More...
 
Gtk::Label label
 label string variable. More...
 
std::vector< int > id
 Vector of ID for the item of the ComboBoxText. More...
 
std::vector< std::string > str
 Vector to store the choice name of the ComboBoxText. More...
 

Detailed Description

A class with a Gtk::ComboBoxText and Gtk::Label. Slightly different from ComboEntryLabel.

Class including a Gtk::ComboBoxText together with a Gtk::Label, used in SBBHostApp. It slightly differs from ComboEntryLabel for the appearance, usage, and implementation.

See also
SBBHostApp
Author
Stefano Lovato
Date
2022

Constructor & Destructor Documentation

◆ ComboChoiceEntryLabel() [1/2]

ComboChoiceEntryLabel::ComboChoiceEntryLabel ( Glib::ustring  lbl)

Constructor.

Default constructor. Sets only the label, not the choices of the ComboBoxText.

Parameters
lblThe label.

◆ ComboChoiceEntryLabel() [2/2]

ComboChoiceEntryLabel::ComboChoiceEntryLabel ( std::vector< int >  id_vec,
std::vector< std::string >  str_vec,
Glib::ustring  lbl 
)

Constructor.

Default constructor with set choices.

Parameters
lblThe label.

Member Function Documentation

◆ get_comboBoxText()

Gtk::ComboBoxText * ComboChoiceEntryLabel::get_comboBoxText ( )

Get the Gtk::ComboBoxText pointer.

Function to get a pointer to the Gtk::ComboBoxText object.

Returns
The pointer to the Gtk::ComboBoxText.

◆ get_selected()

int ComboChoiceEntryLabel::get_selected ( )

Get the ID of the selected choice.

Function to get the ID of the selected choice of the ComboBoxText.

Returns
The ID of the selected choice.

◆ set_entries()

void ComboChoiceEntryLabel::set_entries ( std::vector< int >  id_vec,
std::vector< std::string >  str_vec 
)

Set the choices.

Function to set the choices of the ComboBoxText.

Parameters
id_vecThe vector of IDs of the choices.
str_vecThe vector of names of the choices.

◆ set_selected()

bool ComboChoiceEntryLabel::set_selected ( int  id)

Set the selected choice.

Function to set the selected choice of the ComboBoxText by specifying its ID.

Parameters
idThe ID of the selected choice.
Returns
true if success, false otherwise.

Member Data Documentation

◆ box

Gtk::Box ComboChoiceEntryLabel::box
protected

Gtk::Box object of the widget.

◆ entry

Gtk::ComboBoxText ComboChoiceEntryLabel::entry

Gtk::ComboBoxText object.

◆ id

std::vector<int> ComboChoiceEntryLabel::id
protected

Vector of ID for the item of the ComboBoxText.

◆ label

Gtk::Label ComboChoiceEntryLabel::label
protected

label string variable.

◆ str

std::vector<std::string> ComboChoiceEntryLabel::str
protected

Vector to store the choice name of the ComboBoxText.