diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-04-11 16:38:24 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2023-04-11 16:38:24 +0200 |
| commit | 7d8195140cb3a042bea88fab8b01b5f5499f6100 (patch) | |
| tree | 238f89a3d105002769abf58f1ed7293c1f6145b1 /src/Fl.cxx | |
| parent | 8639c43e3a75b8eb1b525db4eb4848cf851f4f92 (diff) | |
Add public accessor methods Fl_Widget::needs_keyboard()
- add public getter and setter for
- document the new methods
- document that these methods are not yet used internally
- remove unnecessary friend declaration 'NEEDS_KEYBOARD' flag
- simplify Fl::focus(Fl_Widget *) using the new methods.
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 923d277f6..f1ad4d75c 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -953,6 +953,8 @@ Fl_Widget* fl_oldfocus; // kludge for Fl_Group... connected. \see Fl_Widget::take_focus() + \see Fl_Widget::needs_keyboard() const + \see Fl_Widget::needs_keyboard(bool) */ void Fl::focus(Fl_Widget *o) { @@ -960,8 +962,8 @@ void Fl::focus(Fl_Widget *o) // request an on-screen keyboard on touch screen devices if needed Fl_Widget *prevFocus = Fl::focus(); - char hideKeyboard = ( prevFocus && (prevFocus->flags()&Fl_Widget::NEEDS_KEYBOARD) ); - char showKeyboard = (o && (o->flags()&Fl_Widget::NEEDS_KEYBOARD)); + char hideKeyboard = (prevFocus && prevFocus->needs_keyboard()); + char showKeyboard = (o && o->needs_keyboard()); if (hideKeyboard && !showKeyboard) Fl::screen_driver()->release_keyboard(); if (showKeyboard && !hideKeyboard) |
