Dereferencing pointer focused_widget
This commit is contained in:
parent
bd10bc74c5
commit
28cdbc77af
|
@ -373,14 +373,12 @@ void FButton::onAccel (FAccelEvent* ev)
|
|||
{
|
||||
FWidget* focused_widget = static_cast<FWidget*>(ev->focusedWidget());
|
||||
|
||||
if ( focused_widget->isWidget() )
|
||||
if ( focused_widget && focused_widget->isWidget() )
|
||||
{
|
||||
FFocusEvent out (fc::FocusOut_Event);
|
||||
FApplication::queueEvent(focused_widget, &out);
|
||||
setFocus();
|
||||
|
||||
if ( focused_widget )
|
||||
focused_widget->redraw();
|
||||
focused_widget->redraw();
|
||||
|
||||
if ( click_animation )
|
||||
setDown();
|
||||
|
|
|
@ -220,15 +220,12 @@ void FLabel::onAccel (FAccelEvent* ev)
|
|||
{
|
||||
FWidget* focused_widget = static_cast<FWidget*>(ev->focusedWidget());
|
||||
|
||||
if ( focused_widget->isWidget() )
|
||||
if ( focused_widget && focused_widget->isWidget() )
|
||||
{
|
||||
FFocusEvent out (fc::FocusOut_Event);
|
||||
FApplication::queueEvent(focused_widget, &out);
|
||||
accel_widget->setFocus();
|
||||
|
||||
if ( focused_widget )
|
||||
focused_widget->redraw();
|
||||
|
||||
focused_widget->redraw();
|
||||
accel_widget->redraw();
|
||||
FFocusEvent in (fc::FocusIn_Event);
|
||||
FApplication::sendEvent(accel_widget, &in);
|
||||
|
|
|
@ -542,15 +542,12 @@ void FLineEdit::onAccel (FAccelEvent* ev)
|
|||
{
|
||||
FWidget* focused_widget = static_cast<FWidget*>(ev->focusedWidget());
|
||||
|
||||
if ( focused_widget->isWidget() )
|
||||
if ( focused_widget && focused_widget->isWidget() )
|
||||
{
|
||||
FFocusEvent out (fc::FocusOut_Event);
|
||||
FApplication::queueEvent(focused_widget, &out);
|
||||
setFocus();
|
||||
|
||||
if ( focused_widget )
|
||||
focused_widget->redraw();
|
||||
|
||||
focused_widget->redraw();
|
||||
redraw();
|
||||
|
||||
if ( getStatusBar() )
|
||||
|
|
|
@ -543,7 +543,7 @@ void FMenuItem::onAccel (FAccelEvent* ev)
|
|||
|
||||
focused_widget = static_cast<FWidget*>(ev->focusedWidget());
|
||||
|
||||
if ( focused_widget->isWidget() )
|
||||
if ( focused_widget && focused_widget->isWidget() )
|
||||
{
|
||||
FFocusEvent out (fc::FocusOut_Event);
|
||||
FApplication::queueEvent(focused_widget, &out);
|
||||
|
@ -553,9 +553,7 @@ void FMenuItem::onAccel (FAccelEvent* ev)
|
|||
if ( menu->getSelectedItem() )
|
||||
menu->getSelectedItem()->setFocus();
|
||||
|
||||
if ( focused_widget )
|
||||
focused_widget->redraw();
|
||||
|
||||
focused_widget->redraw();
|
||||
menu->redraw();
|
||||
|
||||
if ( getStatusBar() )
|
||||
|
|
|
@ -298,14 +298,12 @@ void FToggleButton::onAccel (FAccelEvent* ev)
|
|||
{
|
||||
FWidget* focused_widget = static_cast<FWidget*>(ev->focusedWidget());
|
||||
|
||||
if ( focused_widget->isWidget() )
|
||||
if ( focused_widget && focused_widget->isWidget() )
|
||||
{
|
||||
FFocusEvent out (fc::FocusOut_Event);
|
||||
FApplication::queueEvent(focused_widget, &out);
|
||||
setFocus();
|
||||
|
||||
if ( focused_widget )
|
||||
focused_widget->redraw();
|
||||
focused_widget->redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue