void teditor_resize_map::pre_show(CVideo& /*video*/, twindow& window) { tslider& height = find_widget<tslider>(&window, "height", false); connect_signal_notify_modified(height , boost::bind( &teditor_resize_map::update_expand_direction , this , boost::ref(window))); tslider& width = find_widget<tslider>(&window, "width", false); connect_signal_notify_modified(width , boost::bind( &teditor_resize_map::update_expand_direction , this , boost::ref(window))); std::string name_prefix = "expand"; for (int i = 0; i < 9; ++i) { std::string name = name_prefix + lexical_cast<std::string>(i); direction_buttons_[i] = find_widget<ttoggle_button>( &window, name, false, true); direction_buttons_[i]->set_callback_state_change( dialog_callback<teditor_resize_map , &teditor_resize_map::update_expand_direction>); } direction_buttons_[0]->set_value(true); update_expand_direction(window); }
void teditor_resize_map::pre_show(CVideo& /*video*/, twindow& window) { tlabel& old_width = find_widget<tlabel>(&window, "old_width", false); tlabel& old_height = find_widget<tlabel>(&window, "old_height", false); height_ = find_widget<tslider>(&window, "height", false, true); width_ = find_widget<tslider>(&window, "width", false, true); height_->set_callback_positioner_move(dialog_callback<teditor_resize_map , &teditor_resize_map::update_expand_direction>); width_->set_callback_positioner_move(dialog_callback<teditor_resize_map , &teditor_resize_map::update_expand_direction>); old_width.set_label(lexical_cast<std::string>(old_width_)); old_height.set_label(lexical_cast<std::string>(old_height_)); std::string name_prefix = "expand"; for (int i = 0; i < 9; ++i) { std::string name = name_prefix + lexical_cast<std::string>(i); direction_buttons_[i] = find_widget<ttoggle_button>( &window, name, false, true); direction_buttons_[i]->set_callback_state_change( dialog_callback<teditor_resize_map , &teditor_resize_map::update_expand_direction>); } direction_buttons_[0]->set_value(true); update_expand_direction(window); }