MCPcopy Create free account
hub / github.com/davisking/dlib / set_width

Method set_width

dlib/gui_widgets/widgets.cpp:741–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739// ----------------------------------------------------------------------------------------
740
741 void text_field::
742 set_width (
743 unsigned long width
744 )
745 {
746 auto_mutex M(m);
747 if (width < style->get_padding(*mfont)*2)
748 return;
749
750 rectangle old(rect);
751
752 rect.set_right(rect.left() + width - 1);
753
754 right_click_menu.set_rect(get_text_rect());
755 parent.invalidate_rectangle(rect+old);
756 }
757
758// ----------------------------------------------------------------------------------------
759

Callers

nothing calls this directly

Calls 3

set_rightMethod · 0.80
get_paddingMethod · 0.45
leftMethod · 0.45

Tested by

no test coverage detected