BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom property to define list of string values with multiple selections. More...
Public Member Functions | |
ComboProperty () | |
int | currentIndex () const |
std::string | label () const |
Returns the label to show. More... | |
bool | operator!= (const ComboProperty &other) const |
bool | operator< (const ComboProperty &other) const |
ComboProperty & | operator<< (const std::string &str) |
ComboProperty & | operator<< (const std::vector< std::string > &str) |
bool | operator== (const ComboProperty &other) const |
std::vector< int > | selectedIndices () const |
Returns vector of selected indices. More... | |
std::vector< std::string > | selectedValues () const |
Returns list of string with selected values;. More... | |
void | setCurrentIndex (int index) |
void | setSelected (const std::string &name, bool value=true) |
void | setSelected (int index, bool value=true) |
Sets given index selection flag. More... | |
void | setStringOfSelections (const std::string &values) |
Sets selected indices from string. More... | |
void | setStringOfValues (const std::string &values) |
Sets values from the string containing delimeter ';'. More... | |
void | setToolTips (const std::vector< std::string > &tooltips) |
void | setValue (const std::string &name) |
void | setValues (const std::vector< std::string > &values) |
Sets new list of values. Current value will be preserved, if exists in a new list. More... | |
std::string | stringOfSelections () const |
Return string with coma separated list of selected indices. More... | |
std::string | stringOfValues () const |
Returns a single string containing values delimited with ';'. More... | |
std::vector< std::string > | toolTips () const |
returns list of tool tips for all values More... | |
std::string | value () const |
std::vector< std::string > | values () const |
Static Public Member Functions | |
static ComboProperty | createFrom (const std::vector< std::string > &values, const std::string ¤t_value={}) |
Private Member Functions | |
ComboProperty (std::vector< std::string > values) | |
Private Attributes | |
std::vector< int > | m_selected_indices |
std::vector< std::string > | m_tooltips |
std::vector< std::string > | m_values |
Custom property to define list of string values with multiple selections.
Definition at line 27 of file comboproperty.h.
|
default |
|
private |
Definition at line 59 of file comboproperty.cpp.
|
static |
Definition at line 61 of file comboproperty.cpp.
References setCurrentIndex(), setValue(), and values().
Referenced by ToyItems::LatticeItem::LatticeItem(), and TEST_F().
int ComboProperty::currentIndex | ( | ) | const |
Definition at line 116 of file comboproperty.cpp.
References m_selected_indices.
Referenced by ModelView::ComboPropertyEditor::internIndex(), operator<<(), TEST_F(), and value().
std::string ComboProperty::label | ( | ) | const |
Returns the label to show.
Definition at line 248 of file comboproperty.cpp.
References m_selected_indices, and value().
Referenced by TEST_F(), and ModelView::SelectableComboBoxEditor::updateBoxLabel().
bool ComboProperty::operator!= | ( | const ComboProperty & | other | ) | const |
Definition at line 155 of file comboproperty.cpp.
bool ComboProperty::operator< | ( | const ComboProperty & | other | ) | const |
Definition at line 160 of file comboproperty.cpp.
References m_selected_indices, and m_values.
ComboProperty & ComboProperty::operator<< | ( | const std::string & | str | ) |
Definition at line 130 of file comboproperty.cpp.
References currentIndex(), m_values, and setCurrentIndex().
ComboProperty & ComboProperty::operator<< | ( | const std::vector< std::string > & | str | ) |
Definition at line 138 of file comboproperty.cpp.
References currentIndex(), m_values, and setCurrentIndex().
bool ComboProperty::operator== | ( | const ComboProperty & | other | ) | const |
std::vector< int > ComboProperty::selectedIndices | ( | ) | const |
Returns vector of selected indices.
Definition at line 183 of file comboproperty.cpp.
References m_selected_indices.
Referenced by TEST_F().
std::vector< std::string > ComboProperty::selectedValues | ( | ) | const |
Returns list of string with selected values;.
Definition at line 190 of file comboproperty.cpp.
References m_selected_indices, and m_values.
Referenced by TEST_F().
void ComboProperty::setCurrentIndex | ( | int | index | ) |
Definition at line 121 of file comboproperty.cpp.
References m_selected_indices, and m_values.
Referenced by createFrom(), ModelView::GroupItem::init_group(), ModelView::ComboPropertyEditor::onIndexChanged(), operator<<(), ModelView::PenItem::setSelected(), setStringOfValues(), setValue(), setValues(), and TEST_F().
void ComboProperty::setSelected | ( | const std::string & | name, |
bool | value = true |
||
) |
Definition at line 217 of file comboproperty.cpp.
References ModelView::Utils::IndexOfItem(), m_values, RealSpace::Particles::name(), setSelected(), and value().
void ComboProperty::setSelected | ( | int | index, |
bool | value = true |
||
) |
Sets given index selection flag.
If false, index will be excluded from selection.
Definition at line 201 of file comboproperty.cpp.
References m_selected_indices, m_values, and value().
Referenced by ModelView::SelectableComboBoxEditor::onModelDataChanged(), setSelected(), setStringOfSelections(), and TEST_F().
void ComboProperty::setStringOfSelections | ( | const std::string & | values | ) |
Sets selected indices from string.
Definition at line 234 of file comboproperty.cpp.
References m_selected_indices, setSelected(), and values().
Referenced by TEST_F().
void ComboProperty::setStringOfValues | ( | const std::string & | values | ) |
Sets values from the string containing delimeter ';'.
Definition at line 174 of file comboproperty.cpp.
References ModelView::Utils::Contains(), ModelView::Utils::IndexOfItem(), m_values, setCurrentIndex(), value(), and values().
Referenced by TEST_F().
void ComboProperty::setToolTips | ( | const std::vector< std::string > & | tooltips | ) |
Definition at line 111 of file comboproperty.cpp.
References m_tooltips.
void ComboProperty::setValue | ( | const std::string & | name | ) |
Definition at line 79 of file comboproperty.cpp.
References ModelView::Utils::Contains(), ModelView::Utils::IndexOfItem(), m_values, RealSpace::Particles::name(), and setCurrentIndex().
Referenced by createFrom(), and TEST_F().
void ComboProperty::setValues | ( | const std::vector< std::string > & | values | ) |
Sets new list of values. Current value will be preserved, if exists in a new list.
Definition at line 95 of file comboproperty.cpp.
References ModelView::Utils::Contains(), ModelView::Utils::IndexOfItem(), m_values, setCurrentIndex(), value(), and values().
Referenced by ModelView::GroupItem::init_group(), and TEST_F().
std::string ComboProperty::stringOfSelections | ( | ) | const |
Return string with coma separated list of selected indices.
Definition at line 224 of file comboproperty.cpp.
References m_selected_indices, and PyUtils::toString().
Referenced by TEST_F().
std::string ComboProperty::stringOfValues | ( | ) | const |
Returns a single string containing values delimited with ';'.
Definition at line 167 of file comboproperty.cpp.
References m_values, and PyUtils::toString().
Referenced by TEST_F().
std::vector< std::string > ComboProperty::toolTips | ( | ) | const |
returns list of tool tips for all values
Definition at line 106 of file comboproperty.cpp.
References m_tooltips.
Referenced by TEST_F().
std::string ComboProperty::value | ( | ) | const |
Definition at line 74 of file comboproperty.cpp.
References currentIndex(), and m_values.
Referenced by ModelView::DefaultCellDecorator::cellText(), label(), setSelected(), setStringOfValues(), setValues(), and TEST_F().
std::vector< std::string > ComboProperty::values | ( | ) | const |
Definition at line 88 of file comboproperty.cpp.
References m_values.
Referenced by createFrom(), ModelView::ComboPropertyEditor::internLabels(), setStringOfSelections(), setStringOfValues(), setValues(), and TEST_F().
|
private |
Definition at line 71 of file comboproperty.h.
Referenced by currentIndex(), label(), operator<(), operator==(), selectedIndices(), selectedValues(), setCurrentIndex(), setSelected(), setStringOfSelections(), and stringOfSelections().
|
private |
Definition at line 70 of file comboproperty.h.
Referenced by setToolTips(), and toolTips().
|
private |
Definition at line 69 of file comboproperty.h.
Referenced by operator<(), operator<<(), operator==(), selectedValues(), setCurrentIndex(), setSelected(), setStringOfValues(), setValue(), setValues(), stringOfValues(), value(), and values().