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>
|
2016-05-16 Markus Gans <guru.mail@muenster.de>
|
||||||
* Improve adjustSize()
|
* Improve adjustSize()
|
||||||
* Implement adjustSizeGlobal() for all widgets
|
* Implement adjustSizeGlobal() for all widgets
|
||||||
|
* Don't focus menus with focusFirstChild() and focusLastChild()
|
||||||
|
|
||||||
2016-05-01 Markus Gans <guru.mail@muenster.de>
|
2016-05-01 Markus Gans <guru.mail@muenster.de>
|
||||||
* Better terminal identification
|
* Better terminal identification
|
||||||
|
|
|
@ -93,7 +93,7 @@ void FMenu::init(FWidget* parent)
|
||||||
xmin = 1 + rootObj->getLeftPadding();
|
xmin = 1 + rootObj->getLeftPadding();
|
||||||
ymin = 1 + rootObj->getTopPadding();
|
ymin = 1 + rootObj->getTopPadding();
|
||||||
xmax = rootObj->getWidth();
|
xmax = rootObj->getWidth();
|
||||||
ymax = rootObj->getHeight();
|
ymax = rootObj->getHeight();
|
||||||
width = 10;
|
width = 10;
|
||||||
height = 2;
|
height = 2;
|
||||||
client_xmin = 1;
|
client_xmin = 1;
|
||||||
|
@ -107,7 +107,8 @@ void FMenu::init(FWidget* parent)
|
||||||
createArea (vwin);
|
createArea (vwin);
|
||||||
setGeometry (1, 1 , 10, 2, false); // initialize geometry values
|
setGeometry (1, 1 , 10, 2, false); // initialize geometry values
|
||||||
setTransparentShadow();
|
setTransparentShadow();
|
||||||
window_object = true;
|
window_object = true;
|
||||||
|
menu_object = true;
|
||||||
addWindow(this);
|
addWindow(this);
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ void FTerm::identifyTermType()
|
||||||
{
|
{
|
||||||
type = name = 0; // 0 == not found
|
type = name = 0; // 0 == not found
|
||||||
p = str;
|
p = str;
|
||||||
|
|
||||||
while ( *p )
|
while ( *p )
|
||||||
{
|
{
|
||||||
if ( isspace(uChar(*p)) )
|
if ( isspace(uChar(*p)) )
|
||||||
|
|
|
@ -54,6 +54,7 @@ FWidget::FWidget (FWidget* parent)
|
||||||
, adjustWidgetSizeGlobalShadow()
|
, adjustWidgetSizeGlobalShadow()
|
||||||
, ignore_padding(false)
|
, ignore_padding(false)
|
||||||
, window_object(false)
|
, window_object(false)
|
||||||
|
, menu_object(false)
|
||||||
, flags(0)
|
, flags(0)
|
||||||
, foregroundColor()
|
, foregroundColor()
|
||||||
, backgroundColor()
|
, backgroundColor()
|
||||||
|
@ -1408,7 +1409,10 @@ bool FWidget::focusFirstChild (void)
|
||||||
while ( iter != end )
|
while ( iter != end )
|
||||||
{
|
{
|
||||||
FWidget* widget = static_cast<FWidget*>(*iter);
|
FWidget* widget = static_cast<FWidget*>(*iter);
|
||||||
if ( widget->isEnabled() && widget->acceptFocus() )
|
|
||||||
|
if ( widget->isEnabled()
|
||||||
|
&& widget->acceptFocus()
|
||||||
|
&& ! widget->isMenu() )
|
||||||
{
|
{
|
||||||
widget->setFocus();
|
widget->setFocus();
|
||||||
if ( widget->numOfChildren() >= 1 )
|
if ( widget->numOfChildren() >= 1 )
|
||||||
|
@ -1445,7 +1449,10 @@ bool FWidget::focusLastChild (void)
|
||||||
{
|
{
|
||||||
--iter;
|
--iter;
|
||||||
FWidget* widget = static_cast<FWidget*>(*iter);
|
FWidget* widget = static_cast<FWidget*>(*iter);
|
||||||
if ( widget->isEnabled() && widget->acceptFocus() )
|
|
||||||
|
if ( widget->isEnabled()
|
||||||
|
&& widget->acceptFocus()
|
||||||
|
&& ! widget->isMenu() )
|
||||||
{
|
{
|
||||||
widget->setFocus();
|
widget->setFocus();
|
||||||
if ( widget->numOfChildren() >= 1 )
|
if ( widget->numOfChildren() >= 1 )
|
||||||
|
@ -1716,7 +1723,7 @@ void FWidget::getTermGeometry()
|
||||||
getTermSize();
|
getTermSize();
|
||||||
closeConsole();
|
closeConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
r_obj->width = term->getWidth();
|
r_obj->width = term->getWidth();
|
||||||
r_obj->height = term->getHeight();
|
r_obj->height = term->getHeight();
|
||||||
r_obj->xmin = 1;
|
r_obj->xmin = 1;
|
||||||
|
|
|
@ -246,6 +246,7 @@ class FWidget : public FObject, public FTerm
|
||||||
FRect adjustWidgetSizeGlobalShadow;
|
FRect adjustWidgetSizeGlobalShadow;
|
||||||
bool ignore_padding;
|
bool ignore_padding;
|
||||||
bool window_object;
|
bool window_object;
|
||||||
|
bool menu_object;
|
||||||
int flags;
|
int flags;
|
||||||
short foregroundColor;
|
short foregroundColor;
|
||||||
short backgroundColor;
|
short backgroundColor;
|
||||||
|
@ -329,6 +330,7 @@ class FWidget : public FObject, public FTerm
|
||||||
FWidget* parentWidget() const;
|
FWidget* parentWidget() const;
|
||||||
bool isRootWidget() const;
|
bool isRootWidget() const;
|
||||||
bool isWindow() const;
|
bool isWindow() const;
|
||||||
|
bool isMenu() const;
|
||||||
virtual bool close();
|
virtual bool close();
|
||||||
|
|
||||||
static FStatusBar* statusBar();
|
static FStatusBar* statusBar();
|
||||||
|
@ -577,6 +579,10 @@ inline bool FWidget::isShown() const
|
||||||
inline bool FWidget::isWindow() const
|
inline bool FWidget::isWindow() const
|
||||||
{ return window_object; }
|
{ return window_object; }
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
inline bool FWidget::isMenu() const
|
||||||
|
{ return menu_object; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FWidget::isEnabled() const
|
inline bool FWidget::isEnabled() const
|
||||||
{ return enable; }
|
{ return enable; }
|
||||||
|
|
Loading…
Reference in New Issue