Commit d0339e68 authored by Davis King's avatar Davis King

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

parent 0fae5ae6
......@@ -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);
}
// ----------------------------------------------------------------------------------------
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment