mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Made selecting a rectangle copy its label into the overlay label text field.
This commit is contained in:
parent
0fae5ae6c3
commit
d0339e6835
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user