Made selecting a rectangle copy its label into the overlay label text field.

This commit is contained in:
Davis King 2011-06-20 20:46:16 -04:00
parent 0fae5ae6c3
commit d0339e6835
2 changed files with 13 additions and 0 deletions

View File

@ -50,6 +50,7 @@ metadata_editor(
overlay_label.set_width(200);
display.set_overlay_rects_changed_handler(*this, &metadata_editor::on_overlay_rects_changed);
display.set_overlay_rect_selected_handler(*this, &metadata_editor::on_overlay_rect_selected);
overlay_label.set_text_modified_handler(*this, &metadata_editor::on_overlay_label_changed);
mbar.set_number_of_menus(1);
@ -386,3 +387,14 @@ on_overlay_label_changed(
// ----------------------------------------------------------------------------------------
void metadata_editor::
on_overlay_rect_selected(
const image_display::overlay_rect& orect
)
{
overlay_label.set_text(orect.label);
display.set_default_overlay_rect_label(orect.label);
}
// ----------------------------------------------------------------------------------------

View File

@ -37,6 +37,7 @@ private:
void load_image_and_set_size(unsigned long idx);
void on_overlay_rects_changed();
void on_overlay_label_changed();
void on_overlay_rect_selected(const dlib::image_display::overlay_rect& orect);
std::string filename;
dlib::image_dataset_metadata::dataset metadata;