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

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

?? titletip.cpp

?? 基于ACCESS的簡單進銷存系統
?? CPP
字號:
////////////////////////////////////////////////////////////////////////////
// TitleTip.cpp : implementation file
//
// Adapted from code written by Zafir Anjum
//
// Modifed 10 Apr 1999  Now accepts a LOGFONT pointer and 
//					    a tracking rect in Show(...)  (Chris Maunder)
//         18 Apr 1999  Resource leak in Show fixed by Daniel Gehriger
//          7 Jan 2000  Added multiline capabilities, and the ability to
//                      specify the maximum length of the tip (Mark Findlay)
   

#include "stdafx.h"
#include "TitleTip.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTitleTip
	
CTitleTip::CTitleTip()
{
	// Register the window class if it has not already been registered.
	WNDCLASS wndcls;
	HINSTANCE hInst = AfxGetInstanceHandle();
	if(!(::GetClassInfo(hInst, TITLETIP_CLASSNAME, &wndcls)))
	{
		// otherwise we need to register a new class
		wndcls.style			= CS_SAVEBITS;
		wndcls.lpfnWndProc		= ::DefWindowProc;
		wndcls.cbClsExtra		= wndcls.cbWndExtra = 0;
		wndcls.hInstance		= hInst;
		wndcls.hIcon			= NULL;
		wndcls.hCursor			= LoadCursor( hInst, IDC_ARROW );
		wndcls.hbrBackground	= (HBRUSH)(COLOR_INFOBK + 1); 
		wndcls.lpszMenuName		= NULL;
		wndcls.lpszClassName	= TITLETIP_CLASSNAME;

		if (!AfxRegisterClass(&wndcls))
			AfxThrowResourceException();
	}
}

CTitleTip::~CTitleTip()
{
    if (::IsWindow(m_hWnd))
        DestroyWindow();
}


BEGIN_MESSAGE_MAP(CTitleTip, CWnd)
	//{{AFX_MSG_MAP(CTitleTip)
	ON_WM_MOUSEMOVE()
	ON_WM_PAINT()
	ON_WM_SYSKEYDOWN()
	ON_WM_KEYDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CTitleTip message handlers

BOOL CTitleTip::Create(CWnd * pParentWnd)
{
	ASSERT_VALID(pParentWnd);

	DWORD dwStyle = WS_BORDER | WS_POPUP; 
	DWORD dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
	m_pParentWnd = pParentWnd;

	return CreateEx(dwExStyle, TITLETIP_CLASSNAME, NULL, dwStyle, 
					CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
					NULL, NULL, NULL );
}


// Show 		 - Show the titletip if needed
// rectTitle	 - The rectangle within which the original 
//					title is constrained - in client coordinates
// lpszTitleText - The text to be displayed
// xoffset		 - Number of pixel that the text is offset from
//				   left border of the cell
void CTitleTip::Show(CRect rectTitle, LPCTSTR lpszTitleText, 
                     int xoffset /*=0*/, int nMaxChars /*=-1*/, 
					 LPRECT lpHoverRect /*=NULL*/,
					 LPLOGFONT lpLogFont /*=NULL*/,
                     DWORD dwFormat /*=...*/)
{
	ASSERT( ::IsWindow( GetSafeHwnd() ) );

	if (rectTitle.IsRectEmpty())
		return;

	// If titletip is already displayed, don't do anything.
	if( IsWindowVisible() ) 
		return;

	m_rectHover = (lpHoverRect != NULL)? lpHoverRect : rectTitle;
	m_rectHover.right++; m_rectHover.bottom++;

	m_pParentWnd->ClientToScreen( m_rectHover );
	ScreenToClient( m_rectHover );


	// Do not display the titletip is app does not have focus
	if( GetFocus() == NULL )
		return;

	// Define the rectangle outside which the titletip will be hidden.
	// We add a buffer of one pixel around the rectangle
	m_rectTitle.top	= -1;
	m_rectTitle.left   = -xoffset-1;
	m_rectTitle.right  = rectTitle.Width()-xoffset;
	m_rectTitle.bottom = rectTitle.Height()+1;

	// Determine the width of the text
	m_pParentWnd->ClientToScreen( rectTitle );

	CClientDC dc(this);
	m_strTitle = _T("");
	//m_strTitle += _T(" ");
	m_strTitle += lpszTitleText; 
	//m_strTitle += _T(" ");

	CFont font, *pOldFont = NULL;
	if (lpLogFont)
	{
		font.CreateFontIndirect(lpLogFont);
		pOldFont = dc.SelectObject( &font );
	}
	else
	{
		// use same font as ctrl
		pOldFont = dc.SelectObject( m_pParentWnd->GetFont() );
	}

	CSize size = dc.GetTextExtent( m_strTitle );

	TEXTMETRIC tm;
	dc.GetTextMetrics(&tm);
	size.cx += tm.tmOverhang;

	dc.SelectObject( pOldFont );

	m_rectDisplay = rectTitle;
	m_rectDisplay.left += xoffset-1;
    m_rectDisplay.top  += 0;
	m_rectDisplay.right = m_rectDisplay.left + size.cx + xoffset;
    m_rectDisplay.bottom = m_rectDisplay.top + size.cy;
	
	// Do not display if the text fits within available space
	if ( m_rectDisplay.right <= rectTitle.right-xoffset )
        return;

	// We will use avg char width to set max tooltip width
    int nMaxTooltipWidth = -1;
    if (nMaxChars > 0)
    {
	    int nMaxTooltipWidth = (tm.tmAveCharWidth * nMaxChars);
		if (nMaxTooltipWidth < 0)
			nMaxTooltipWidth *= -1;

	    // Rect display to be set to max chars
	    if (m_rectDisplay.Width() > nMaxTooltipWidth)
            m_rectDisplay.right = m_rectDisplay.left + nMaxTooltipWidth;
	}

    //***************************************************************************************
    //Adjust the dimensions of the rect to fit within the client

    // Get the coordinates of the parents client area. (In this case the ListView's client
    // area) and convert coordinates to those of the tooltip.
    CRect rectClient;
    m_pParentWnd->GetClientRect( rectClient );
    m_pParentWnd->ClientToScreen( rectClient );


	// ------------------------------------------------------------------------------
	// Use the screen's right edge as the right hand border, not the right edge of the client.
	// You can comment this out to use the right client as the border.
	CWindowDC wdc(NULL);
	rectClient.right = GetDeviceCaps(wdc, HORZRES) - 8;
	rectClient.bottom = GetDeviceCaps(wdc, VERTRES) - 8;
	//---------------------------------------------------------------------------------------


    //If the right edge exceeds the right edge of the client:
    //          see how much room there is to move the display to the left and adjust the
    //          rectangle that far to the left. If the rect still exceeds the right edge, clip
    //          the right edge to match the client right edge.
    //
    // Does the right display edge exceed the right client edge?
    if (m_rectDisplay.right > rectClient.right)
    {
        // establish what is available left shift wise and what is needed
        int nAvail = 0;
        int nNeeded = m_rectDisplay.right - rectClient.right;

        if (m_rectDisplay.left > rectClient.left)
            nAvail = m_rectDisplay.left - rectClient.left;

        // is there room to move left?
        if (nAvail >= nNeeded)
        {
            m_rectDisplay.OffsetRect(-nNeeded,0);  // yes, move all that is needed
            // increase the size of the window that will be inspected to see if the 
            // cursor has gone outside of the tooltip area by the number of units we
            // offset our display rect.
            m_rectTitle.right += nNeeded;
        }
        else
        {
            m_rectDisplay.OffsetRect(-nAvail,0);   // no, at least move to left edge of client
            // increase the size of the window that will be inspected to see if the 
            // cursor has gone outside of the tooltip area by the number of units we
            // offset our display rect.
            m_rectTitle.right += nAvail;
        }

        // Did we move enough? If not, clip right edge to match client right edge
        if (m_rectDisplay.right > rectClient.right)
            m_rectDisplay.right = rectClient.right;
    }


    //If the left edge exceeds the left edge of the client:
    //          see how much room there is to move the display to the right and adjust the
    //          rectangle that far to the right. If the rect still exceeds the left edge, clip
    //          the left edge to match the client left edge.
    //
    // Does the left display edge exceed the left client edge?
    if (m_rectDisplay.left < rectClient.left)
    {
        // establish what is available right shift wise and what is needed
        int nAvail = 0;
        int nNeeded = rectClient.left - m_rectDisplay.left;

        if (m_rectDisplay.right < rectClient.right)
            nAvail = rectClient.right - m_rectDisplay.right;

        // is there room to move left?
        if (nAvail >= nNeeded)
        {
            m_rectDisplay.OffsetRect(+nNeeded,0);  // yes, move all that is needed
            // increase the size of the window that will be inspected to see if the 
            // cursor has gone outside of the tooltip area by the number of units we
            // offset our display rect.
            m_rectTitle.left -= nNeeded;
        }
        else
        {
            m_rectDisplay.OffsetRect(+nAvail,0);   // no, at least move to left edge of client
            // increase the size of the window that will be inspected to see if the 
            // cursor has gone outside of the tooltip area by the number of units we
            // offset our display rect.
            m_rectTitle.left -= nAvail;
        }

        // Did we move enough? If not, clip left edge to match client left edge
        if (m_rectDisplay.left < rectClient.left)
            m_rectDisplay.left = rectClient.left;        
    }


	// if the calculated width > maxwidth set above then truncate 
    if (nMaxTooltipWidth > 0 && m_rectDisplay.Width() > nMaxTooltipWidth)
        m_rectDisplay.right = m_rectDisplay.left + nMaxTooltipWidth;

    //***************************************************************************************
   
    // Use a "work" rect to calculate the bottom. This work rect will be inset 
    // slightly from the rect we have just created so the tooltip does not touch
    // the sides.
    CRect rectCalc = m_rectDisplay;

    // rectCalc.top += 1;

    int nHeight = dc.DrawText(m_strTitle, rectCalc, dwFormat | DT_CALCRECT);
    m_dwFormat = dwFormat;
    
	// If this is a single line, shorten the display to get rid of any excess blank space
	if (nHeight == tm.tmHeight)
    {
		rectCalc.right = rectCalc.left + size.cx + 3;
    }


    m_rectDisplay.bottom = m_rectDisplay.top + nHeight;

	// ensure the tooltip does not exceed the bottom of the screen
	if (m_rectDisplay.bottom > rectClient.bottom)
    {
		m_rectDisplay.bottom = rectClient.bottom;
        rectCalc.bottom = rectClient.bottom; 
    }

	SetWindowPos( &wndTop, 
        m_rectDisplay.left, 
        m_rectDisplay.top, 
		m_rectDisplay.Width(), 
        m_rectDisplay.Height(),
		SWP_SHOWWINDOW|SWP_NOACTIVATE );
    SetCapture();
}

void CTitleTip::Hide()
{
  	if (!::IsWindow(GetSafeHwnd()))
		return;

	if (GetCapture()->GetSafeHwnd() == GetSafeHwnd())
		ReleaseCapture();

	ShowWindow( SW_HIDE );
}

void CTitleTip::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (!m_rectHover.PtInRect(point)) 
	{
		Hide();
		
		// Forward the message
		ClientToScreen( &point );
		CWnd *pWnd = WindowFromPoint( point );
		if ( pWnd == this ) 
			pWnd = m_pParentWnd;
		
		int hittest = (int)pWnd->SendMessage(WM_NCHITTEST,0,MAKELONG(point.x,point.y));
		
		if (hittest == HTCLIENT)
        {
			pWnd->ScreenToClient( &point );
			pWnd->PostMessage( WM_MOUSEMOVE, nFlags, MAKELONG(point.x,point.y) );
		} 
        else 
			pWnd->PostMessage( WM_NCMOUSEMOVE, hittest, MAKELONG(point.x,point.y) );
	}
}

BOOL CTitleTip::PreTranslateMessage(MSG* pMsg) 
{
	CWnd *pWnd;
	int hittest;
	switch (pMsg->message)
	{
	case WM_LBUTTONDOWN:
	case WM_RBUTTONDOWN:
	case WM_MBUTTONDOWN:
		POINTS pts = MAKEPOINTS( pMsg->lParam );
		POINT  point;
		point.x = pts.x;
		point.y = pts.y;
		ClientToScreen( &point );
		pWnd = WindowFromPoint( point );
		if( pWnd == this ) 
			pWnd = m_pParentWnd;

		hittest = (int)pWnd->SendMessage(WM_NCHITTEST,0,MAKELONG(point.x,point.y));

		if (hittest == HTCLIENT)
		{
			pWnd->ScreenToClient( &point );
			pMsg->lParam = MAKELONG(point.x,point.y);
		} 
		else 
		{
			switch (pMsg->message) 
			{
				case WM_LBUTTONDOWN: 
					pMsg->message = WM_NCLBUTTONDOWN;
					break;
				case WM_RBUTTONDOWN: 
					pMsg->message = WM_NCRBUTTONDOWN;
					break;
				case WM_MBUTTONDOWN: 
					pMsg->message = WM_NCMBUTTONDOWN;
					break;
			}
			pMsg->wParam = hittest;
			pMsg->lParam = MAKELONG(point.x,point.y);
		}

		Hide();
		pWnd->PostMessage(pMsg->message,pMsg->wParam,pMsg->lParam);
		return TRUE;	
		
	case WM_KEYDOWN:
	case WM_SYSKEYDOWN:
		Hide();
		m_pParentWnd->PostMessage( pMsg->message, pMsg->wParam, pMsg->lParam );
		return TRUE;
	}

	if( GetFocus() == NULL )
	{
		Hide();
		return TRUE;
	}

	return CWnd::PreTranslateMessage(pMsg);
}

void CTitleTip::OnPaint() 
{
	CPaintDC dc(this); // device context for painting

    TEXTMETRIC tm;
	dc.GetTextMetrics(&tm);

	CFont *pFont = m_pParentWnd->GetFont(); 	// use same font as ctrl
	CFont *pFontDC = dc.SelectObject( pFont );
	int nHeight=0;

	CRect rect = m_rectDisplay;
	ScreenToClient(rect);

	dc.SetBkMode( TRANSPARENT ); 

	nHeight = dc.DrawText(m_strTitle, rect, m_dwFormat);

	dc.SelectObject( pFontDC );

	// Do not call CWnd::OnPaint() for painting messages
}

void CTitleTip::OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
    Hide();	
	CWnd::OnSysKeyDown(nChar, nRepCnt, nFlags);
}

void CTitleTip::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
    Hide();	
	CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区二区三区不卡| 亚洲精品视频在线看| 国产精品久久久久影院亚瑟 | 成人app网站| 欧美日韩成人高清| 国产女同互慰高潮91漫画| 亚洲高清视频在线| av在线一区二区| 国产午夜精品久久久久久久| 日本一区中文字幕| 欧美亚洲综合在线| 中文字幕在线不卡一区二区三区| 精品制服美女久久| 在线播放日韩导航| 亚洲成人自拍偷拍| 色综合天天综合网国产成人综合天| 欧美成人福利视频| 免费成人av资源网| 88在线观看91蜜桃国自产| 一区二区三区不卡在线观看| 成人国产精品视频| 国产三级久久久| 国产精品456露脸| 精品国产乱码久久久久久图片| 石原莉奈在线亚洲二区| 欧美男女性生活在线直播观看| 亚洲欧美另类小说| 色婷婷精品大在线视频| 亚洲视频一区二区在线| 99视频精品在线| 国产精品福利一区二区三区| youjizz国产精品| 国产精品久久久久aaaa| 波多野洁衣一区| 亚洲欧美一区二区视频| 91啪亚洲精品| 亚洲精品国产品国语在线app| 91亚洲精品一区二区乱码| 亚洲欧美日韩久久| 精品视频1区2区| 日韩精品亚洲一区| 欧美精品一区二区三区高清aⅴ| 蜜臀久久99精品久久久久久9| 精品久久人人做人人爽| 国产精品亚洲成人| 国产色综合久久| 91在线小视频| 五月天国产精品| 日韩女优av电影| 成人一区在线观看| 亚洲精品成人少妇| 欧美久久久久免费| 国产在线不卡视频| 亚洲人成在线播放网站岛国| 欧美日韩一区二区三区四区五区 | 国产欧美一区二区精品久导航 | 国产欧美日本一区二区三区| 成人黄动漫网站免费app| 亚洲另类在线视频| 日韩欧美一区二区视频| 国产麻豆精品在线观看| 亚洲免费av网站| 日韩欧美一二区| 成人av综合一区| 亚洲午夜精品一区二区三区他趣| 日韩视频一区在线观看| 国产成人精品免费看| 亚洲国产精品久久久久婷婷884| 欧美一级艳片视频免费观看| 国产成人av一区二区| 亚洲图片欧美色图| 久久久精品国产99久久精品芒果| 日本黄色一区二区| 国产精品资源在线观看| 亚洲一级二级三级| 欧美国产激情一区二区三区蜜月| 色婷婷av一区二区三区软件| 精品一区二区三区不卡 | 不卡的av在线播放| 日韩精品五月天| 亚洲欧洲美洲综合色网| 91精品国产手机| 91美女片黄在线观看91美女| 久久国产视频网| 亚洲一区二区三区自拍| 欧美国产成人在线| 精品国产一区久久| 欧美日韩午夜在线视频| 99久久精品一区| 粉嫩aⅴ一区二区三区四区| 免费一级片91| 午夜国产精品一区| 中文字幕视频一区| 日本一区二区三区视频视频| 欧美日本精品一区二区三区| 91首页免费视频| 成人性生交大片免费看在线播放| 人人超碰91尤物精品国产| 一区二区三区91| 亚洲欧美另类在线| 国产精品女同互慰在线看| 欧美大片国产精品| 欧美一级在线观看| 欧美二区乱c少妇| 欧美日韩在线免费视频| 色狠狠桃花综合| 91污片在线观看| 91亚洲精华国产精华精华液| 成人精品亚洲人成在线| 国产a级毛片一区| 国产成人在线色| 国产大陆亚洲精品国产| 久久国产精品一区二区| 奇米色一区二区| 日韩福利电影在线| 麻豆成人免费电影| 蜜臀久久久久久久| 极品少妇一区二区| 国产综合成人久久大片91| 国产综合色精品一区二区三区| 另类专区欧美蜜桃臀第一页| 美国十次了思思久久精品导航| 婷婷久久综合九色综合伊人色| 香蕉加勒比综合久久| 三级成人在线视频| 美女脱光内衣内裤视频久久网站 | 欧美午夜电影一区| 欧美丝袜自拍制服另类| 欧美视频一区二区| 欧美一区二区视频观看视频| 欧美一级在线观看| 国产婷婷精品av在线| 国产精品亲子伦对白| 国产精品国产三级国产a | 91网站视频在线观看| 在线精品视频一区二区三四| 欧美伊人久久久久久久久影院| 欧美日本韩国一区| 久久在线观看免费| 中文字幕在线观看不卡视频| 亚洲一区在线电影| 免费成人在线视频观看| 国产福利91精品| 色噜噜狠狠色综合欧洲selulu| 678五月天丁香亚洲综合网| 久久久夜色精品亚洲| 中文字幕综合网| 视频在线观看一区| 国产91精品欧美| 欧美婷婷六月丁香综合色| 精品成a人在线观看| 综合色天天鬼久久鬼色| 秋霞电影一区二区| 国产成人av福利| 欧美日韩国产免费| 一区二区三区四区在线免费观看| 午夜影院久久久| 国产乱码精品一区二区三区av| 色婷婷综合久色| 欧美精品一区二区不卡 | 日本高清免费不卡视频| 精品美女在线播放| 一区二区三区在线视频观看| 精品无人码麻豆乱码1区2区 | 国产毛片精品一区| 欧美色老头old∨ideo| 国产日韩欧美高清| 天天综合天天做天天综合| 成人免费视频一区| 日韩久久久久久| 亚洲无人区一区| av不卡免费在线观看| 欧美成人一区二区三区| 一区二区三区中文在线| 国产精品一二三区在线| 欧美美女一区二区| 亚洲精品国产一区二区精华液| 国产一区二区视频在线播放| 欧美日韩高清影院| 伊人婷婷欧美激情| a亚洲天堂av| 国产婷婷精品av在线| 精品午夜一区二区三区在线观看| 欧美午夜免费电影| 亚洲激情校园春色| 91原创在线视频| 欧美国产亚洲另类动漫| 国产激情一区二区三区| 欧美一区日韩一区| 日韩精品一卡二卡三卡四卡无卡| 欧美亚洲尤物久久| 亚洲一区二区三区四区在线免费观看 | 日韩精品亚洲一区二区三区免费| 91免费视频大全| 国产精品女上位| 99精品欧美一区二区三区小说 | 国产91清纯白嫩初高中在线观看| 欧美成人猛片aaaaaaa| 久久精品国内一区二区三区| 欧美日韩成人综合|