Skip to content

Commit

Permalink
GUI2/Listbox: fire NOTIFY_MODIFIED events where callback_value_change…
Browse files Browse the repository at this point in the history
…d_ is called

This is the beginning of an effort to finish converting the event callbacks to signal handles instead
of function callbacks.
  • Loading branch information
Vultraz committed Aug 25, 2017
1 parent da617e7 commit 2fd098f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gui/widgets/listbox.cpp
Expand Up @@ -181,6 +181,8 @@ void listbox::set_row_shown(const unsigned row, const bool shown)

if(selected_row != get_selected_row() && callback_value_changed_) {
callback_value_changed_(*this);

fire(event::NOTIFY_MODIFIED, *this, nullptr);
}
}

Expand Down Expand Up @@ -221,6 +223,8 @@ void listbox::set_row_shown(const boost::dynamic_bitset<>& shown)

if(selected_row != get_selected_row() && callback_value_changed_) {
callback_value_changed_(*this);

fire(event::NOTIFY_MODIFIED, *this, nullptr);
}
}

Expand Down Expand Up @@ -306,6 +310,8 @@ void listbox::list_item_clicked(widget& caller)
if(callback_value_changed_) {
callback_value_changed_(*this);
}

fire(event::NOTIFY_MODIFIED, *this, nullptr);
return;
}
}
Expand Down Expand Up @@ -470,6 +476,8 @@ void listbox::update_visible_area_on_key_event(const bool key_direction_vertical
if(callback_value_changed_) {
callback_value_changed_(*this);
}

fire(event::NOTIFY_MODIFIED, *this, nullptr);
}

void listbox::handle_key_up_arrow(SDL_Keymod modifier, bool& handled)
Expand Down

0 comments on commit 2fd098f

Please sign in to comment.