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

鐵觀音

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 鐵觀音 閱讀(1115) 評論(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>
            欧美电影免费| 91久久嫩草影院一区二区| 一区二区欧美国产| 国产精品久久久一区二区三区| 亚洲国产日韩欧美在线动漫| 欧美成人在线免费视频| 欧美gay视频激情| 99re成人精品视频| 一个色综合导航| 国产欧美va欧美va香蕉在| 久久精品久久综合| 免费看精品久久片| 中文亚洲字幕| 欧美一区二区三区免费看| 在线播放日韩欧美| 亚洲精品久久久久久久久久久久久| 欧美人与性动交α欧美精品济南到| 一本久久综合亚洲鲁鲁五月天| 亚洲免费电影在线观看| 国产欧美日韩一区二区三区| 免费中文日韩| 欧美日韩精品在线| 久久久久免费观看| 欧美日韩午夜在线| 久久久人成影片一区二区三区 | 亚洲国产天堂久久国产91| 欧美激情影音先锋| 欧美一区二区精品在线| 久久乐国产精品| 中日韩男男gay无套| 欧美一区二区在线免费观看 | 欧美三级视频| 久久在线精品| 国产精品videosex极品| 久久午夜精品| 国产精品人成在线观看免费| 免播放器亚洲| 国产嫩草一区二区三区在线观看 | 免费日韩一区二区| 国产精品你懂得| 亚洲国产一区二区视频| 国产亚洲精品久久久久婷婷瑜伽| 欧美福利电影网| 国产伦精品一区二区三区照片91| 亚洲青涩在线| 亚洲成在人线av| 欧美一区二区三区男人的天堂 | 韩日精品视频一区| 一区二区福利| 99国产精品视频免费观看一公开 | 亚洲国产精品精华液2区45| 国产丝袜美腿一区二区三区| 中文日韩电影网站| 99视频精品免费观看| 久久这里只有| 久久手机免费观看| 国产日产欧产精品推荐色 | 亚洲视频免费看| 亚洲免费观看视频| 欧美14一18处毛片| 欧美激情第9页| 精品1区2区| 久久久精品国产99久久精品芒果| 欧美主播一区二区三区美女 久久精品人| 欧美国产精品久久| 亚洲福利电影| 亚洲精品一区中文| 欧美大片一区| 亚洲日本视频| 日韩午夜电影| 欧美刺激午夜性久久久久久久| 免费欧美日韩| 亚洲精品久久嫩草网站秘色| 麻豆精品一区二区av白丝在线| 免费观看成人www动漫视频| 在线观看福利一区| 美女主播精品视频一二三四| 美女视频黄 久久| 亚洲国产欧美不卡在线观看| 久久中文字幕导航| 亚洲人成欧美中文字幕| 99国内精品久久久久久久软件| 欧美韩日视频| 99精品视频一区二区三区| 亚洲砖区区免费| 国产麻豆午夜三级精品| 久久成人18免费网站| 免费亚洲婷婷| 日韩网站在线| 国产欧美日本| 裸体一区二区三区| 亚洲九九九在线观看| 亚洲制服丝袜在线| 国产欧美精品在线| 蜜桃av一区| 一本色道久久99精品综合| 欧美主播一区二区三区美女 久久精品人| 国产亚洲亚洲| 免费观看久久久4p| 亚洲天堂视频在线观看| 久久一区二区三区超碰国产精品| 亚洲精品国产精品国自产观看浪潮| 欧美日韩国产综合视频在线观看| 亚洲天堂成人在线视频| 久久午夜精品| 亚洲视频免费观看| 国产一区自拍视频| 欧美日韩国产欧| 久久都是精品| 日韩视频在线播放| 免费久久99精品国产| 亚洲一本视频| 亚洲国产成人午夜在线一区| 国产精品第一页第二页第三页| 久久国产日韩欧美| 亚洲精品孕妇| 欧美mv日韩mv国产网站| 亚洲欧美激情诱惑| 亚洲人www| 狠狠色狠狠色综合| 国产精品九色蝌蚪自拍| 农夫在线精品视频免费观看| 亚洲午夜精品久久久久久app| 牛人盗摄一区二区三区视频| 亚洲欧美成人一区二区在线电影| 亚洲国产精品va在线看黑人| 国产精品一区二区在线观看不卡| 欧美国产日韩一区二区| 久久久久.com| 欧美一级在线播放| 亚洲网站视频| 一本一本久久| 亚洲黄色一区二区三区| 欧美大色视频| 久久综合网hezyo| 久久aⅴ国产欧美74aaa| 亚洲欧美激情视频在线观看一区二区三区| 亚洲国产精品久久久| 狠久久av成人天堂| 国内成+人亚洲| 国产女人aaa级久久久级| 国产精品成人免费视频| 欧美日韩一区二区三区在线观看免| 久久久久久亚洲精品杨幂换脸 | 亚洲九九爱视频| 亚洲经典在线| 亚洲人午夜精品免费| 亚洲成色最大综合在线| 欧美激情第8页| 蜜桃久久av| 欧美阿v一级看视频| 欧美顶级大胆免费视频| 免费h精品视频在线播放| 六十路精品视频| 欧美11—12娇小xxxx| 欧美福利网址| 欧美日韩国产一区精品一区 | 国产精品久久久久久久久久尿| 欧美日本一道本| 欧美日韩在线播放| 欧美午夜精品伦理| 国产欧美婷婷中文| 韩国三级电影一区二区| 亚洲国产成人av好男人在线观看| 亚洲国产成人久久综合| 99国产精品国产精品毛片| 亚洲一区二区不卡免费| 午夜精品久久久| 久久久水蜜桃| 亚洲缚视频在线观看| 日韩视频二区| 欧美一区二区三区在线视频| 久久米奇亚洲| 欧美久久精品午夜青青大伊人| 欧美色中文字幕| 国产一区二区三区视频在线观看| 在线成人激情视频| 夜夜嗨一区二区| 欧美一级一区| 欧美成人免费va影院高清| 日韩视频一区二区三区在线播放| 亚洲综合好骚| 玖玖玖免费嫩草在线影院一区| 欧美日韩精品是欧美日韩精品| 国产精品一区二区你懂得| 在线欧美电影| 亚洲欧美在线播放| 欧美国产激情二区三区| 一二三区精品福利视频| 两个人的视频www国产精品| 国产精品国产三级国产普通话蜜臀| 国产又爽又黄的激情精品视频 | 国产日韩成人精品| 亚洲人被黑人高潮完整版| 久久国产乱子精品免费女| 亚洲国产欧美国产综合一区 | 亚洲高清精品中出| 亚洲欧美激情四射在线日 | 亚洲永久精品国产| 欧美交受高潮1|