mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fixed view events and active controls not working properly
This commit is contained in:
parent
32028ccf1d
commit
2db3eb868a
1 changed files with 14 additions and 10 deletions
|
@ -170,16 +170,21 @@ void UIWindowManager::ViewEvent
|
|||
)
|
||||
|
||||
{
|
||||
if( !view ) view = this;
|
||||
if (!view) {
|
||||
// use the first responder instead
|
||||
view = m_firstResponder;
|
||||
}
|
||||
|
||||
if( !view->isEnabled() )
|
||||
if (!view->isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Event *ev = new Event( event );
|
||||
ev->AddFloat( pos.x );
|
||||
ev->AddFloat( pos.y );
|
||||
ev->AddInteger( buttons );
|
||||
ProcessEvent( ev );
|
||||
// send the event to the view
|
||||
view->ProcessEvent( ev );
|
||||
}
|
||||
|
||||
UIWidget *UIWindowManager::getResponder
|
||||
|
@ -321,7 +326,6 @@ void UIWindowManager::ServiceEvents
|
|||
}
|
||||
|
||||
SafePtr<UIWidget> b = m_oldview;
|
||||
m_oldview = NULL;
|
||||
|
||||
if( b != view )
|
||||
{
|
||||
|
@ -474,11 +478,11 @@ void UIWindowManager::ActivateControl
|
|||
|
||||
if( !m_activeControl )
|
||||
{
|
||||
m_activeControl = this;
|
||||
m_activeControl->SetHovermaterialActive( true );
|
||||
m_activeControl->ActivateOrder();
|
||||
m_activeControl->BringToFrontPropogated();
|
||||
m_activeControl->SendSignal( W_Activated );
|
||||
m_activeControl = control;
|
||||
control->SetHovermaterialActive( true );
|
||||
control->ActivateOrder();
|
||||
control->BringToFrontPropogated();
|
||||
control->SendSignal( W_Activated );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -652,7 +656,7 @@ qboolean UIWindowManager::KeyEvent
|
|||
{
|
||||
UIWidget *selwidget = NULL;
|
||||
|
||||
if( key == K_TAB && ( uii.Sys_IsKeyDown( K_CTRL ) || uii.Sys_IsKeyDown( K_DEL ) ) )
|
||||
if( key == K_TAB && ( uii.Sys_IsKeyDown( K_LCTRL ) || uii.Sys_IsKeyDown( K_DEL ) ) )
|
||||
{
|
||||
UIWidget *wid;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue