青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

鐵觀音

C++編程寶典

   ::  ::  ::  ::  :: 管理 ::
  1 隨筆 :: 19 文章 :: 0 評論 :: 0 Trackbacks
?

Had this problem before. I guess there are some more interested in a solution.

It seems CSplitterWnd is designed to be used in document/view-based applications only.
But by overriding some virtual methods in a derived class, you can make splitter windows based on CSplitterWnd be used in dialog based application, ActiveX-Controls using MFC:

All virtual methods that call GetParentFrame() in its implementation have to be overridden.
I have done this by using existing code except
- that I replaced the call to GetParentFrame() by a call to GetParent().
- all references or pointers to CFrameWnd were changed to references or pointers to CWnd.

I derived a class CxSplitterWnd from the class CSplitterWnd and proceeded as stated above.
Then I used this class in a dialog based application in the same way as any other CWnd derived class.
For example:

class CSampleDialog : public CDialog
{
	...
	CxSplitterWnd m_wndSplitter;
	....
}

BOOL CSampleDlg::OnInitDialog()
{
...
	// TODO: Add extra initialization here
	m_wndSplitter.CreateStatic(this, 1, 2);
	m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CSampleView), CSize(50,0), NULL);
	m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CSampleView), CSize(0,0), NULL);

	CRect rect = ...;
	m_wndSplitter.MoveWindow(&rect);
	...
}

The sample attached is a dialog based application and demonstrates the use of CxSplitterWnd. It does
nothing useful.

This is the new class declaration:

// SplitWnd.h : implementation file// class CxSplitterWnd : public CSplitterWnd
{
	// Constructionpublic:
	CxSplitterWnd() {};
	virtual ~CxSplitterWnd() {};

	// Operationspublic:
	// Overrides// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CxSplitterWnd)//}}AFX_VIRTUAL // Implementationpublic:
	// These are the methods to be overriddenvirtualvoid StartTracking(int ht);
	virtual CWnd* GetActivePane(int* pRow = NULL, int* pCol = NULL);
	virtualvoid SetActivePane( int row, int col, CWnd* pWnd = NULL );
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	virtual BOOL OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult );
	virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult );

	// Generated message map functionsprotected:
	//{{AFX_MSG(CxSplitterWnd)// NOTE - the ClassWizard will add and remove member functions here.//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

And here the implementation file:
// SplitWnd.cpp : implementation file// #include "stdafx.h"
#include "SplitWnd.h"

#ifdef _DEBUG
#definenew DEBUG_NEW
#undef THIS_FILE
staticchar THIS_FILE[] = __FILE__;
#endif

// HitTest return values (values and spacing between values is important)// Had to adopt this because it has module scope enum HitTestValue
{
	noHit = 0,
	vSplitterBox = 1,
	hSplitterBox = 2,
	bothSplitterBox = 3, // just for keyboard
	vSplitterBar1 = 101,
	vSplitterBar15 = 115,
	hSplitterBar1 = 201,
	hSplitterBar15 = 215,
	splitterIntersection1 = 301,
	splitterIntersection225 = 525
};

/////////////////////////////////////////////////////////////////////////////// CxSplitterWnd 

BEGIN_MESSAGE_MAP(CxSplitterWnd, CSplitterWnd)
//{{AFX_MSG_MAP(CxSplitterWnd)// NOTE - the ClassWizard will add and remove mapping macros here.//}}AFX_MSG_MAP
END_MESSAGE_MAP()

CWnd* CxSplitterWnd::GetActivePane(int* pRow, int* pCol)
{
	ASSERT_VALID(this);
	CWnd* pView = GetFocus();
	// make sure the pane is a child pane of the splitterif (pView != NULL && !IsChildPane(pView, pRow, pCol))
	pView = NULL;
	return pView;
}

void CxSplitterWnd::SetActivePane( int row, int col, CWnd* pWnd)
{
	// set the focus to the pane
	CWnd* pPane = pWnd == NULL ? GetPane(row, col) : pWnd;
	pPane->SetFocus();
}

void CxSplitterWnd::StartTracking(int ht)
{
ASSERT_VALID(this);
	if (ht == noHit)
		return;
	// GetHitRect will restrict 'm_rectLimit' as appropriate
	GetInsideRect(m_rectLimit);
	if (ht >= splitterIntersection1 && ht <= splitterIntersection225)
	{
		// split two directions (two tracking rectangles)int row = (ht - splitterIntersection1) / 15;
		int col = (ht - splitterIntersection1) % 15;
		GetHitRect(row + vSplitterBar1, m_rectTracker);
		int yTrackOffset = m_ptTrackOffset.y;
		m_bTracking2 = TRUE;
		GetHitRect(col + hSplitterBar1, m_rectTracker2);
		m_ptTrackOffset.y = yTrackOffset;
	}
	elseif (ht == bothSplitterBox)
	{
		// hit on splitter boxes (for keyboard)
		GetHitRect(vSplitterBox, m_rectTracker);
		int yTrackOffset = m_ptTrackOffset.y;
		m_bTracking2 = TRUE;
		GetHitRect(hSplitterBox, m_rectTracker2);
		m_ptTrackOffset.y = yTrackOffset;
		// center it
		m_rectTracker.OffsetRect(0, m_rectLimit.Height()/2);
		m_rectTracker2.OffsetRect(m_rectLimit.Width()/2, 0);
	}
	else
	{
		// only hit one bar
		GetHitRect(ht, m_rectTracker);
	}

	// steal focus and capture
	SetCapture();
	SetFocus();
	// make sure no updates are pending
	RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
	// set tracking state and appropriate cursor
	m_bTracking = TRUE;
	OnInvertTracker(m_rectTracker);
	if (m_bTracking2)
	OnInvertTracker(m_rectTracker2);
	m_htTrack = ht;
	SetSplitCursor(ht);
}

/////////////////////////////////////////////////////////////////////////////// CSplitterWnd command routing 
BOOL CxSplitterWnd::OnCommand(WPARAM wParam, LPARAM lParam)
{
	if (CWnd::OnCommand(wParam, lParam))
	return TRUE;
	// route commands to the splitter to the parent frame windowreturn GetParent()->SendMessage(WM_COMMAND, wParam, lParam);
}

BOOL CxSplitterWnd::OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult )
{
	if (CWnd::OnNotify(wParam, lParam, pResult))
	return TRUE;
	// route commands to the splitter to the parent frame window
	*pResult = GetParent()->SendMessage(WM_NOTIFY, wParam, lParam);
	return TRUE;
}

BOOL CxSplitterWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
	// The code line below is necessary ifusing CxSplitterWnd in a regular dll// AFX_MANAGE_STATE(AfxGetStaticModuleState()); return CWnd::OnWndMsg(message, wParam, lParam, pResult);
}
posted on 2006-10-14 10:42 鐵觀音 閱讀(1109) 評論(0)  編輯 收藏 引用 所屬分類: VC界面控件類
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            这里是久久伊人| 一区二区在线观看视频| 亚洲欧美日韩直播| 99国产精品久久久久老师| 日韩视频一区二区在线观看 | 久久久久久穴| 久久九九99| 欧美阿v一级看视频| 欧美高清一区二区| 欧美色图天堂网| 国产婷婷色一区二区三区四区| 国内精品99| 亚洲大片精品永久免费| 一区二区精品在线| 久久精品一区二区三区四区| 欧美成人午夜激情视频| 亚洲精品欧洲| 欧美一区二区视频观看视频| 蜜桃久久av| 国产乱子伦一区二区三区国色天香| 国产精品自拍一区| 亚洲人成在线播放网站岛国| 午夜精品福利视频| 亚洲第一精品夜夜躁人人躁| 欧美激情亚洲自拍| 亚洲一区国产精品| 欧美福利在线观看| 国产欧美日韩综合| 99国产精品| 久久综合网hezyo| 一区二区欧美在线观看| 久久日韩粉嫩一区二区三区| 国产精品久久久久天堂| 亚洲国产一区二区精品专区| 欧美亚洲视频| 99v久久综合狠狠综合久久| 亚洲免费在线观看视频| 欧美成人有码| 久久精品国产第一区二区三区最新章节| 麻豆精品视频在线观看视频| 国产日产精品一区二区三区四区的观看方式| 亚洲国产日韩欧美在线动漫| 久久精品国产精品亚洲| 国产精品99久久久久久白浆小说| 欧美18av| 亚洲国产精品电影| 久久婷婷麻豆| 欧美专区福利在线| 国产欧美一区二区三区另类精品| 一区二区三区四区五区在线| 亚洲国产精品第一区二区三区| 久久精品99无色码中文字幕 | 美女被久久久| 久久国产黑丝| 国产一区二区欧美日韩| 性欧美暴力猛交69hd| 9色porny自拍视频一区二区| 欧美经典一区二区三区| 亚洲人成网站色ww在线| 欧美大胆人体视频| 久久香蕉国产线看观看网| 激情欧美一区二区三区在线观看| 久久国产精品99久久久久久老狼| 亚洲一区三区在线观看| 国产精品日韩欧美综合| 性xx色xx综合久久久xx| 亚洲欧美日韩中文在线制服| 国产欧美一区二区三区另类精品 | 国产精品第2页| 亚洲一区二区三区精品在线| 一区二区三区成人| 国产精品午夜久久| 欧美在线一区二区| 久久精品首页| 亚洲三级免费| 一区二区三区欧美在线观看| 国产精品视频一区二区三区 | 99re在线精品| 亚洲综合精品四区| 国产在线精品一区二区夜色| 免费黄网站欧美| 欧美国产成人精品| 午夜精品久久久久久久久久久| 午夜精品一区二区三区在线播放| 狠狠色狠狠色综合日日五 | 午夜伦欧美伦电影理论片| 国产日韩欧美黄色| 免费欧美电影| 欧美日韩另类综合| 久久国产精品久久久久久久久久 | 久久精品一区蜜桃臀影院| 一色屋精品视频免费看| 亚洲丰满在线| 国产精品一区二区三区久久| 麻豆精品视频| 国产精品igao视频网网址不卡日韩 | 亚洲欧美不卡| 亚洲国产精品传媒在线观看 | 久久精品国产99精品国产亚洲性色 | 一区二区三区四区五区视频| 亚洲欧美国产日韩天堂区| 亚洲高清视频的网址| 一区二区三区.www| 亚洲成在人线av| 午夜精品电影| 在线综合亚洲欧美在线视频| 久久精品国产一区二区电影| 亚洲午夜在线视频| 猛男gaygay欧美视频| 久久精品国产亚洲aⅴ| 欧美精品大片| 欧美成ee人免费视频| 国产精品综合视频| 亚洲国产婷婷香蕉久久久久久99| 国产视频在线一区二区| 夜夜夜精品看看| 亚洲老司机av| 久久一区二区三区超碰国产精品| 性欧美xxxx大乳国产app| 欧美日本一区| 欧美国产日韩免费| 伊伊综合在线| 久久精品91久久香蕉加勒比| 欧美一区二区三区四区在线观看| 欧美精品少妇一区二区三区| 免费人成精品欧美精品| 国产亚洲一本大道中文在线| 亚洲在线免费视频| 亚洲一区二区在线| 欧美精品一区在线发布| 亚洲成在线观看| 亚洲国产精品久久人人爱蜜臀| 欧美在线视频导航| 久久精品免费看| 国内外成人在线视频| 欧美综合国产精品久久丁香| 欧美在线免费| 国产亚洲精品久久久久婷婷瑜伽| 亚洲欧美日韩电影| 欧美在线三区| 国产一区再线| 久久亚洲欧美国产精品乐播| 欧美精品久久一区二区| 欧美国产日韩一二三区| 香蕉亚洲视频| 国产精品色午夜在线观看| 亚洲无亚洲人成网站77777| 亚洲一区二区三区在线看 | 国产偷久久久精品专区| 亚洲欧美中文字幕| 久久综合成人精品亚洲另类欧美| 伊人婷婷欧美激情| 蜜乳av另类精品一区二区| 亚洲国内精品| 亚洲视频欧洲视频| 国产精品久久久久久一区二区三区| 亚洲欧美日韩一区二区在线| 久久久亚洲国产天美传媒修理工| 今天的高清视频免费播放成人 | 久久久久国产精品一区二区| 欧美刺激性大交免费视频| 日韩视频三区| 国产精品久久一卡二卡| 久久九九精品| 亚洲精品一区二区三区不| 亚洲伊人一本大道中文字幕| 国产一级久久| 免费观看日韩av| 中文av一区特黄| 麻豆乱码国产一区二区三区| 一本色道久久综合狠狠躁篇的优点| 国产精品videosex极品| 久久精品日产第一区二区| 亚洲国产午夜| 久久久久久久国产| 一本色道久久综合亚洲精品婷婷 | 国产一区二区成人| 欧美成熟视频| 欧美一区二区免费视频| 亚洲精品国精品久久99热一| 久久精品国产免费看久久精品| 99国产麻豆精品| 伊人成人开心激情综合网| 国产精品久久久久久福利一牛影视 | 午夜免费日韩视频| 日韩亚洲在线观看| 母乳一区在线观看| 欧美一区=区| 一区二区三区精品国产| 在线日本欧美| 国产日韩欧美二区| 欧美无砖砖区免费| 欧美不卡在线视频| 性欧美1819性猛交| 一区二区久久| 亚洲精品美女在线观看播放| 女人色偷偷aa久久天堂| 久久精品国产亚洲aⅴ| 亚洲欧美日韩在线不卡| 99热精品在线|