A form / form widget can avoid to have the focus

This commit is contained in:
Bertrand Songis
2019-10-21 12:08:06 +02:00
parent deef13e80c
commit 2214c54a05
2 changed files with 8 additions and 5 deletions
+5 -3
View File
@@ -24,9 +24,11 @@
FormField::FormField(Window *parent, const rect_t & rect, WindowFlags windowFlags) :
Window(parent, rect, windowFlags)
{
FormGroup * form = dynamic_cast<FormGroup *>(parent);
if (form) {
form->addField(this);
if (!(windowFlags & FORM_NO_FOCUS)) {
FormGroup * form = dynamic_cast<FormGroup *>(parent);
if (form) {
form->addField(this);
}
}
}
+3 -2
View File
@@ -22,8 +22,9 @@
#include "window.h"
constexpr WindowFlags FORM_FORWARD_FOCUS = WINDOW_FLAGS_LAST << 1;
constexpr WindowFlags FORM_DETACHED = WINDOW_FLAGS_LAST << 2;
constexpr WindowFlags FORM_NO_FOCUS = WINDOW_FLAGS_LAST << 1;
constexpr WindowFlags FORM_FORWARD_FOCUS = WINDOW_FLAGS_LAST << 2;
constexpr WindowFlags FORM_DETACHED = WINDOW_FLAGS_LAST << 3;
constexpr WindowFlags FORM_FLAGS_LAST = FORM_DETACHED;
class FormField: public Window {