亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? a17tooltip.cpp

?? vc制作指示語
?? CPP
字號:
//
// ToolTipWnd.cpp : implementation file
//

#include "stdafx.h"

#include "A17tooltip.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif



// --------------------------------------------------------------------------
CToolTipWnd::CToolTipWnd()
{
	m_lpWndCls = AfxRegisterWndClass(0);
	m_bStuck = false;
	m_bSkipNextMove = false;
	m_pCurrwnd = NULL;
	m_iTimer = 0;
	m_iTimer2 = 0;
	m_iDelay = 5;				// seconds
	m_iDelayShow = 1000;		// ms

	//Defaults
	m_clrFrameColor = RGB(0, 0, 255);  //blue
	m_clrBkColor = RGB(249, 254, 188); //light yellow
	m_iWidth = 160;
	m_iHeight = 80;

	m_clrTextColor = RGB( 0, 0, 0 ); //black
	m_iFontHeight = 14;
	m_strFontName = "Arial";
	m_strText = "";
}


// --------------------------------------------------------------------------
CToolTipWnd::~CToolTipWnd()
{
	if (m_iTimer > 0)
		KillTimer();

	if (m_iTimer2 > 0)
		KillShowTimer();

	// delete all BTOOLINFO entries put in the map
	BTOOLINFO*	stToolInfo = NULL;
	HWND*		pWnd;	// dummy
	for (POSITION pos = m_toolPtr.GetStartPosition(); pos != NULL;)
	{
		m_toolPtr.GetNextAssoc(pos, (void *&)pWnd, (void *&)stToolInfo);
		delete stToolInfo;
	}
	m_toolPtr.RemoveAll();
}


// --------------------------------------------------------------------------
BEGIN_MESSAGE_MAP(CToolTipWnd, CWnd)
	//{{AFX_MSG_MAP(CToolTipWnd)
	ON_WM_PAINT()
	ON_WM_CREATE()
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


// --------------------------------------------------------------------------
BOOL CToolTipWnd::Create( CWnd* pParentWnd ) 
{
	BOOL bRet = CWnd::CreateEx(NULL, m_lpWndCls, NULL, WS_POPUP, 0, 0, m_iWidth, m_iHeight, 
							   pParentWnd->GetSafeHwnd(), NULL, NULL );
   
	m_hParentWnd = pParentWnd->GetSafeHwnd();

	if (bRet)
		SetOwner(pParentWnd);

	return bRet;
}


// --------------------------------------------------------------------------
void CToolTipWnd::OnPaint() 
{
   CPaintDC dc( this ); // device context for painting
   
   CRect rectCl;
   GetClientRect( &rectCl );
   
   CRgn rgnComb;	
   rgnComb.CreateRectRgn( rectCl.left+10,rectCl.top,rectCl.right,rectCl.bottom );
   
   int iRetComb = rgnComb.CombineRgn( &m_rgnTri, &m_rgn, RGN_OR );
   if ( iRetComb == ERROR )
   {
      AfxMessageBox( "ERROR in Combining Region" );
      return;
   }
   
   CBrush pBrush;
   pBrush.CreateSolidBrush( m_clrFrameColor );
   
   CBrush pBrush1;
   pBrush1.CreateSolidBrush( m_clrBkColor );
   
   dc.FillRgn( &rgnComb, &pBrush1 );
   dc.FrameRgn( &rgnComb, &pBrush, 2, 1 );
   
   dc.SetBkMode( TRANSPARENT );
   dc.SetTextColor( m_clrTextColor );
   
   CFont *pFont = dc.SelectObject( &m_strTextFont );
   
   CSize czTextWidth = dc.GetTextExtent( m_strText );
   
   if ( czTextWidth.cx < m_rectText.Width() )
      dc.DrawText( m_strText, m_rectText, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
   else
      dc.DrawText( m_strText, m_rectText, DT_CENTER | DT_WORDBREAK );

   dc.SelectObject( pFont );
}


// --------------------------------------------------------------------------
int CToolTipWnd::OnCreate( LPCREATESTRUCT lpCreateStruct ) 
{
   if ( CWnd::OnCreate( lpCreateStruct ) == -1 )
      return -1;
   
   CRect rectCl;
   GetClientRect( &rectCl );
   
   int x=0, y=0;
   CRect rectTemp;
   
   rectTemp = rectCl;
   rectTemp.left = rectTemp.left + 10;
   
   x = (int)( (float)( (float)rectTemp.Width() / 2.0 ) / 1.41421 );
   y = (int)( (float)( (float)rectTemp.Height() / 2.0 ) / 1.41421 );
   
   m_rectText.top = ( ( rectTemp.Height() / 2 ) - y );
   m_rectText.left = ( ( rectTemp.Width() / 2 ) - x ) + 10;
   m_rectText.right = ( ( rectTemp.Width() / 2 ) + x ) + 10;
   m_rectText.bottom = ( ( rectTemp.Height() / 2 ) + y );
   
   m_rgn.m_hObject = NULL;
   m_rgnTri.m_hObject = NULL;
   m_rgnComb.m_hObject = NULL;
   
   BOOL bRegRet = m_rgn.CreateEllipticRgn( rectCl.left+10,rectCl.top,rectCl.right,rectCl.bottom );
   
   CPoint ptTri[4];
   ptTri[0].x = rectCl.left;
   ptTri[0].y = ( rectCl.bottom / 2 ) - 10;
   
   ptTri[1].x = rectCl.left + 15;
   ptTri[1].y = ( rectCl.bottom / 2 ) - 5;
   
   ptTri[2].x = rectCl.left + 15;
   ptTri[2].y = ( rectCl.bottom / 2 ) + 5;
   
   ptTri[3].x = rectCl.left;
   ptTri[3].y = ( rectCl.bottom / 2 ) - 10;
   
   BOOL bRegTriRet = m_rgnTri.CreatePolygonRgn( ptTri, 3, ALTERNATE );
   
   m_rgnComb.CreateRectRgn( rectCl.left+10,rectCl.top,rectCl.right,rectCl.bottom );
   int iRetComb = m_rgnComb.CombineRgn( &m_rgnTri, &m_rgn, RGN_OR );
   
   if ( iRetComb == ERROR )
   {
      AfxMessageBox( "ERROR in Combining Region" );
      return -1;
   }
   
   int bRgnWnd = SetWindowRgn( m_rgnComb.operator HRGN( ), TRUE );	
   
   m_strTextFont.CreateFont( m_iFontHeight, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, m_strFontName );
   
   return 0;
}


// --------------------------------------------------------------------------
void CToolTipWnd::RelayEvent( LPMSG lpMsg )
{
   switch( lpMsg->message ) 
   {
      case WM_KEYDOWN:
         Hide();
         break;
  
      case WM_LBUTTONDOWN:
      case WM_RBUTTONDOWN:
      case WM_NCLBUTTONDOWN:
      case WM_NCRBUTTONDOWN:
         Hide();
         break;
      
      case WM_MOUSEMOVE:
      case WM_NCMOUSEMOVE:
      {
         // This is a fix to allow for messages to be made visible when not
         // using the mouse.
         if ( m_bSkipNextMove )
         { 
//            TRACE0("Move skipped\n");
            m_bSkipNextMove = false; 
            return;
         }
         else
		 {
//	         TRACE0("Move\n");
		 }

         HWND wndPt = lpMsg->hwnd;
         CPoint pt;
         pt.x = lpMsg->pt.x;
         pt.y = lpMsg->pt.y;

         // Don't show the tooltips if the application does not have the input focus
         CWnd *pFocusWnd = AfxGetApp()->m_pMainWnd->GetFocus();
         if ( pFocusWnd == NULL )
            break;

         // There are 3 possible states regarding tooltip controls:
         // a) moving outside any ctrl
         // b) going from outside a ctrl to inside
         // c) moving inside the control
         // d) going from inside a ctrl to outside

         BTOOLINFO *stToolInfo = NULL;
         BOOL found = m_toolPtr.Lookup( wndPt, (void *&)stToolInfo );

         if ( m_pCurrwnd == NULL ) // was not in a control
         {
            if ( found ) // enters a control (now in a control)
            {
//               TRACE0("OUT -> IN\n");
               m_clrTextColor = stToolInfo->clrToolTextClr;
               m_strText = stToolInfo->strToolText;
               Show( pt.x, pt.y, stToolInfo->iTimerDelay, stToolInfo->iTimerDelayShow );
               m_pCurrwnd = wndPt;
            }
            else // still not in a control
			{
//               TRACE0("OUT -> OUT\n");
			}
         }
         else // was in a control
         {
            ASSERT( m_pCurrwnd != NULL );
            CRect rect;
            ::GetWindowRect( m_pCurrwnd, &rect );
            if ( rect.PtInRect( lpMsg->pt ) ) // still in the same control
            {
//               TRACE0("IN -> IN (same)\n");
               if ( m_bStuck )
                  if ( IsWindowVisible() )
                  {
                     // may be over a tooltip, so look for previous control
                     if ( ! found )
                        found = m_toolPtr.Lookup( m_pCurrwnd, (void *&)stToolInfo );
                     ASSERT( found );
		               Show( pt.x, pt.y, stToolInfo->iTimerDelay, stToolInfo->iTimerDelayShow );
                  }
            }
            else // gone outside the control
            {
               Hide(); 
               m_pCurrwnd = NULL;

               if ( found )  // to another control
               {
//                  TRACE0("IN -> IN (other)\n");
                  m_clrTextColor = stToolInfo->clrToolTextClr;
                  m_strText = stToolInfo->strToolText;
	               Show( pt.x, pt.y, stToolInfo->iTimerDelay, stToolInfo->iTimerDelayShow );
                  m_pCurrwnd = wndPt;
               }
               else
			   {
//                  TRACE0("IN -> OUT\n");
			   }
            }
         }
      }	
      break; //WM_MOUSEMOVE
   }
}


// --------------------------------------------------------------------------
// Add or Replace tooltip if already present

void CToolTipWnd::AddTool(CWnd *pWnd, CString strText, COLORREF clrTextColor/*=NULL*/, int timerDelay /*= -1*/, int timerDelayShow /*=-1*/)
{
   ASSERT( pWnd->GetSafeHwnd() != NULL );

   BTOOLINFO *stToolInfo = NULL;
   if ( m_toolPtr.Lookup( pWnd->GetSafeHwnd(), (void *&)stToolInfo ) )
   {
      m_toolPtr.RemoveKey( pWnd );
      delete stToolInfo;
   }

   stToolInfo = new BTOOLINFO;
   stToolInfo->strToolText = strText;
	stToolInfo->clrToolTextClr = clrTextColor;
   if ( timerDelay < 0 )
      stToolInfo->iTimerDelay = m_iDelay; // default value
   else
      stToolInfo->iTimerDelay = timerDelay;

   if (timerDelayShow < 0)
      stToolInfo->iTimerDelayShow = m_iDelayShow;
   else
      stToolInfo->iTimerDelayShow = timerDelayShow;


   m_toolPtr.SetAt( pWnd->GetSafeHwnd(), stToolInfo );
}





//
// This callback is used by the EnumChildWindows function in the OnTimer Handler
//
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
{
	BOOL bStatus = TRUE;
	TTWNDSTRUCT* pws = (TTWNDSTRUCT*)lParam;
	if (pws)
	{
		HWND hWndToolTip = pws->hWndToolTip;
		HWND hWndToolTipParent = pws->hWndToolTipParent;

		// Are we over the same window as when the timer message was fired?
		if (hwnd == hWndToolTipParent)
		{
			// Display the tooltip
			::ShowWindow(hWndToolTip, SW_SHOWNOACTIVATE);

			// Stop enumerating
			bStatus = FALSE;
		}
	}

	return bStatus;
}
 
  


// --------------------------------------------------------------------------
void CToolTipWnd::OnTimer( UINT nIDEvent ) 
{
	if (nIDEvent == ID_TIMER_TOOLTIP_HIDE)
	{
		KillTimer();
		KillShowTimer();
		ShowWindow(SW_HIDE);

	}
	else if (nIDEvent == ID_TIMER_TOOLTIP_SHOW)
	{
		POINT pt;

		// Where is the mouse right now?
		if (GetCursorPos(&pt))
		{
			// Over which window?
			CWnd* pWnd = WindowFromPoint(pt);

			// Save the relevant window handles
			TTWNDSTRUCT ws;
			ZeroMemory(&ws, sizeof(ws));
			ws.hWndToolTip = GetSafeHwnd();
			ws.hWndToolTipParent = pWnd->GetSafeHwnd();

			// Now do the window handle comparisons
			EnumChildWindows(m_hParentWnd, EnumChildProc, (LPARAM)&ws); 
		}
 
	}


	CWnd::OnTimer(nIDEvent);
}


// --------------------------------------------------------------------------
void CToolTipWnd::SetTimer( int iDelay )
{
   KillTimer(); 
   if ( iDelay > 0 ) // no timer if <= 0
      m_iTimer = CWnd::SetTimer( ID_TIMER_TOOLTIP_HIDE, iDelay*1000, NULL );
}


void CToolTipWnd::SetShowTimer(int iTimeTillShow)
{
   KillShowTimer(); 
   if ( iTimeTillShow > 0 ) // no timer if <= 0
      m_iTimer2 = CWnd::SetTimer(ID_TIMER_TOOLTIP_SHOW, iTimeTillShow, NULL );
}

// --------------------------------------------------------------------------
void CToolTipWnd::KillTimer()
{
   if ( m_iTimer > 0 && m_hWnd != NULL ) 
      CWnd::KillTimer( m_iTimer ); 
   m_iTimer = 0;
}

void CToolTipWnd::KillShowTimer()
{
   if ( m_iTimer2 > 0 && m_hWnd != NULL ) 
      CWnd::KillTimer( m_iTimer2 ); 
   m_iTimer2 = 0;
}


// --------------------------------------------------------------------------
// Make the tooltip appear just as if the mouse just entered 'hWnd'
// 'hWnd' must be the active window.

void CToolTipWnd::Show( HWND hWnd, const char *overrideText, int timerDelayHide, int timerDelayShow )
{
   // make sure the window is active
   CWnd *pFocusWnd = AfxGetApp()->m_pMainWnd->GetFocus();
   if ( pFocusWnd == NULL )
      return;

   // If another one was present, hide it.
   Hide();

   // take the 'hWnd' coordinates and compute where the tooltip should appear
   RECT rect;
   ::GetWindowRect( hWnd, &rect );
   POINT pt;
   pt.x = rect.left + ( ( rect.right - rect.left ) / 2 );
   pt.y = rect.bottom;

   // Determine the text to dislay: 'overrideText' or original tooltip text
   if ( overrideText != NULL )
      m_strText = overrideText;
   else
   {
      // Reset 'm_strText' to original from tooltip
      BTOOLINFO *stToolInfo;
      if ( m_toolPtr.Lookup( hWnd, (void *&)stToolInfo ) )
         m_strText = stToolInfo->strToolText;
   }

   // Make it appear at 'pt'
   if ( timerDelayHide <= 0 ) // don't permit a tooltip to stay forever
      timerDelayHide = m_iDelay;
   Show( pt.x, pt.y, timerDelayHide, timerDelayShow);

   m_bSkipNextMove = true; // it seems we receive a WM_MOUSEMOVE whenever a window is displayed...
   m_pCurrwnd = hWnd;
}


// --------------------------------------------------------------------------
void CToolTipWnd::Show( int x, int y, int timerDelayToHide, int timerDelayToShow ) // force apparition of the tooltip
{
   // Check to see if the tooltip has a portion outside the
   // screen, if so, adjust.
   if (x < 0)
      x = 0;

   if (y < 0)
      y = 0;

   RECT r;
   r.left = x;
   r.right = r.left + m_iWidth;
   r.top = y;
   r.bottom = r.top + m_iHeight;

   // Compare to screen coordinates (don't take in account the desktop toolbar)
   int screenHeight = GetSystemMetrics( SM_CYSCREEN );
   if ( r.bottom > screenHeight )
      r.top = screenHeight - ( m_iHeight );

   int screenWidth = GetSystemMetrics( SM_CXSCREEN );
   if ( r.right > screenWidth )
      r.left = screenWidth - m_iWidth;

   // Move the window
   SetWindowPos( &wndTop, r.left, r.top, m_iWidth, m_iHeight, SWP_NOACTIVATE );

   // Only show after show delay has passed
   // ShowWindow( SW_SHOWNOACTIVATE );

    // Start the hide delay timer
	SetTimer( timerDelayToHide );

	// Start the show delay timer
	SetShowTimer(timerDelayToShow);
}


// --------------------------------------------------------------------------
void CToolTipWnd::Hide()
{
   if ( IsWindowVisible() )
   {
      ShowWindow( SW_HIDE );
      KillTimer();
	  KillShowTimer();
   }
}


// --------------------------------------------------------------------------
// Relay mouse messages occuring when and we move over a tooltip.
// Try doing a fast jump with the mouse into a control where the tooltip is first drawn...

BOOL CToolTipWnd::PreTranslateMessage( MSG *pMsg )
{
   RelayEvent( pMsg );

	return CWnd::PreTranslateMessage( pMsg );
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费毛片aaaaa**| 日韩精品一区二区三区在线播放| 精品视频123区在线观看| 日韩欧美一区在线观看| 亚洲免费av网站| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美性高清videossexo| 精品国产精品网麻豆系列| 亚洲免费观看高清完整版在线 | 亚洲女人****多毛耸耸8| 伦理电影国产精品| 色香蕉久久蜜桃| 中文字幕欧美三区| 国产在线乱码一区二区三区| 884aa四虎影成人精品一区| 亚洲精品视频一区| 高清shemale亚洲人妖| 精品福利av导航| 美女免费视频一区二区| 欧美一区二区视频免费观看| 亚洲国产精品综合小说图片区| 色综合中文字幕| 亚洲天堂免费看| 91在线视频播放| 国产精品你懂的在线欣赏| 国产精品综合久久| 26uuu亚洲| 麻豆免费精品视频| 日韩欧美激情四射| 日本vs亚洲vs韩国一区三区二区| 欧美日韩不卡一区二区| 亚洲一区二区免费视频| 欧美性做爰猛烈叫床潮| 一区二区三区精品视频在线| 色综合夜色一区| 一区二区三区欧美久久| 欧美在线免费播放| 一区二区国产视频| 欧美绝品在线观看成人午夜影视| 日韩高清国产一区在线| 91精品国产美女浴室洗澡无遮挡| 肉丝袜脚交视频一区二区| 欧美日韩精品一二三区| 视频一区二区欧美| 26uuu另类欧美| 不卡视频一二三四| 亚洲在线视频免费观看| 欧美欧美午夜aⅴ在线观看| 秋霞电影一区二区| 2欧美一区二区三区在线观看视频| 国产成人夜色高潮福利影视| 国产精品国产a| 欧美视频完全免费看| 蜜臀av性久久久久蜜臀aⅴ| 久久夜色精品国产噜噜av| 成人性生交大合| 亚洲国产美国国产综合一区二区| 3751色影院一区二区三区| 国产一区二区三区免费| 亚洲色图第一区| 日韩一二三四区| a级精品国产片在线观看| 亚洲二区在线视频| 久久久久久久久久看片| 91日韩在线专区| 久久99精品国产.久久久久久| 亚洲三级在线看| 欧美一区二区国产| 99免费精品视频| 久久成人久久鬼色| 亚洲一区欧美一区| 久久久91精品国产一区二区三区| 色8久久精品久久久久久蜜| 老鸭窝一区二区久久精品| 国产精品乱码久久久久久| 欧美日韩高清一区二区不卡 | 丝袜诱惑制服诱惑色一区在线观看 | 国产精品亚洲а∨天堂免在线| 国产精品久久久久永久免费观看 | 欧美不卡视频一区| gogo大胆日本视频一区| 麻豆视频观看网址久久| 亚洲免费av高清| 国产人妖乱国产精品人妖| 欧美吞精做爰啪啪高潮| 成人综合在线视频| 免费看欧美女人艹b| 一区二区三区美女| 国产精品污污网站在线观看| 日韩美女一区二区三区四区| 在线一区二区视频| 成人av免费网站| 国产精品一区三区| 三级影片在线观看欧美日韩一区二区| 欧美极品少妇xxxxⅹ高跟鞋| 日韩一级完整毛片| 欧美色中文字幕| 色综合久久久久| 不卡av电影在线播放| 国产一区福利在线| 男人的j进女人的j一区| 亚洲国产va精品久久久不卡综合| 国产精品另类一区| 中文字幕中文字幕中文字幕亚洲无线| 日韩一区日韩二区| 国产精品久久久久久福利一牛影视| 欧美一级搡bbbb搡bbbb| 欧美日韩一区二区三区在线| 91国在线观看| 色婷婷综合久色| 色婷婷亚洲精品| 色综合视频在线观看| 成人免费福利片| 成人a区在线观看| 成人精品视频.| 99精品欧美一区| 91美女片黄在线| 色哟哟国产精品| 精品视频一区 二区 三区| 欧美视频在线不卡| 3d动漫精品啪啪1区2区免费 | 亚洲欧美自拍偷拍色图| 中文字幕欧美区| 亚洲人成小说网站色在线| 亚洲精品乱码久久久久久| 一区二区三区四区五区视频在线观看| 中文字幕视频一区| 亚洲综合一区二区三区| 午夜精品免费在线| 麻豆精品在线视频| 国产久卡久卡久卡久卡视频精品| 精品一区二区三区在线观看国产| 国内成人精品2018免费看| 国产成人精品影视| 91免费小视频| 4438x成人网最大色成网站| 欧美大片一区二区| 国产拍揄自揄精品视频麻豆| 国产精品动漫网站| 天天av天天翘天天综合网色鬼国产| 日本特黄久久久高潮| 国产精品一区二区在线观看网站| eeuss鲁片一区二区三区在线看| 欧美性色欧美a在线播放| 6080日韩午夜伦伦午夜伦| 久久亚洲影视婷婷| 亚洲综合免费观看高清完整版| 日本欧美一区二区在线观看| 国产精品一区二区在线观看不卡| 91论坛在线播放| 日韩女优av电影在线观看| 亚洲欧洲av色图| 青娱乐精品视频| av一区二区不卡| 91精品国产综合久久小美女| 国产精品午夜电影| 日本vs亚洲vs韩国一区三区二区| 成人激情文学综合网| 91精品国产综合久久久久久久| 亚洲国产精品二十页| 五月激情综合婷婷| 成人黄色av电影| 日韩一级欧美一级| 一区二区三区精品| 成人性生交大片免费看中文 | 日本乱码高清不卡字幕| 精品国产一二三区| 香港成人在线视频| av日韩在线网站| 久久色在线观看| 午夜成人在线视频| 91国偷自产一区二区使用方法| 欧美国产日韩亚洲一区| 韩国一区二区三区| 日韩欧美中文字幕精品| 亚洲一二三专区| 色欧美88888久久久久久影院| 中文在线免费一区三区高中清不卡| 日本vs亚洲vs韩国一区三区| 欧美日韩激情一区二区三区| 亚洲三级在线免费观看| 成人高清av在线| 久久午夜电影网| 韩国精品免费视频| 日韩欧美一级二级三级久久久| 亚洲大片一区二区三区| 欧美三级三级三级| 亚洲一二三区视频在线观看| 一本大道久久精品懂色aⅴ| 欧美国产日本韩| 国产98色在线|日韩| 国产视频一区二区在线| 国产一区二区三区综合| 精品免费一区二区三区| 九九精品一区二区| 久久一夜天堂av一区二区三区| 国内外精品视频| 国产亚洲精久久久久久| 国产不卡一区视频| 国产精品区一区二区三|