Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T, typename W>
- void tpreferences::bind_status_label(
- W& parent
- , const std::string& label_id
- , T& window)
- {
- tcontrol& label = find_widget<tcontrol>(&window, label_id, false);
- std::string value;
- if (ttoggle_button* type = dynamic_cast<ttoggle_button*>(&parent)) {
- value = bool_to_display_string(parent.get_value_bool());
- } else if (tcombobox* type = dynamic_cast<tcombobox*>(&parent)) {
- value = parent.get_value_string();
- } else {
- value = parent.get_value();
- }
- label.set_label(value);
- parent.set_callback_state_change(boost::bind(
- &tpreferences::status_label_callback<W>
- , this, boost::ref(parent), boost::ref(label)));
- }
Advertisement
Add Comment
Please, Sign In to add comment