void TUI::ShowHint(const AnsiString& s) { VERIFY (m_bReady); GetCursorPos (&m_HintPoint); AStringVec SS; SS.push_back (s); Tools->OnShowHint(SS); if (!ShowHint(SS)&&m_pHintWindow) HideHint(); }
void TUI::OnAppDeactivate() { VERIFY(m_bReady); if (pInput){ pInput->OnAppDeactivate(); m_ShiftState.Clear(); EDevice.seqAppDeactivate.Process(rp_AppDeactivate); } HideHint(); m_bAppActive = false; }
bool ActiveWidget::PointerIdle(const Pos& p, bool drag) { bool result=false; if ( IsOver(p) && !_was_over ) { DBG_Text("----->"); if ( !IsActive() ) { ShowHint(); } else if (!drag) { result |= OnMoveOver.Schedule_1(p); ShowHint(); } InputIncEager(this); if (!drag) DBG_Text("MoveOver"); } else if( _was_over && !IsOver(p) || _unsent_outside ) { DBG_Text("<-----"); if ( !IsActive() ) { HideHint(); } else if (!drag) { result |= OnMoveOutside.Schedule_1(p); HideHint(); } InputDecEager(this); if (!drag) DBG_Text("MoveSide"); _unsent_outside = false; } return result; }
void TUI::ShowObjectHint() { VERIFY(m_bReady); if (!EPrefs->object_flags.is(epoShowHint)){ // if (m_bHintShowing) HideHint(); return; } if (EDevice.m_Camera.IsMoving()||m_MouseCaptured) return; if (!m_bAppActive) return; GetCursorPos(&m_HintPoint); TWinControl* ctr = FindVCLWindow(m_HintPoint); if (ctr!=m_D3DWindow) return; AStringVec SS; Tools->OnShowHint(SS); if (!ShowHint(SS)&&m_pHintWindow) HideHint(); }
void ActiveWidget::AcceptInputReset( const InputReset &request) { Widget *sender = request.Sender(); _cursor = Pos(-1,-1); int i; for (i=0; i!=NUM_BUTTONS; ++i) { if ( _was_touched[i] ) { if (_was_over) OnMoveOut[i].Schedule_1( _cursor ); OnRelease[i].Schedule_1( _cursor ); } _was_touched[i] = false; _is_dragging[i] = false; _mb_down[i] = false; } for (i=0; i!=_pressed_keys.Size(); ++i) { bool likes_this_key = false; likes_this_key |= _on_path_key_mask.GetBit( _pressed_keys[i] ); likes_this_key |= HasFocus() && _key_mask.GetBit( _pressed_keys[i] ); if ( likes_this_key ) { OnKeyRelease.Schedule_1( _pressed_keys[i]); } } _pressed_keys.Clear(); if (_was_over || _unsent_outside) { OnMoveOutside.Schedule_1( _cursor ); HideHint(); } _was_over = false; _unsent_outside = false; _result = false; Widget::Accept( InputReset(this) ); }
bool ActiveWidget::AcceptInputCursor( const InputCursor &cur) { DBG_AcceptC int i; _cursor=cur.Position(); _result=false; bool drag = false; bool was_over = IsOver(_cursor); if ( !IsActive() ) { PointerIdle( _cursor, false ); _was_over = was_over; } else if ( !IsOver(_cursor) || cur.Cond()==Widget::NORMAL ) { for (i=0; i!=NUM_BUTTONS; ++i) { if (_mb_down[i]) { _result |= PointerMove(_cursor,i); drag=true; } if (_is_dragging[i]) { _result |= OnDrag[i].Send_3(_cursor,cur.Move(),_touch_pos[i]); } } if (!drag) { _result |= PointerIdle(_cursor, drag); _result |= WhileMoving.Schedule_3(_cursor,cur.Move(),_was_over); } _was_over = was_over; // prevent from changing shape "on-events" } else { if ( _was_over ) { DBG_Text("------"); for (i=0; i!=NUM_BUTTONS; ++i) { if (_mb_down[i] && cur.Cond()==Widget::OFFSIDE ) { _result |= OnMoveOut[i].Schedule_1(_cursor); InputDecEager(this); DBG_Text("MoveOut+"); } else if ( cur.Cond()==Widget::INACTIVE ) { if (_mb_down[i]) InputDecEager(this); _is_dragging[i] = _mb_down[i] = false; DBG_Text("ForceOut"); } } _result |= OnMoveOutside.Schedule_1(_cursor); HideHint(); InputDecEager(this); _was_over = false; DBG_Text("OffSide"); } if ( cur.Cond()==Widget::OFFSIDE ) { _result |= WhileMoving.Schedule_3( _cursor, cur.Move(), _was_over); } } return ( _result = _was_over && (cur.Cond()==Widget::NORMAL) ); }