From 7d8195140cb3a042bea88fab8b01b5f5499f6100 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 11 Apr 2023 16:38:24 +0200 Subject: 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. --- src/Fl.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Fl.cxx') 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) -- cgit v1.2.3