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

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

?? sizecbar.cpp

?? PL0的編譯系統,使用MFC編寫界面,采用浮動窗口來仿VC的環境
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998 by Cristi Posea
// All rights reserved
//
// Distribute freely, except: don't remove my name from the source or
// documentation (don't take credit for my work), mark your changes
// (don't get me blamed for your possible bugs), don't alter or remove
// this notice.
// No warrantee of any kind, express or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc.,
// and I'll try to keep a version up to date.  I can be reached at:
//    cristi@gds.ro
/////////////////////////////////////////////////////////////////////////
//
// Acknowledgements:
//  o   Thanks to Harlan R. Seymour (harlan@hcube.com) for motivating me
//      to update this code. Also he prompted me to a bug durring 
//      the developement phase.
//  o   Thanks to Zafir Anjum (zafir@codeguru.com) for publishing this
//      code on his cool site (www.codeguru.com).
//  o   Some ideeas for the gripper came from the CToolBarEx flat toolbar
//      by Joerg Koenig (Joerg.Koenig@rhein-neckar.de). Also he inspired
//      me on writting this notice:) . Thanks, Joerg!
//  o   Thanks to Jakawan Ratiwanich (jack@alpha.fsec.ucf.edu) and to
//      Udo Schaefer(Udo.Schaefer@vcase.de) for the dwStyle bug fix under
//      VC++ 6.0.
//  o   Thanks to Microsoft developers for the MFC source code. After
//      all, most of this class code came from there.
//
/////////////////////////////////////////////////////////////////////////
//
// Usage:
// o    Derive your class from CSizingControlBar. Then create your child
//      controls/windows on it.
// o    Include your class header in Mainfrm.cpp and add a member 
//      variable to CMainFrame. In CMainFrame::OnCreate(), create the
//      control bar, enable it to dock, and so on... like a toolbar or
//      any control bar.
// o    More details at
//      http://www.codeguru.com/docking/docking_window.shtml or search
//      http://www.codeguru.com for my name if the article has moved.
//
/////////////////////////////////////////////////////////////////////////


// SizingControlBar.cpp : implementation file
//

#include "stdafx.h"
#include "afxpriv.h"    // for CDockContext
#include "sizecbar.h"
//#include "afximpl.h"

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

/////////////////////////////////////////////////////////////////////////
// CSizingControlBar

CSizingControlBar::CSizingControlBar()
{
    m_sizeMin = CSize(32, 32);
    m_sizeHorz = CSize(200, 200);
    m_sizeVert = CSize(200, 200);
    m_sizeFloat = CSize(200, 200);
    m_bTracking = FALSE;
    m_bInRecalcNC = FALSE;
    m_cxEdge = 5;
	m_bDragShowContent = FALSE;
}

CSizingControlBar::~CSizingControlBar()
{
}

BEGIN_MESSAGE_MAP(CSizingControlBar, CControlBar)
    //{{AFX_MSG_MAP(CSizingControlBar)
    ON_WM_PAINT()
    ON_WM_NCPAINT()
    ON_WM_WINDOWPOSCHANGED()
    ON_WM_NCCALCSIZE()
    ON_WM_LBUTTONUP()
    ON_WM_MOUSEMOVE()
    ON_WM_NCLBUTTONDOWN()
    ON_WM_LBUTTONDOWN()
    ON_WM_LBUTTONDBLCLK()
	ON_WM_RBUTTONDOWN()
    ON_WM_CAPTURECHANGED()
    ON_WM_NCHITTEST()
    ON_WM_SETCURSOR()
	ON_WM_NCLBUTTONUP()
	ON_WM_NCMOUSEMOVE()
    ON_WM_SIZE()
	//}}AFX_MSG_MAP
	ON_NOTIFY_EX(TTN_NEEDTEXT,0,OnTipNotify)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////
// CSizingControlBar message handlers


BOOL CSizingControlBar::Create(LPCTSTR lpszWindowName, CWnd* pParentWnd,
                               CSize sizeDefault, BOOL bHasGripper,
                               UINT nID, DWORD dwStyle)
{
    ASSERT_VALID(pParentWnd);   // must have a parent
    ASSERT (!((dwStyle & CBRS_SIZE_FIXED)
        && (dwStyle & CBRS_SIZE_DYNAMIC)));

    // save the style
    SetBarStyle(dwStyle & CBRS_ALL);

    CString wndclass = ::AfxRegisterWndClass(CS_DBLCLKS,
        ::LoadCursor(NULL, IDC_ARROW),
        ::GetSysColorBrush(COLOR_BTNFACE), 0);

    dwStyle &= ~CBRS_ALL;
    dwStyle &= WS_VISIBLE | WS_CHILD;
    if (!CWnd::Create(wndclass, lpszWindowName, dwStyle, CRect(0,0,0,0),
        pParentWnd, nID))
        return FALSE;

    m_sizeHorz = sizeDefault;
    m_sizeVert = sizeDefault;
    m_sizeFloat = sizeDefault;

    m_bHasGripper = bHasGripper;
    m_cyGripper = m_bHasGripper ? 12 : 0;

	//允許ToolTips
	EnableToolTips(TRUE);

    return TRUE;
}

BOOL CSizingControlBar::IsHorzDocked() const
{
    return (m_nDockBarID == AFX_IDW_DOCKBAR_TOP ||
        m_nDockBarID == AFX_IDW_DOCKBAR_BOTTOM);
}

BOOL CSizingControlBar::IsVertDocked() const
{
    return (m_nDockBarID == AFX_IDW_DOCKBAR_LEFT ||
        m_nDockBarID == AFX_IDW_DOCKBAR_RIGHT);
}

CSize CSizingControlBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
{
    CRect rc;

    m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_TOP)->GetWindowRect(rc);
    int nHorzDockBarWidth = bStretch ? 32767 : rc.Width() + 4;
    m_pDockSite->GetControlBar(AFX_IDW_DOCKBAR_LEFT)->GetWindowRect(rc);
    int nVertDockBarHeight = bStretch ? 32767 : rc.Height() + 4;

    if (bHorz)
        return CSize(nHorzDockBarWidth, m_sizeHorz.cy);
    else
        return CSize(m_sizeVert.cx, nVertDockBarHeight);
}

CSize CSizingControlBar::CalcDynamicLayout(int nLength, DWORD dwMode)
{
    if (dwMode & (LM_HORZDOCK | LM_VERTDOCK))
    {
        if (nLength == -1)
            GetDockingFrame()->DelayRecalcLayout();
        return CControlBar::CalcDynamicLayout(nLength,dwMode);
    }

    if (dwMode & LM_MRUWIDTH)
        return m_sizeFloat;

    if (dwMode & LM_COMMIT)
    {
        m_sizeFloat.cx = nLength;
        return m_sizeFloat;
    }

    if (dwMode & LM_LENGTHY)
        return CSize(m_sizeFloat.cx,
            m_sizeFloat.cy = max(m_sizeMin.cy, nLength));
    else
        return CSize(max(m_sizeMin.cx, nLength), m_sizeFloat.cy);
}

void CSizingControlBar::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos) 
{
    CControlBar::OnWindowPosChanged(lpwndpos);

    // Find on which side are we docked
    m_nDockBarID = GetParent()->GetDlgCtrlID();

    if (!m_bInRecalcNC)
    {
        m_bInRecalcNC = TRUE;

        // Force recalc the non-client area
        SetWindowPos(NULL, 0, 0, 0, 0,
            SWP_NOMOVE | SWP_NOSIZE |
            SWP_NOACTIVATE | SWP_NOZORDER |
            SWP_FRAMECHANGED);

        m_bInRecalcNC = FALSE;
    }
}

// cache of last needed cursor
AFX_STATIC_DATA HCURSOR _afx_hcurLast = NULL;
AFX_STATIC_DATA HCURSOR _afx_hcurDestroy = NULL;
AFX_STATIC_DATA UINT _afx_idcPrimaryLast = 0; // store the primary IDC

BOOL CSizingControlBar::OnSetCursor(CWnd* pWnd, UINT nHitTest,
                                    UINT message) 
{
  /*if((nHitTest == HTSYSMENU) && !IsFloating())
	{
	//	MessageBox("aa");
		TOOLTIPTEXT m_psttt;
        m_psttt.hdr.hwndFrom=m_hWnd;
        m_psttt.hdr.idFrom=pWnd->GetDlgCtrlID();
        m_psttt.hdr.code=TTN_NEEDTEXT;   
		m_psttt.uFlags= TTF_IDISHWND;
		SetStatusText(ID_DIALAGBAR_FLOAT);
 //     SendMessage(WM_NOTIFY); 

	}
   else if ((nHitTest == HTMINBUTTON) && !IsFloating())
		MessageBox("bb");
*/
	if ((nHitTest != HTSIZE) || m_bTracking)
        return CControlBar::OnSetCursor(pWnd, nHitTest, message);

	UINT idcPrimary;        // app supplied cursor
	LPCTSTR idcSecondary;    // system supplied cursor (MAKEINTRESOURCE)

    /*if (IsHorzDocked())
        ::SetCursor(::LoadCursor(NULL, IDC_SIZENS));
    else
        ::SetCursor(::LoadCursor(NULL, IDC_SIZEWE));*/
	// ------- change by syx
	if(IsHorzDocked())
	{
		idcPrimary = AFX_IDC_VSPLITBAR;
		idcSecondary = IDC_SIZENS;
	}
	else
	{
		idcPrimary = AFX_IDC_HSPLITBAR;
		idcSecondary = IDC_SIZEWE;
	}
	HCURSOR hcurToDestroy = NULL;
	if(idcPrimary != _afx_idcPrimaryLast)
	{
		HINSTANCE hInst = AfxFindResourceHandle(
			MAKEINTRESOURCE(idcPrimary), RT_GROUP_CURSOR);
		
		// load in another cursor
		hcurToDestroy = _afx_hcurDestroy;
		
		// Note: If this LoadCursor call fails, it is likely that
		//  _AFX_NO_SPLITTER_RESOURCES is defined in your .RC file.
		// To correct the situation, remove the following line from your
		//  resource script:
		//      #define _AFX_NO_SPLITTER_RESOURCES
		// This should be done using the Resource.Set Includes... command.
		
		if((_afx_hcurDestroy = _afx_hcurLast =
			::LoadCursor(hInst, MAKEINTRESOURCE(idcPrimary))) == NULL)
		{
			// will not look as good
			TRACE0("Warning: Could not find splitter cursor - using system provided alternative.\n");
			
			ASSERT(_afx_hcurDestroy == NULL);    // will not get destroyed
			_afx_hcurLast = ::LoadCursor(NULL, idcSecondary);
			ASSERT(_afx_hcurLast != NULL);
		}
		_afx_idcPrimaryLast = idcPrimary;
	}
	ASSERT(_afx_hcurLast != NULL);
	::SetCursor(_afx_hcurLast);
	ASSERT(_afx_hcurLast != hcurToDestroy);
	if (hcurToDestroy != NULL)
		::DestroyCursor(hcurToDestroy); // destroy after being set
	// ------- change by syx

	return TRUE;
}

/////////////////////////////////////////////////////////////////////////
// Mouse Handling
//
void CSizingControlBar::OnLButtonDown(UINT nFlags, CPoint point) 
{
    if (m_pDockBar != NULL)
    {
        // start the drag
        ASSERT(m_pDockContext != NULL);
        ClientToScreen(&point);
        m_pDockContext->StartDrag(point);
    }
    else
        CWnd::OnLButtonDown(nFlags, point);
}

void CSizingControlBar::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
    if (m_pDockBar != NULL)
    {
        // toggle docking
        ASSERT(m_pDockContext != NULL);
        m_pDockContext->ToggleDocking();
    }
    else
        CWnd::OnLButtonDblClk(nFlags, point);
}

void CSizingControlBar::OnNcLButtonDown(UINT nHitTest, CPoint point) 
{
    CWindowDC dc(this);
    if (m_bTracking) return;

	if((nHitTest == HTSYSMENU) && !IsFloating())
	{
		dc.DrawEdge(m_rectClose,EDGE_SUNKEN,BF_RECT);
	}
    else if ((nHitTest == HTMINBUTTON) && !IsFloating())
		dc.DrawEdge(m_rectUndock,EDGE_SUNKEN,BF_RECT);
    else if ((nHitTest == HTSIZE) && !IsFloating())
        StartTracking();
    else    
		CControlBar::OnNcLButtonDown(nHitTest, point);

}

void CSizingControlBar::OnLButtonUp(UINT nFlags, CPoint point) 
{
    if (m_bTracking)
        StopTracking(TRUE);

    CControlBar::OnLButtonUp(nFlags, point);
}

void CSizingControlBar::OnRButtonDown(UINT nFlags, CPoint point) 
{
    if (m_bTracking)
        StopTracking(FALSE);
	
	CControlBar::OnRButtonDown(nFlags, point);
}

void CSizingControlBar::OnMouseMove(UINT nFlags, CPoint point) 
{
    if (m_bTracking)
    {
		ASSERT (!IsFloating());
		CPoint pt = point;
		ClientToScreen(&pt);

		OnTrackUpdateSize(pt);
    }

    CControlBar::OnMouseMove(nFlags, point);
}

void CSizingControlBar::OnCaptureChanged(CWnd *pWnd) 
{
    if (m_bTracking && pWnd != this)
        StopTracking(FALSE); // cancel tracking

    CControlBar::OnCaptureChanged(pWnd);
}

void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects,
                                     NCCALCSIZE_PARAMS FAR* lpncsp) 
{
    // Compute the rectangle of the mobile edge
    GetWindowRect(m_rectBorder);
    m_rectBorder.OffsetRect(-m_rectBorder.left, -m_rectBorder.top);
    m_rectBorder.DeflateRect(1, 1);
    
    m_rectGripper = m_rectBorder;
    m_rectGripper.DeflateRect(5, 5);
    m_rectGripper.right -= m_cxEdge;
    m_rectGripper.bottom -= m_cxEdge;
    CRect rc = lpncsp->rgrc[0];

    DWORD dwBorderStyle = m_dwStyle | CBRS_BORDER_ANY;

    switch(m_nDockBarID)
    {
    case AFX_IDW_DOCKBAR_TOP:
        dwBorderStyle &= ~CBRS_BORDER_BOTTOM;
        rc.DeflateRect(m_cyGripper + 2, 2, 2, m_cxEdge + 2);
        m_rectBorder.top = m_rectBorder.bottom - m_cxEdge;
        break;
    case AFX_IDW_DOCKBAR_BOTTOM:
        dwBorderStyle &= ~CBRS_BORDER_TOP;
        rc.DeflateRect(m_cyGripper + 2, m_cxEdge + 2, 2, 2);
        m_rectBorder.bottom = m_rectBorder.top + m_cxEdge;
        m_rectGripper.OffsetRect(0, m_cxEdge);
        break;
    case AFX_IDW_DOCKBAR_LEFT:
        dwBorderStyle &= ~CBRS_BORDER_RIGHT;
        rc.DeflateRect(2, m_cyGripper + 2, m_cxEdge + 2, 6);
        m_rectBorder.left = m_rectBorder.right - m_cxEdge;
        break;
    case AFX_IDW_DOCKBAR_RIGHT:
        dwBorderStyle &= ~CBRS_BORDER_LEFT;
        rc.DeflateRect(m_cxEdge + 2, m_cyGripper + 2, 2, 6);
        m_rectBorder.right = m_rectBorder.left + m_cxEdge;
        m_rectGripper.OffsetRect(m_cxEdge, 0);
        break;
    default:
        m_rectBorder.SetRectEmpty();
        break;
    }

    lpncsp->rgrc[0] = rc;

    SetBarStyle(dwBorderStyle);
}

void CSizingControlBar::OnNcPaint() 
{
    // get window DC that is clipped to the non-client area

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av电影在线网| 蜜臀久久99精品久久久久久9| 日韩一区二区三区在线| 欧美三级电影在线看| 色视频一区二区| 欧美性感一类影片在线播放| 色噜噜狠狠色综合中国| 色综合久久中文字幕| 97精品电影院| 欧美日韩你懂的| 欧美一区二区在线不卡| 91精品国产欧美一区二区| 91麻豆精品国产自产在线观看一区| 欧美日韩亚州综合| 日韩欧美中文字幕公布| 欧美mv和日韩mv的网站| 久久亚洲一区二区三区四区| 久久精品视频一区二区| 国产精品久久久久久久久免费丝袜| 中文字幕一区二区三区不卡在线| 一区二区视频在线看| 亚洲韩国一区二区三区| 麻豆精品在线播放| 成人av资源下载| 欧美性高清videossexo| xnxx国产精品| 亚洲欧美一区二区三区久本道91 | 蜜桃久久久久久| 国产麻豆一精品一av一免费 | 国产精品三级久久久久三级| 日韩一区中文字幕| 日韩电影在线免费观看| 粉嫩蜜臀av国产精品网站| 91福利社在线观看| 久久综合狠狠综合| 一区二区三区资源| 国产高清视频一区| 欧美日韩视频第一区| 国产亚洲一区二区三区| 亚洲高清不卡在线观看| 国产精品一级片在线观看| 在线观看区一区二| 国产三级欧美三级| 亚洲一区二区av在线| 国产精品中文有码| 欧美嫩在线观看| 成人欧美一区二区三区1314| 捆绑变态av一区二区三区| 99国产精品国产精品毛片| 日韩视频一区二区三区| 悠悠色在线精品| 成人激情校园春色| 欧美刺激午夜性久久久久久久| 亚洲欧美日韩一区| 国产电影一区二区三区| 日韩三级在线观看| 丝袜诱惑亚洲看片 | 日韩在线播放一区二区| 成人美女视频在线看| 91精品欧美久久久久久动漫| 亚洲欧美日韩中文字幕一区二区三区| 国产伦精一区二区三区| 欧美一区日本一区韩国一区| 亚洲综合自拍偷拍| 91视频国产资源| 国产精品免费观看视频| 国产麻豆视频一区二区| 日韩精品一区二区三区中文精品| 天堂av在线一区| 欧美久久久影院| 亚洲成av人在线观看| 在线免费观看成人短视频| 国产精品久久一卡二卡| 国产美女一区二区三区| 26uuu久久综合| 国产一区二三区好的| 精品国产免费人成在线观看| 奇米精品一区二区三区在线观看一| 欧美系列一区二区| 爽好久久久欧美精品| 欧美精品乱码久久久久久按摩| 亚洲一区二区视频| 欧美日本国产一区| 日本女优在线视频一区二区| 欧美成人国产一区二区| 激情五月激情综合网| 欧美精品一区二区在线播放| 久久99九九99精品| 久久婷婷国产综合国色天香| 国产精品一二三区在线| 欧美国产成人精品| 91在线观看高清| 亚洲va天堂va国产va久| 91精品国产高清一区二区三区蜜臀 | 91精品啪在线观看国产60岁| 蜜臀av性久久久久蜜臀aⅴ四虎| 精品免费视频.| 国产乱理伦片在线观看夜一区| 日本一区二区成人在线| 91香蕉视频黄| 三级在线观看一区二区| 日韩免费高清av| 国产在线不卡一区| 亚洲欧美日本在线| 欧美电视剧在线看免费| 丁香六月综合激情| 午夜欧美大尺度福利影院在线看| 日韩欧美中文字幕一区| 波波电影院一区二区三区| 夜夜嗨av一区二区三区| 精品久久久久久无| 99re这里只有精品6| 婷婷开心久久网| 欧美激情在线看| 欧美日韩1234| 波多野结衣一区二区三区 | 91免费看视频| 蜜桃精品在线观看| 亚洲欧美日本韩国| 久久久久免费观看| 在线电影一区二区三区| www.成人在线| 激情五月激情综合网| 亚洲黄色在线视频| 国产亚洲欧美中文| 欧美一区二区三区四区五区 | 久久精品国产网站| 亚洲大片一区二区三区| 国产精品第五页| 国产亚洲精品免费| 91麻豆精品国产自产在线| 91在线看国产| 丁香桃色午夜亚洲一区二区三区| 偷拍一区二区三区| 夜色激情一区二区| 亚洲欧美日韩国产手机在线| 欧美激情在线看| 久久精品一二三| 精品奇米国产一区二区三区| 777xxx欧美| 欧美日韩精品一区二区三区四区 | 欧美精品少妇一区二区三区 | 日韩一区二区三区视频在线 | 亚洲婷婷综合久久一本伊一区| 精品少妇一区二区| 欧美一级免费大片| 欧美日韩激情一区二区三区| 日本韩国一区二区| 在线免费观看视频一区| 色婷婷久久久亚洲一区二区三区| 成人激情黄色小说| 国产精品白丝jk黑袜喷水| 国产一区二三区| 国产黄色成人av| 国产成人小视频| 国产91精品免费| av在线不卡观看免费观看| 成人性视频网站| 91玉足脚交白嫩脚丫在线播放| 国产白丝精品91爽爽久久| 高清成人在线观看| 96av麻豆蜜桃一区二区| 99视频超级精品| 色天天综合色天天久久| 欧美日韩午夜在线视频| 欧美一区二区三区免费视频| 日韩欧美一二区| 国产日韩欧美制服另类| 国产精品国产三级国产aⅴ中文 | 久草热8精品视频在线观看| 麻豆精品国产91久久久久久| 日本sm残虐另类| 国产精品99久久不卡二区| 99久免费精品视频在线观看| av午夜精品一区二区三区| 色婷婷av久久久久久久| 制服丝袜成人动漫| 久久久一区二区三区| 日韩一区欧美一区| 三级精品在线观看| 国产大陆亚洲精品国产| 色综合一个色综合亚洲| xf在线a精品一区二区视频网站| 精品精品国产高清a毛片牛牛| 国产丝袜欧美中文另类| 亚洲欧美另类久久久精品| 午夜激情一区二区| 福利一区在线观看| 欧美日韩三级在线| 国产精品网友自拍| 奇米888四色在线精品| 处破女av一区二区| 制服丝袜日韩国产| 亚洲欧洲日产国码二区| 日韩精彩视频在线观看| 成人性视频免费网站| 欧美精品免费视频| 亚洲麻豆国产自偷在线| 久久av老司机精品网站导航| 在线免费视频一区二区|