Don't add control characters to Entry's buffer
void Dropdown::render_special(const Part &part) const
{
if(part.get_name()=="text")
- render_text(part, text);
+ {
+ if(list->get_selected_index()>=0)
+ render_text(part, list->get_selected());
+ }
else if(part.get_name()=="list" && dropped)
list->render();
}
void Dropdown::list_item_selected(unsigned index, const std::string &item)
{
- text=item;
-
if(dropped)
{
list_active=false;
private:
List *list;
- std::string text;
bool dropped;
bool list_active;
if(edit_pos>0)
text.erase(--edit_pos, 1);
}
- else
+ else if(ch>=' ')
{
text.insert(edit_pos, Codecs::encode<Codecs::Utf8>(Codecs::ustring(1, ch)));
++edit_pos;