Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
a3c98799
Commit
a3c98799
authored
Jul 12, 2015
by
Davis King
Browse files
Added has_input_focus() to the field_field.
parent
dbc1ea4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
dlib/gui_widgets/widgets.cpp
dlib/gui_widgets/widgets.cpp
+10
-0
dlib/gui_widgets/widgets.h
dlib/gui_widgets/widgets.h
+3
-0
dlib/gui_widgets/widgets_abstract.h
dlib/gui_widgets/widgets_abstract.h
+15
-5
No files found.
dlib/gui_widgets/widgets.cpp
View file @
a3c98799
...
@@ -455,6 +455,16 @@ namespace dlib
...
@@ -455,6 +455,16 @@ namespace dlib
t
.
start
();
t
.
start
();
}
}
// ----------------------------------------------------------------------------------------
bool
text_field
::
has_input_focus
(
)
const
{
auto_mutex
M
(
m
);
return
has_focus
;
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
void
text_field
::
void
text_field
::
...
...
dlib/gui_widgets/widgets.h
View file @
a3c98799
...
@@ -435,6 +435,9 @@ namespace dlib
...
@@ -435,6 +435,9 @@ namespace dlib
void
give_input_focus
(
void
give_input_focus
(
);
);
bool
has_input_focus
(
)
const
;
void
select_all_text
(
void
select_all_text
(
);
);
...
...
dlib/gui_widgets/widgets_abstract.h
View file @
a3c98799
...
@@ -533,10 +533,11 @@ namespace dlib
...
@@ -533,10 +533,11 @@ namespace dlib
{
{
/*!
/*!
INITIAL VALUE
INITIAL VALUE
text() == ""
- text() == ""
width() == 10
- width() == 10
height() == a height appropriate for the font used.
- height() == a height appropriate for the font used. The text color will
The text color will be black.
be black.
- has_input_focus() == false
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
This object represents a simple one line text input field.
This object represents a simple one line text input field.
...
@@ -622,7 +623,16 @@ namespace dlib
...
@@ -622,7 +623,16 @@ namespace dlib
);
);
/*!
/*!
ensures
ensures
- gives this text field input keyboard focus
- #has_input_focus() == true
!*/
bool
has_input_focus
(
);
/*!
ensures
- Returns true if this txt field has input keyboard focus. If this
is the case then it means that when the user types on the keyboard
the output will appear inside the text field.
!*/
!*/
void
select_all_text
(
void
select_all_text
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment