Commit f739b89a authored by Davis King's avatar Davis King

Added some functions to the text_field to control input focus and

select text.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402823
parent 74aaea6f
......@@ -442,6 +442,29 @@ namespace dlib
right_click_menu.enable();
}
// ----------------------------------------------------------------------------------------
void text_field::
give_input_focus (
)
{
auto_mutex M(m);
has_focus = true;
cursor_visible = true;
parent.invalidate_rectangle(rect);
t.start();
}
// ----------------------------------------------------------------------------------------
void text_field::
select_all_text (
)
{
auto_mutex M(m);
on_select_all();
}
// ----------------------------------------------------------------------------------------
void text_field::
......
......@@ -409,6 +409,12 @@ namespace dlib
const std::wstring& text_
);
void give_input_focus (
);
void select_all_text (
);
void set_text (
const dlib::ustring& text_
);
......
......@@ -526,6 +526,21 @@ namespace dlib
nothing else changes.
!*/
void give_input_focus (
);
/*!
ensures
- gives this text field input keyboard focus
!*/
void select_all_text (
);
/*!
ensures
- causes all the text in the text field to become selected.
(note that it doesn't give input focus)
!*/
void set_text_color (
const rgb_pixel color
);
......
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