亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产不卡视频一区| 26uuu色噜噜精品一区| 91精品国产一区二区| 久久久国产精品午夜一区ai换脸| 夜夜嗨av一区二区三区四季av| 青青草成人在线观看| 色偷偷久久人人79超碰人人澡| 久久久青草青青国产亚洲免观| 日韩国产一区二| 欧美中文字幕一区二区三区| 国产精品高清亚洲| 成人三级伦理片| 久久日一线二线三线suv| 免费观看成人av| 在线电影一区二区三区| 亚洲综合在线五月| 91麻豆免费在线观看| 亚洲欧美在线视频| 成人h精品动漫一区二区三区| 久久这里只有精品视频网| 美女视频黄 久久| 69堂精品视频| 亚洲高清免费在线| 欧美日韩一区二区三区在线看| 亚洲视频每日更新| 91影视在线播放| 一区在线中文字幕| 91社区在线播放| 亚洲美女少妇撒尿| 欧洲精品在线观看| 亚洲福利一二三区| 91精品国产欧美一区二区成人| 首页国产欧美日韩丝袜| 欧美日韩高清在线播放| 肉肉av福利一精品导航| 欧美一区二区高清| 久久成人麻豆午夜电影| 久久精品视频在线免费观看| 国产999精品久久久久久绿帽| 日本一区二区成人| 色综合久久天天| 五月婷婷欧美视频| 日韩欧美国产精品| 国产黑丝在线一区二区三区| 国产精品日韩精品欧美在线| www.亚洲精品| 亚洲一区二区三区四区在线| 欧美一区二区三区在线看| 久久电影网站中文字幕| 国产精品天美传媒沈樵| 欧美午夜精品理论片a级按摩| 午夜精品福利一区二区三区av | 欧美三级三级三级| 日本中文字幕一区二区视频| 久久午夜电影网| 91蝌蚪porny九色| 午夜成人在线视频| 国产亚洲福利社区一区| 一本大道av伊人久久综合| 丝袜诱惑亚洲看片| 亚洲国产成人自拍| 欧美日韩三级在线| 国产精品18久久久久久久网站| 亚洲色图欧美激情| 欧美成人r级一区二区三区| av不卡一区二区三区| 日韩黄色小视频| 国产精品久久久久久久久免费相片| 91九色最新地址| 国产激情一区二区三区桃花岛亚洲| 亚洲柠檬福利资源导航| 欧美精品一区二区精品网| 99在线精品免费| 精品中文字幕一区二区| 一区二区三区在线免费观看| 久久综合色8888| 欧美三级三级三级| 色综合天天综合| 国产精品一区二区免费不卡 | 国产精品自拍一区| 午夜欧美一区二区三区在线播放| 欧美激情中文不卡| 日韩欧美精品三级| 欧美精品v日韩精品v韩国精品v| 菠萝蜜视频在线观看一区| 奇米亚洲午夜久久精品| 亚洲美女电影在线| 亚洲国产高清在线| 欧美精品一区视频| 日韩一级片在线观看| 欧洲av在线精品| 91在线免费播放| 国产成人精品亚洲777人妖| 久久精品国产精品亚洲红杏| 亚洲国产一区二区三区| 亚洲欧美日韩在线| 国产精品久久久久aaaa| 久久精品视频免费| 久久久久九九视频| 久久久午夜电影| 久久久久久影视| 亚洲精品在线电影| 久久影院电视剧免费观看| 91精品国产91综合久久蜜臀| 欧美日韩一区二区在线观看| 在线精品视频一区二区| 91福利社在线观看| 91视视频在线观看入口直接观看www | 精品少妇一区二区三区日产乱码| 欧美图区在线视频| 欧美日韩aaaaaa| 欧美丰满少妇xxxxx高潮对白 | 亚洲国产精品久久人人爱| 亚洲视频一区二区在线| 亚洲黄色在线视频| 亚洲国产一二三| 日本va欧美va欧美va精品| 日韩成人一级大片| 麻豆91精品视频| 精品一区二区三区在线观看| 精品一区二区影视| 成人久久18免费网站麻豆| 99久久99久久综合| 91福利精品第一导航| 欧美日韩国产天堂| 日韩视频永久免费| 国产喷白浆一区二区三区| 国产午夜精品在线观看| 亚洲欧洲日产国码二区| 夜夜夜精品看看| 久久超碰97中文字幕| 成人在线一区二区三区| 在线欧美日韩国产| 欧美一级一级性生活免费录像| 久久综合一区二区| 综合激情成人伊人| 青青草国产成人av片免费| 国产黄人亚洲片| 欧美亚洲国产一区二区三区va | 亚洲超丰满肉感bbw| 久久国产精品一区二区| 不卡一区二区三区四区| 69堂成人精品免费视频| 国产精品色在线观看| 亚洲成av人片| 成人黄色一级视频| 在线成人免费视频| 中文在线免费一区三区高中清不卡| 亚洲乱码中文字幕| 人禽交欧美网站| av中文一区二区三区| 欧美一区二区免费| 综合在线观看色| 老司机一区二区| 欧美三级韩国三级日本一级| 久久久五月婷婷| 石原莉奈在线亚洲二区| 99久久免费视频.com| 欧美不卡在线视频| 亚洲国产wwwccc36天堂| 成人美女在线视频| 欧美大黄免费观看| 亚洲一区二区精品3399| 国产麻豆精品视频| 欧美精品自拍偷拍动漫精品| 国产精品色呦呦| 国产精品一区二区三区四区| 91麻豆精品国产综合久久久久久| 中文字幕一区免费在线观看| 蜜臂av日日欢夜夜爽一区| 在线观看免费一区| 亚洲欧美自拍偷拍色图| 国产91在线观看丝袜| 欧美成人bangbros| 秋霞国产午夜精品免费视频| 91国偷自产一区二区开放时间| 国产偷国产偷精品高清尤物 | 三级一区在线视频先锋| 色欧美片视频在线观看在线视频| 久久精品人人爽人人爽| 美国十次综合导航| 欧美一级二级在线观看| 亚洲va欧美va人人爽| 欧美视频一区二区在线观看| 亚洲欧美另类在线| av资源网一区| 自拍偷拍国产精品| 99视频一区二区三区| 国产清纯在线一区二区www| 极品少妇xxxx精品少妇| 精品国产伦一区二区三区免费 | 欧美成人女星排行榜| 日韩激情视频网站| 日韩一区二区三区在线视频| 日本系列欧美系列| 3d动漫精品啪啪一区二区竹菊| 午夜久久电影网| 欧美一区二区黄色| 九一久久久久久| 久久久国产精华|