string InputHandler::ProcessInput() { string s; //SPACE if (IsPressOrRepeat(GLFW_KEY_SPACE)) s += " "; //0-9 for (int i = 48; i < 58; ++i) { if (IsPressOrRepeat(i)) s += i; } //A-Z for (int i = 65; i < 91; ++i) { if (IsPressOrRepeat(i)) { if (IsHeld(GLFW_KEY_LEFT_SHIFT) || IsHeld(GLFW_KEY_RIGHT_SHIFT)) s += i; else s += i + 32; } } return s; }
void SQRButton::DrawWndText() { CFPos pt = GetCursorPos(); CFRect rt; GetWndRect( rt ); rt.right -= rt.left; rt.bottom -= rt.top; rt.left = rt.top = 0.0f; if( IsHeld() ) DrawText( GetWndTextW(), m_ClickDownColor, m_ClickDownBcColor ); else if( IsInWndArea( pt.x, pt.y ) && IsEnable() && IsLastMouseMsgWnd() ) DrawText( GetWndTextW(), m_MouseOverColor, m_MouseOverBcColor ); else SQRWnd::DrawWndText(); }
void SQRButton::DrawText( const wstring& text, float x, float y, CColor color, CColor bkColor, bool multiline, CFRect* rect) { float zoomSize = GetRootZoomSize(); if( IsHeld() ) { int32 nStyle = GetStyle(); float nXof = GetXOF(nStyle); float nYof = GetYOF(nStyle); x += nXof * zoomSize; y += nYof * zoomSize; } x += GetTextOffsetX() * zoomSize; y += GetTextOffsetY() * zoomSize; return SQRWnd::DrawText( text, x, y, color, bkColor, multiline, rect ); }
void SQRCheckButton::DrawWndBackground() { m_beBGDrawed = true; //处于选中状态 if( m_bCheck ) DrawBackImage( m_hWnd->m_Enable, m_hWnd->m_Disable, m_MouseOverImage, m_ClickDownImage, IsHeld() ); else { CFPos pt = GetCursorPos(); if( IsHeld() ) { SetEventStateMask(IP_UNCHECK_CLICKDOWN); DrawRect( m_UncheckClickDownImage ); } else if( IsInWndArea( pt.x, pt.y ) && IsEnable() && IsLastMouseMsgWnd() ) { SetEventStateMask(IP_UNCHECK_MOUSEOVER); DrawRect( m_UncheckMouseOverImage ); } else if( !IsEnable() ) { SetEventStateMask(IP_UNCHECK_DISABLE); DrawRect( m_UncheckDisableImage ); } else if( m_uFlashCircle && m_uFlashEndTime - m_uFlashStartTime > uint32(GetProcessTime()) - m_uFlashStartTime ) { float fAlpha = GetTransparent(); float fWeight = abs( (float)( ( uint32(GetProcessTime()) - m_uFlashStartTime )%( m_uFlashCircle*2 ) - m_uFlashCircle ) )/m_uFlashCircle; SetTransparent( fAlpha*fWeight ); SetEventStateMask(IP_UNCHECK_ENABLE); DrawRect( m_UncheckEnableImage ); SetTransparent( fAlpha*( 1.0f - fWeight ) ); SetEventStateMask(IP_UNCHECK_MOUSEOVER); DrawRect( m_UncheckMouseOverImage ); SetTransparent( fAlpha ); } else { SetEventStateMask(IP_UNCHECK_ENABLE); DrawRect( m_UncheckEnableImage ); } } }
void SQRButton::DrawWndBackground() { m_beBGDrawed = true; if(m_hWnd->m_bIsShowBackground) DrawBackImage( m_hWnd->m_Enable, m_hWnd->m_Disable, m_MouseOverImage, m_ClickDownImage, IsHeld() ); }
void SQRCheckButton::DrawWndText() { UIWString str = GetWndTextW(); int32 nSize = str.size(); if( !nSize ) return; CFPos pt = GetCursorPos(); CFRect rt; GetWndRect(rt); rt.right -= rt.left; rt.bottom -= rt.top; rt.left = rt.top = 0; int32 i = 0; const wchar_t* szText = str.c_str(); for( ; i < nSize - 1; i++ ) { if( str[i] == '\\' && str[ i + 1 ] == 'n' ) str[i] = str[ i + 1 ] = 0; if( !str[i] && !str[ i + 1 ] ) { if( !m_bCheck ) szText += i + 2; break; } } //处于选中状态 if( m_bCheck ) { if( IsHeld() ) { if( IsInWndArea( pt.x, pt.y ) ) DrawText( szText, m_ClickDownColor, m_ClickDownBcColor); else if( IsEnable() ) DrawText( szText, m_hWnd->m_EnableColor, m_hWnd->m_EnableBcColor ); else DrawText( szText, m_hWnd->m_DisableColor, m_hWnd->m_DisableBcColor ); } else { if( IsInWndArea( pt.x, pt.y ) && IsEnable() ) DrawText( szText, m_MouseOverColor, m_MouseOverBcColor ); else if( IsEnable() ) DrawText( szText, m_hWnd->m_EnableColor, m_hWnd->m_EnableBcColor ); else DrawText( szText, m_hWnd->m_DisableColor, m_hWnd->m_DisableBcColor ); } } //非选中状态 else if( !m_bCheck ) { if( IsHeld() ) { if( IsInWndArea( pt.x, pt.y ) ) DrawText( szText, m_UncheckClickDownColor, m_UncheckClickDownBcColor ); else DrawText( szText, m_UncheckEnableColor, m_UncheckEnableBcColor ); } else { if( IsInWndArea( pt.x, pt.y ) && IsEnable() ) DrawText( szText, m_UncheckMouseOverColor, m_UncheckMouseOverBcColor ); else if( IsEnable() ) DrawText( szText, m_UncheckEnableColor, m_UncheckEnableBcColor ); else DrawText( szText, m_UncheckDisableColor, m_UncheckDisableBcColor ); } } }
void CDVDInputStreamNavigator::SkipHold() { if(IsHeld()) m_holdmode = HOLDMODE_SKIP; }