Don't focus menus with focusFirstChild() and focusLastChild()
This commit is contained in:
parent
e6c4fc9882
commit
8ca888b063
|
@ -1,6 +1,7 @@
|
|||
2016-05-16 Markus Gans <guru.mail@muenster.de>
|
||||
* Improve adjustSize()
|
||||
* Implement adjustSizeGlobal() for all widgets
|
||||
* Don't focus menus with focusFirstChild() and focusLastChild()
|
||||
|
||||
2016-05-01 Markus Gans <guru.mail@muenster.de>
|
||||
* Better terminal identification
|
||||
|
|
|
@ -108,6 +108,7 @@ void FMenu::init(FWidget* parent)
|
|||
setGeometry (1, 1 , 10, 2, false); // initialize geometry values
|
||||
setTransparentShadow();
|
||||
window_object = true;
|
||||
menu_object = true;
|
||||
addWindow(this);
|
||||
hide();
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ FWidget::FWidget (FWidget* parent)
|
|||
, adjustWidgetSizeGlobalShadow()
|
||||
, ignore_padding(false)
|
||||
, window_object(false)
|
||||
, menu_object(false)
|
||||
, flags(0)
|
||||
, foregroundColor()
|
||||
, backgroundColor()
|
||||
|
@ -1408,7 +1409,10 @@ bool FWidget::focusFirstChild (void)
|
|||
while ( iter != end )
|
||||
{
|
||||
FWidget* widget = static_cast<FWidget*>(*iter);
|
||||
if ( widget->isEnabled() && widget->acceptFocus() )
|
||||
|
||||
if ( widget->isEnabled()
|
||||
&& widget->acceptFocus()
|
||||
&& ! widget->isMenu() )
|
||||
{
|
||||
widget->setFocus();
|
||||
if ( widget->numOfChildren() >= 1 )
|
||||
|
@ -1445,7 +1449,10 @@ bool FWidget::focusLastChild (void)
|
|||
{
|
||||
--iter;
|
||||
FWidget* widget = static_cast<FWidget*>(*iter);
|
||||
if ( widget->isEnabled() && widget->acceptFocus() )
|
||||
|
||||
if ( widget->isEnabled()
|
||||
&& widget->acceptFocus()
|
||||
&& ! widget->isMenu() )
|
||||
{
|
||||
widget->setFocus();
|
||||
if ( widget->numOfChildren() >= 1 )
|
||||
|
|
|
@ -246,6 +246,7 @@ class FWidget : public FObject, public FTerm
|
|||
FRect adjustWidgetSizeGlobalShadow;
|
||||
bool ignore_padding;
|
||||
bool window_object;
|
||||
bool menu_object;
|
||||
int flags;
|
||||
short foregroundColor;
|
||||
short backgroundColor;
|
||||
|
@ -329,6 +330,7 @@ class FWidget : public FObject, public FTerm
|
|||
FWidget* parentWidget() const;
|
||||
bool isRootWidget() const;
|
||||
bool isWindow() const;
|
||||
bool isMenu() const;
|
||||
virtual bool close();
|
||||
|
||||
static FStatusBar* statusBar();
|
||||
|
@ -577,6 +579,10 @@ inline bool FWidget::isShown() const
|
|||
inline bool FWidget::isWindow() const
|
||||
{ return window_object; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::isMenu() const
|
||||
{ return menu_object; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::isEnabled() const
|
||||
{ return enable; }
|
||||
|
|
Loading…
Reference in New Issue