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

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

?? toolbarex.cpp

?? 在GB碼和Big5碼間轉換,在GB碼和Big5碼間轉換
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// ToolBarEx.cpp : implementation file
//
// Description:
//	CToolBarEx provides additional features to the standard toolbar
//	"CToolBar". The main addition is the flat mode (last seen in
//	Developer Studio 5.0).
//	There are no special requirements for having the flat mode in your
//	application (no special comctl32.dll or what ever)!
//	If you need custom draw abilities, then you have to use VC++ >= 4.2
//	However, the flat mode should work with older versions of VC++ too (let
//	me know of your experiences!)
//
// Usage:
//	The only task you have to perform, is to
//		#include "ToolBarEx.h"
//	in either StdAfx.h or MainFrm.h and to change the type of
//	CMainFrame::m_wndToolBar from CToolBar to CToolBarEx.
//	Don't forget to recompile :-)
//
// Acknowledgements:
//	o	The main idea of how to draw a separator and the gripper is stolen
//		from Roger Onslow's MSIE flat toolbar.
//		Thanks for saving my time, Roger ;-)
//	o	The embossed drawing of a disabled image came from
//		Victor M. Vogelpoel (victorv@telic.nl)
//	o	Some hints for buttons with text came from
//		David Bates (bates@econ.ubc.ca)
//		(I'm still thinking, text on toolbar-buttons is broken.
//		That has to be tooltip's work. However, texts on buttons
//		now work)
//
//
// (known) bugs and limitations:
//	o	the CDRF_NEWFONT notification is still untested ...
//	o	Assigning texts to buttons may cause the buttons to
//		resize horizontally without notified by CToolBar. This
//		leads to a wrong calculation inside CalcDynamicLayout()
//		and CalcFixedLayout(). One could override both these
//		functions in derived classes to avoid that problem,
//		but that would be a greater pain ...
//
//	if you find others (and have a solution for them ?!), please let me know:
//		Joerg.Koenig@rhein-neckar.de		(private site) or
//		J.Koenig@adg.de						(company site)
//
// Changes:
//	30.10.97
//	o	texts on buttons now work
//	o	gripper improved for a closer look like Office97
//	o	disabled images now look embossed
//	o	a separator is drawn only if it has no WRAP state set



#include "stdafx.h"
#include "ToolBarEx.h"

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


/////////////////////////////////////////////////////////////////////////////
// local helper class CCustomDrawInfo
//
// The helper class CCustomDrawInfo handles the messaging to the docking
// frame of the toolbar in flat mode only. If flat-mode is disabled, then
// MFC's own messanger will be used.
//
// A few words about custom draw on toolbars:
// o custom draw is possible for MFC >= 4.2 only (older versions don't know
//   anything about certain structures ...)
// o MFC does not set the "rc" member of NMCUSTOMDRAW to the rectangle of the
//	 button that will be drawn. However, we do, so watch out, wether the
//	 toolbar is flat or not (or ignore the "rc" member in both cases).
//	 If the current mode is not "flat", then MFC's art of message arrives ...
// o MFC does not send a message for separators, so we too don't do it.
// o It seems that MFC toolbars never send *ERASE notifications; instead they
//   send TBN_QUERYDELETE for instance.
// o The CDRF_NEWFONT notification result is ignored (in flat mode. Never
//   tried with original MFC, because it is broken on toolbars).
/////////////////////////////////////////////////////////////////////////////

class CCustomDrawInfo {

#if _MFC_VER >= 0x0420
	NMCUSTOMDRAW	m_CDRW;				// custom draw information holder
	LRESULT			m_PrePaint;			// result from prepaint notification
	LRESULT			m_ItemPrePaint;		// dito for specific item
	CToolBarEx *	m_pToolBar;			// the real sender of the notification
	CWnd *			m_pReceiver;		// the receiver of the notification

	LRESULT			NotifyParent();
#endif // _MFC_VER

	public:		// construction
		CCustomDrawInfo( CDC & dc, CToolBarEx * pToolBar );

	public:
		// NotifyItemPrePaint() returns TRUE,
		// if the user wants to do the default
		// (CDRF_DODEFAULT) or FALSE, if the
		// user wants to skip (CDRF_SKIPDEFAULT)
		// Note that CDRF_SKIPDEFAULT is not
		// allowed for CDDS_PREPAINT, CDDS_POSTPAINT !
		// and CDDS_ITEMPOSTPAINT
		void	NotifyPrePaint();
		BOOL	NotifyItemPrePaint(int item);
		void	NotifyItemPostPaint(int item);
		void	NotifyPostPaint();
};


#if _MFC_VER >= 0x420

	LRESULT CCustomDrawInfo :: NotifyParent() {
		LRESULT lRes = CDRF_DODEFAULT;

		if( m_pReceiver )
			lRes = m_pReceiver->SendMessage(WM_NOTIFY,
											WPARAM(m_CDRW.hdr.idFrom),
											LPARAM(&m_CDRW));
		return lRes;
	}


	CCustomDrawInfo :: CCustomDrawInfo( CDC & dc, CToolBarEx * pBar )
		: m_PrePaint(0)
		, m_ItemPrePaint(0)
	{
		VERIFY((m_pToolBar = pBar) != 0);
		VERIFY((m_CDRW.hdc = dc.GetSafeHdc()) != 0);

		HWND hwnd = pBar->GetSafeHwnd();
		VERIFY(::IsWindow(hwnd));

		// initialise the NMHDR member of the customdraw structure
		m_CDRW.hdr.hwndFrom = hwnd;
		m_CDRW.hdr.idFrom = UINT(::GetWindowLong(hwnd, GWL_ID));
		m_CDRW.hdr.code = NM_CUSTOMDRAW;

		// Do not use CControlBar::GetDockingFrame() to receive
		// the parent. CWnd::GetParent() is inacceptable too.
		// Both these functions don't work, if the toolbar is
		// floating in the air!
		m_pReceiver = pBar->GetParentFrame();
		if( m_pReceiver )
			VERIFY(::IsWindow(m_pReceiver->GetSafeHwnd()));
	}

	void CCustomDrawInfo :: NotifyPrePaint() {
		// fill the customdraw structure with values for CDDS_PREPAINT
		m_CDRW.dwDrawStage = CDDS_PREPAINT;
		// the rest of the structure stays undefined in this stage
		// of drawing.
		m_PrePaint = NotifyParent();
	}

	BOOL CCustomDrawInfo :: NotifyItemPrePaint( int nItem ) {
		BOOL bRet = TRUE;	// we assume to do the default
		if( m_PrePaint & CDRF_NOTIFYITEMDRAW ) {
			m_CDRW.dwDrawStage = CDDS_ITEMPREPAINT;
			m_pToolBar->GetItemRect(nItem, &m_CDRW.rc);
			m_CDRW.dwItemSpec = DWORD(m_pToolBar->GetItemID(nItem));
			UINT uStyle = m_pToolBar->GetButtonStyle(nItem);
			BOOL bEnable = m_pToolBar->GetToolBarCtrl()
							.IsButtonEnabled(m_CDRW.dwItemSpec);
			m_CDRW.uItemState = (bEnable ? 0 : CDIS_DISABLED) |
								(((uStyle & TBBS_PRESSED) || (uStyle & TBBS_CHECKED)) ?
									CDIS_CHECKED : 0);
			m_CDRW.lItemlParam = 0;
			m_ItemPrePaint = NotifyParent();
			if( m_ItemPrePaint & CDRF_SKIPDEFAULT )
				bRet = FALSE;
		}
		return bRet;
	}

	void CCustomDrawInfo :: NotifyItemPostPaint( int nItem ) {
		if( m_ItemPrePaint & CDRF_NOTIFYPOSTPAINT ) {
			m_CDRW.dwDrawStage = CDDS_ITEMPOSTPAINT;
			// the rest of the data has not been changed since ITEMPREPAINT
			// make sure it is so:
			ASSERT(m_pToolBar->GetItemID(nItem) == m_CDRW.dwItemSpec);
			NotifyParent();
		}
	}

	void CCustomDrawInfo :: NotifyPostPaint() {
		if( m_PrePaint & CDRF_NOTIFYPOSTPAINT ) {
			m_CDRW.dwDrawStage = CDDS_POSTPAINT;
			NotifyParent();
		}
	}
			
#else	// _MFC_VER < 4.2

	CCustomDrawInfo :: CCustomDrawInfo( CDC & dc, CWnd * pParent ) {
	}

	void CCustomDrawInfo :: NotifyPrePaint() {
	}

	void CCustomDrawInfo :: NotifyPostPaint() {
	}
	
	BOOL CCustomDrawInfo :: NotifyItemPrePaint( int ) {
		return TRUE;	// we always make the drawing by ourself
	}

	void CCustomDrawInfo :: NotifyItemPostPaint( int ) {
	}

#endif	// _MFC_VER



/////////////////////////////////////////////////////////////////////////////
// CToolBarEx

CToolBarEx::CToolBarEx()
	: m_bFlatLook(TRUE)
	, m_clrBtnFace(::GetSysColor(COLOR_BTNFACE))
	, m_clrBtnHilight(::GetSysColor(COLOR_BTNHILIGHT))
	, m_clrBtnShadow(::GetSysColor(COLOR_BTNSHADOW))
	, m_nLastBtn(-1)
	, m_uTimerEvent(0)
{
	CalculateOffset();

	// create the default font, used for buttons with text
	CFont Font;
	BOOL bOldSys = FALSE;
	if( ! Font.CreateStockObject( DEFAULT_GUI_FONT ) ) {
		// older versions of Windows* (NT 3.51 for instance)
		// fail with DEFAULT_GUI_FONT
		VERIFY( Font.CreateStockObject( SYSTEM_FONT ) );
		bOldSys = TRUE;
	}
	LOGFONT logfont ;
	Font.GetLogFont( &logfont ) ;
	if( bOldSys ) {
		logfont.lfWeight = 400;
		strcpy(logfont.lfFaceName,"MS Sans Serif");
	}
	logfont.lfHeight = 6 ;
	logfont.lfWidth = 0 ;	// let windows compute this.
	VERIFY( m_GuiFont.CreateFontIndirect( &logfont ) ) ;
}

CToolBarEx::~CToolBarEx()
{
}


IMPLEMENT_DYNAMIC(CToolBarEx, CToolBar)


BEGIN_MESSAGE_MAP(CToolBarEx, CToolBar)
	//{{AFX_MSG_MAP(CToolBarEx)
	ON_WM_PAINT()
	ON_WM_SYSCOLORCHANGE()
	ON_WM_NCCALCSIZE()
	ON_WM_MOUSEMOVE()
	ON_WM_NCPAINT()
	ON_WM_TIMER()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
	ON_MESSAGE(TB_SETBUTTONSIZE, OnSetButtonSize)
	ON_MESSAGE(TB_SETBITMAPSIZE, OnSetBitmapSize)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CToolBarEx message handlers

LRESULT CToolBarEx :: OnSetButtonSize(WPARAM wParam, LPARAM lParam) {
	LRESULT lResult = CToolBar::OnSetButtonSize(wParam, lParam);
	if( lResult )
		CalculateOffset();
	return lResult;
}

LRESULT CToolBarEx :: OnSetBitmapSize(WPARAM wParam, LPARAM lParam) {
	LRESULT lResult = CToolBar::OnSetBitmapSize(wParam, lParam);
	if( lResult )
		CalculateOffset();
	return lResult;
}


void CToolBarEx::OnPaint() 
{
	HIMAGELIST hImg = GetImageList();

#ifdef _DEBUG
	if( hImg == 0 ) {
		TRACE0("CToolBarEx::OnPaint(): could not get image list\n");
	}
#endif

	if( m_bFlatLook && hImg ) {
		CRect rcUpdate;
		if( ! GetUpdateRect(rcUpdate) )
			return;

		if( m_pStringMap && !m_pStringMap->IsEmpty() )
			CalculateOffset();		// strings may have been added

		// attach image-list for even more MFC feeling :)
		CImageList imglist;
		imglist.Attach(hImg);

		POINT cursor;
		::GetCursorPos(&cursor);
		ScreenToClient(&cursor);

		CPaintDC dc(this); // device context for painting
		CFont * pOldFont = dc.SelectObject(&m_GuiFont);

		// Now it's time for the first custom-draw-notification...
		CCustomDrawInfo cdrw(dc, this);
		cdrw.NotifyPrePaint();

		register const int nBtn = GetToolBarCtrl().GetButtonCount();

		for( register int i = 0; i < nBtn; ++i ) {
			CRect rc;
			GetItemRect(i, rc);

			int nBitmap; UINT uID, uStyleState;
			GetButtonInfo(i, uID, uStyleState, nBitmap);
			WORD wStyle = LOWORD(uStyleState);
			WORD wState = HIWORD(uStyleState);

			if( wState & TBSTATE_HIDDEN )
				continue;

			if( wStyle == TBSTYLE_SEP ) {
				if( !(wState & TBSTATE_WRAP) )
					DrawSeparator(dc, rc);
			} else {
				if( ! CRect().IntersectRect(rcUpdate, rc) )
					continue;	// this button needs no repaint

				// maybe the button has text
				dc.SetTextColor(RGB(0,0,0));
				dc.SetBkColor(m_clrBtnFace);

				// There is a bug in CToolBar: If there are texts assigned
				// to buttons, then the button-widths may change transparently
				// (without notified by CToolBar), so we recalculate the
				// horizontal offset here:
				m_sizeOffset.cx = (rc.Width() - m_sizeImage.cx) / 2;

				if( ! cdrw.NotifyItemPrePaint(i) )
					continue;	// parent has already drawn the button

				BOOL bBtnDown = (wState & TBSTATE_CHECKED) || (wState & TBSTATE_PRESSED);
				BOOL bBtnEnabled = GetToolBarCtrl().IsButtonEnabled(int(uID));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱国产乱300精品| 欧美欧美午夜aⅴ在线观看| 91同城在线观看| 欧美高清精品3d| 自拍av一区二区三区| 精品一区二区免费视频| 99久久精品国产一区| 欧美v日韩v国产v| 亚洲一区二区三区四区中文字幕| 国产露脸91国语对白| 日韩午夜精品电影| 亚洲国产婷婷综合在线精品| 9久草视频在线视频精品| 精品999在线播放| 蜜臀av性久久久久蜜臀aⅴ流畅| 色成人在线视频| 亚洲日本在线视频观看| 国产成人av在线影院| 26uuu国产在线精品一区二区| 日韩国产一二三区| 8v天堂国产在线一区二区| 亚洲品质自拍视频| 色视频成人在线观看免| 中文字幕av不卡| 不卡在线观看av| 国产精品女主播av| 99精品黄色片免费大全| 国产精品免费久久| 99久免费精品视频在线观看 | 奇米一区二区三区av| 欧美日韩精品欧美日韩精品一 | 国产成人午夜99999| 精品国产髙清在线看国产毛片| 日本午夜一区二区| 欧美大片顶级少妇| 国产精品99精品久久免费| 久久久国产精华| 99热国产精品| 亚洲男人的天堂一区二区| 在线一区二区三区四区五区| 一区二区三区产品免费精品久久75| 在线观看中文字幕不卡| 亚洲6080在线| 欧美不卡一二三| 国产成人av一区二区| 国产日韩综合av| 国产福利91精品一区| 久久先锋影音av鲁色资源| 激情综合一区二区三区| www激情久久| www.视频一区| 亚洲国产美国国产综合一区二区| 欧美精品在线视频| 国产美女在线精品| 亚洲精品亚洲人成人网| 6080亚洲精品一区二区| 奇米777欧美一区二区| 2024国产精品| 99热精品一区二区| 日本午夜精品视频在线观看| 国产日韩综合av| 欧美视频一区二区三区在线观看| 麻豆国产91在线播放| 国产精品久99| 日韩午夜精品电影| 色综合婷婷久久| 亚洲免费三区一区二区| 91精品国产综合久久香蕉的特点| 亚欧色一区w666天堂| 日韩一级片网站| 91视频免费看| 另类综合日韩欧美亚洲| 亚洲三级久久久| 欧美变态凌虐bdsm| 色婷婷亚洲一区二区三区| 久久超碰97人人做人人爱| 亚洲精品视频在线看| 精品国产一区二区三区不卡| 色就色 综合激情| 国产精品一区二区黑丝| 亚洲精品一二三| 中文字幕第一区第二区| 欧美一区二区三区在线看| 99久久综合国产精品| 国产一区二区不卡在线| 性欧美疯狂xxxxbbbb| 亚洲色图制服诱惑 | 欧美一区二区三区四区高清| 91麻豆精品国产综合久久久久久| 精品一区二区免费视频| 亚洲午夜免费福利视频| 中文字幕一区二区三区av| 精品欧美乱码久久久久久1区2区| 色综合久久久久综合体桃花网| 国产精品自拍网站| 久久国产日韩欧美精品| 天堂va蜜桃一区二区三区漫画版| 亚洲欧美另类久久久精品2019| 国产亚洲视频系列| 精品国产电影一区二区| 日韩欧美国产系列| 日韩欧美电影一区| 日韩区在线观看| 日韩欧美aaaaaa| 日韩欧美一级二级三级久久久| 欧美日韩久久不卡| 在线观看日韩国产| 欧美亚洲日本国产| 精品视频1区2区| 欧美日韩久久一区| 人禽交欧美网站| 午夜久久久久久久久| 日韩毛片视频在线看| 国产欧美一二三区| 日韩一区欧美一区| 最新日韩av在线| 亚洲男人电影天堂| 亚洲一级在线观看| 日本欧美一区二区在线观看| 日韩精品电影在线| 精品一区二区三区在线观看 | 欧美激情在线一区二区三区| 久久久精品一品道一区| 欧美激情中文不卡| 亚洲免费观看在线视频| 亚洲电影中文字幕在线观看| 香蕉久久夜色精品国产使用方法| 香蕉影视欧美成人| 国产在线精品国自产拍免费| 国产在线播精品第三| 大陆成人av片| 欧美午夜精品理论片a级按摩| 精品视频一区二区不卡| 日韩精品一区二区三区swag | 香蕉av福利精品导航| 天天亚洲美女在线视频| 乱中年女人伦av一区二区| 久久精品免费看| yourporn久久国产精品| 欧美日韩专区在线| 欧美精品一区二区三区四区 | 不卡在线观看av| 欧美日韩激情一区二区三区| 91麻豆精品91久久久久久清纯 | 国产99久久久国产精品潘金| 色呦呦网站一区| 精品成人a区在线观看| 成人免费小视频| 欧美aaa在线| 99国产精品久久久久久久久久 | 波多野结衣中文字幕一区| 欧美日韩mp4| 国产精品视频观看| 首页综合国产亚洲丝袜| 成人午夜视频福利| 欧美一区午夜视频在线观看| 国产亲近乱来精品视频| 日日夜夜一区二区| 91在线观看地址| 精品国产乱码久久久久久蜜臀| 亚洲欧美偷拍卡通变态| 久久99精品国产91久久来源| 色综合久久综合| 国产亚洲欧美日韩俺去了| 日韩精品亚洲一区二区三区免费| 99久久精品一区| 久久久久99精品一区| 美女精品一区二区| 91国产视频在线观看| 中文字幕乱码亚洲精品一区| 蜜桃视频一区二区三区在线观看| 91福利在线观看| 亚洲国产精品激情在线观看| 美女性感视频久久| 欧美最猛黑人xxxxx猛交| 中文字幕中文在线不卡住| 国产专区综合网| 日韩精品中文字幕一区二区三区 | 日韩精品一区在线| 日日摸夜夜添夜夜添国产精品 | 在线观看国产一区二区| 国产精品午夜久久| 国产成人免费在线视频| 精品999久久久| 国产原创一区二区| 精品剧情在线观看| 久久国产精品一区二区| 日韩欧美国产成人一区二区| 日韩精品亚洲一区| 91精品国产综合久久精品app| 亚洲一区在线播放| 欧美性生交片4| 午夜私人影院久久久久| 欧美日韩国产一级二级| 亚洲一区二区三区四区五区黄| 欧美专区日韩专区| 午夜亚洲福利老司机| 欧美一级二级三级蜜桃| 日韩精品每日更新| 日韩亚洲国产中文字幕欧美|