Methods setText() and clearText() for FComboBox
This commit is contained in:
parent
c0b1dc5924
commit
eeac24aef2
|
@ -1,4 +1,6 @@
|
||||||
2020-01-09 Markus Gans <guru.mail@muenster.de>
|
2020-01-09 Markus Gans <guru.mail@muenster.de>
|
||||||
|
* With setText() and clearText() the text in the edit line can be changed
|
||||||
|
without changing the content of the combo box
|
||||||
* The setCurrentItem() method was added to the FComboBox widget class.
|
* The setCurrentItem() method was added to the FComboBox widget class.
|
||||||
Thanks cybin for the sample code
|
Thanks cybin for the sample code
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,8 @@ class FComboBox : public FWidget
|
||||||
bool unsetEditable();
|
bool unsetEditable();
|
||||||
void setCurrentItem (std::size_t);
|
void setCurrentItem (std::size_t);
|
||||||
void setMaxVisibleItems (std::size_t);
|
void setMaxVisibleItems (std::size_t);
|
||||||
|
void setText (const FString&);
|
||||||
|
void clearText();
|
||||||
void setLabelText (const FString&);
|
void setLabelText (const FString&);
|
||||||
void setLabelOrientation (const FLineEdit::label_o);
|
void setLabelOrientation (const FLineEdit::label_o);
|
||||||
|
|
||||||
|
@ -303,8 +305,7 @@ inline bool FComboBox::hasShadow()
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void FComboBox::insert ( const std::initializer_list<T>& list
|
void FComboBox::insert (const std::initializer_list<T>& list, FDataPtr d)
|
||||||
, FDataPtr d )
|
|
||||||
{
|
{
|
||||||
for (auto& item : list)
|
for (auto& item : list)
|
||||||
{
|
{
|
||||||
|
@ -315,8 +316,7 @@ void FComboBox::insert ( const std::initializer_list<T>& list
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
template <typename ItemT>
|
template <typename ItemT>
|
||||||
void FComboBox::insert ( const ItemT& item
|
void FComboBox::insert (const ItemT& item, FDataPtr d)
|
||||||
, FDataPtr d )
|
|
||||||
{
|
{
|
||||||
FListBoxItem listItem (FString() << item, d);
|
FListBoxItem listItem (FString() << item, d);
|
||||||
insert (listItem);
|
insert (listItem);
|
||||||
|
@ -326,6 +326,14 @@ void FComboBox::insert ( const ItemT& item
|
||||||
inline void FComboBox::reserve (std::size_t new_cap)
|
inline void FComboBox::reserve (std::size_t new_cap)
|
||||||
{ list_window.list.reserve(new_cap); }
|
{ list_window.list.reserve(new_cap); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FComboBox::setText (const FString& s)
|
||||||
|
{ input_field.setText(s); }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline void FComboBox::clearText()
|
||||||
|
{ input_field.clear(); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FComboBox::setLabelText (const FString& s)
|
inline void FComboBox::setLabelText (const FString& s)
|
||||||
{ input_field.setLabelText(s); }
|
{ input_field.setLabelText(s); }
|
||||||
|
|
Loading…
Reference in New Issue