mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
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
This commit is contained in:
parent
74aaea6f2b
commit
f739b89a96
@ -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
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user