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

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

?? richeditpage.cpp

?? 《MFC窗口程序設計》書籍源碼 詳細講解MFC框架程序設計
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
// @parm    DWORD  | dwCookie | handle to the file in which will be 
//								the rich edit control content
// @parm    LPBYTE | pbBuff   | Pointer to a buffer to write to .
//                              For a stream-out (write) operation, 
//                              the buffer contains data from the 
//								control that the callback function 
//								writes to some storage 
// @parm    LONG   | cb       | Number of bytes to write 
// @parm    LONG   | *pcb     | Pointer to a variable that the 
//								callback function sets to the number 
//								of bytes actually write  
//----------------------------------------------------------------------------
// @prog 
// Frunza Adriana
// @revs 
// 20-09-2001 - First implementation
//----------------------------------------------------------------------------
// @todo 
//----------------------------------------------------------------------------
	
DWORD CALLBACK CRicheditPage::MyStreamOutCallback(DWORD dwCookie, 
								LPBYTE pbBuff, LONG cb, LONG *pcb)
{
   CFile* pFile = (CFile*) dwCookie;
   pFile->Write(pbBuff, cb);
   *pcb = cb;
   return 0;
}

// function added with classwizard in 20 september 2001
void CRicheditPage::OnFileSaveAs() 
{
	m_nFileNew++;
if ( m_bBeginWriting )
{ 
	if ( m_nBeginWriting==1)
	{

	// I define the file dialog
	CFileDialog fileDlg(FALSE, "rtf", NULL, OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT,
                       "rtf files(*.rtf)|*.rtf|");
	// display the file dialog
	if (fileDlg.DoModal () == IDCANCEL) 
	{
		m_nBeginWriting=0;
		m_rtf.SetModify(); 
		return;
	}

	// I obtain the file name
	CString filename = fileDlg.GetPathName ();
    m_strFilename=filename; 
	CFile fis;
	
	EDITSTREAM es;
	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback; 

	// I open the file with tne modeWrite and modeCreate mode
	fis.Open(filename, CFile::modeCreate | CFile::modeWrite);

	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback;
	// I put the content in the file
	m_rtf.StreamOut(SF_RTF, es);
	fis.Close();
	m_rtf.SetModify(FALSE); 
	}// end m_nBeginWriting == 1
	else if ( m_nBeginWriting >1)
	{

	CFile fis;
	
	EDITSTREAM es;
	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback; 
	// I open the file with tne modeWrite mode
	fis.Open(m_strFilename,  CFile::modeWrite);
	// I put the content in the file
	m_rtf.StreamOut(SF_RTF, es);
	m_rtf.SetModify(FALSE); 
	fis.Close(); 
	}
}//end if begin writing

else if ( m_bFisNou)
{ 
	if ( m_nFileNew == 1)
	{

	// define the dialog window
	CFileDialog fileDlg(FALSE, "rtf", NULL, OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT,
                       "rtf files(*.rtf)|*.rtf|");
	// display the dialog window
	if (fileDlg.DoModal () == IDCANCEL) 
	{
		m_nFileNew=0;
		m_rtf.SetModify(); 
		return;
	}

	// obtain the file name
	CString filename = fileDlg.GetPathName ();
	m_strFilename=filename;
	CFile fis;
	
	EDITSTREAM es;
	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback; 
	// I open the file with tne modeWrite and modeCreate mode
	fis.Open(filename, CFile::modeCreate | CFile::modeWrite);

	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback;
	// put the content in the file
	m_rtf.StreamOut(SF_RTF, es);
	fis.Close();
	m_rtf.SetModify(FALSE); 
	}// end m_nFileNew==1
	else if ( m_nFileNew > 1 )
	{

	CFile fis;
	
	EDITSTREAM es;
	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback; 
	// open the file with the modeWrite mode
	fis.Open(m_strFilename,  CFile::modeWrite);
	// put the content in the file
	m_rtf.StreamOut(SF_RTF, es);
	m_rtf.SetModify(FALSE); 
	fis.Close(); 
	}
}//end if file new
else if (m_bFisOpen)// file open
{
	// if I want to save the file that I have opened and I did not 
	// CREATED and I have changed the content, I don't want to appear 
	// the dialog box which asks me for the name to save the file, but
	// I want the file to be saved with the name the file has already

	CFile fis;
	
	EDITSTREAM es;
	es.dwCookie = (DWORD) &fis;
	es.pfnCallback = MyStreamOutCallback; 
	// open the file with the modeWrite mode
	fis.Open(m_strFilename,  CFile::modeWrite);
	// put the content in the file
	m_rtf.StreamOut(SF_RTF, es);
	m_rtf.SetModify(FALSE); 
	fis.Close(); 
}// end file open
  CString msg;	
  msg.Format("MyRtf - %s" , m_strFilename );
  SetWindowText ( msg ) ;

}

// function added with classwizard in 20 september 2001
void CRicheditPage::OnFilePrint() 
{
	Print(TRUE);
}
// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnBold() 
{
	m_rtf.SetSelectionBold();
}

// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnItalic() 
{
	m_rtf.SetSelectionItalic();	
}

// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnUnderline() 
{
	m_rtf.SetSelectionUnderline();	
}

// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnEditUndo() 
{
	// if possible undo the last operation
	if (m_rtf.CanUndo())   
		m_rtf.Undo();	
}

// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnEditCut() 
{
	// Delete the selected text and copy it to the clipboard.
	m_rtf.Cut();	
}

// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnEditCopy() 
{
	// Copy the text to the clipboard.   
    m_rtf.Copy();	
}

// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnEditPaste() 
{
	// Paste the clipboard data if possible.
	if (m_rtf.CanPaste())
		 // Replace the selected text with the text in the clipboard.
		 m_rtf.Paste();
}


// FUNCTION ADDED ON SATURDAY 22 SEPTEMBER 2001
void CRicheditPage::OnColour() 
{
	m_rtf.SetColour();	
}


// function added with classwizard on Friday 21 september 2001
void CRicheditPage::OnClose() 
{
	// Reset the modified state only if the text has been modified.
   if (m_rtf.GetModify()) 
	{ 
	   MessageBeep(0xFFFFFFFF);	
	   int nResp = MessageBox(" Do you want to save the changes made to your document?", "MyRtf",MB_ICONWARNING | MB_YESNOCANCEL);
		if ( nResp  == IDYES )
		{
			OnFileSave();
			m_rtf.SetModify(FALSE);
			CDialog::OnClose();
		}
		else if ( nResp == IDNO )
			CDialog::OnClose(); 
	    else if ( nResp == IDCANCEL )
		{/* do not close the application*/}
	}
   	else CDialog::OnClose(); 
}

// function added with classwizard on Saturday 21 september 2001
void CRicheditPage::OnParagraphLeft() 
{
	m_rtf.SetParagraphLeft();		
}

// function added with classwizard on Monday 24 september 2001
void CRicheditPage::OnParagraphCenter() 
{
	m_rtf.SetParagraphCenter();			
}

// function added with classwizard on Monday 24 september 2001
void CRicheditPage::OnParagraphRight() 
{
	m_rtf.SetParagraphRight();			
}

// function added with classwizard on Monday 24 september 2001
void CRicheditPage::OnParagraphBulleted() 
{
	m_rtf.SetParagraphBulleted();				
}

// function added with classwizard on Wednesday 26 september 2001
void CRicheditPage::OnFormatFont() 
{

	CFontDialog dlg( NULL , CF_BOTH | CF_EFFECTS );
	if ( dlg.DoModal() != IDOK )
		return;

	if ( dlg.IsUnderline() )
	{
		m_rtf.SetSelectionUnderline ();
	}
	
	CString faceName = dlg.GetFaceName();
	m_rtf.SetFontName( faceName ) ;
	
	COLORREF clr= dlg.GetColor ();
	m_rtf.SetColor(clr); 

	int nPointSize = dlg.GetSize();
	m_rtf.SetFontSize( nPointSize ) ;

}

// function added with classwizard on Tuesday 16 octomber 2001
// select all of the text
void CRicheditPage::OnEditSelectAll() 
{
	m_rtf.SetSel(0, -1);
}

// function added with classwizard on Tuesday 16 octomber 2001
// delete the current selection
void CRicheditPage::OnEditDelete() 
{
	m_rtf.Clear();
}


// function added with classwizard on Saturday 20 octomber 2001
// this code is taken from dlgcbr32
BOOL CRicheditPage::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{    
		ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW);

	// allow top level routing frame to handle the message
	if (GetRoutingFrame() != NULL)
		return FALSE;

	// need to handle both ANSI and UNICODE versions of the message
	TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
	TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
	TCHAR szFullText[256];
	CString strTipText;
	UINT nID = pNMHDR->idFrom;
	if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
		pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
	{
		// idFrom is actually the HWND of the tool
		nID = ((UINT)(WORD)::GetDlgCtrlID((HWND)nID));
	}

	if (nID != 0) // will be zero on a separator
	{
		AfxLoadString(nID, szFullText);
		// this is the command id, not the button index
		AfxExtractSubString(strTipText, szFullText, 1, '\n');
	}
#ifndef _UNICODE
	if (pNMHDR->code == TTN_NEEDTEXTA)
		lstrcpyn(pTTTA->szText, strTipText,
			(sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])));
	else
		_mbstowcsz(pTTTW->szText, strTipText,
			(sizeof(pTTTW->szText)/sizeof(pTTTW->szText[0])));
#else
	if (pNMHDR->code == TTN_NEEDTEXTA)
		_wcstombsz(pTTTA->szText, strTipText,
			(sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])));
	else
		lstrcpyn(pTTTW->szText, strTipText,
			(sizeof(pTTTW->szText)/sizeof(pTTTW->szText[0])));
#endif
	*pResult = 0;

	// bring the tooltip window above other popup windows
	::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0,
		SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE);

	return TRUE;    // message was handled
}



/////////////////////////////////////////////////////////////////////////////
// CRicheditPage::OnEnterIdle
//      OnEnterIdle updates the status bar when there's nothing better to do.
//      This code is based on CFrameWnd::OnEnterIdle.

void CRicheditPage::OnEnterIdle(UINT nWhy, CWnd* pWho)
{
	if (nWhy != MSGF_MENU || m_nIDTracking == m_nIDLastMessage)
		return;

	ASSERT(m_nIDTracking == m_nIDLastMessage);
}

void CRicheditPage::OnSize(UINT nType, int cx, int cy) 
{
	CDialog::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	// this code is taken from Ftptree MSDN sample

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美一区二区三区国产精品| 国产偷国产偷精品高清尤物| 青草国产精品久久久久久| 高清不卡一二三区| 日韩高清国产一区在线| 亚洲视频免费看| 久久免费视频一区| 成人激情免费网站| 国产曰批免费观看久久久| 亚洲一级电影视频| 日本一区二区免费在线| 日韩一区二区不卡| 欧美色图免费看| 国产一区视频在线看| 另类小说图片综合网| 亚洲欧美一区二区久久| 久久久不卡影院| 欧美一区二区黄| 欧美三级中文字| 色呦呦国产精品| 成人免费av网站| 国产精品色在线| 久久久亚洲综合| 久久综合九色综合欧美亚洲| 91.xcao| 欧美三级视频在线| 91福利视频在线| 日韩中文字幕不卡| 国产偷国产偷精品高清尤物| 久久亚洲精品国产精品紫薇| 欧美大片国产精品| 日韩欧美国产一二三区| 国产成人精品免费视频网站| 久久国产精品露脸对白| 日韩高清在线不卡| 三级精品在线观看| 国产日韩欧美制服另类| 日本一区免费视频| 中文字幕一区二区三区视频 | 色婷婷久久久久swag精品| 99视频有精品| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲欧洲一区二区三区| 麻豆久久久久久久| 欧美视频你懂的| 国产精品网站在线| 久久99久久久欧美国产| 欧美午夜理伦三级在线观看| 欧美激情中文不卡| 久久精品国产秦先生| 在线观看国产一区二区| 中文字幕av一区 二区| 美女在线一区二区| 欧日韩精品视频| 欧美videossexotv100| 久久精品人人做| 亚洲精品国产无天堂网2021| 亚洲国产精品麻豆| 亚洲欧美日韩在线播放| 亚洲综合免费观看高清完整版在线 | 久久久久亚洲综合| 中文字幕一区二区三区四区| 一区二区三区在线免费视频| 无吗不卡中文字幕| 激情综合五月天| 高潮精品一区videoshd| 日本乱码高清不卡字幕| 国产自产v一区二区三区c| 日本精品视频一区二区| 91黄色小视频| 日韩欧美精品在线视频| 欧美国产日本视频| 五月婷婷激情综合网| 国产乱人伦偷精品视频不卡| 亚洲综合色视频| yourporn久久国产精品| 日韩视频免费直播| 精品福利在线导航| 亚洲不卡一区二区三区| 亚洲激情图片qvod| 久久99精品国产麻豆婷婷 | 欧美一级片在线| 亚洲男人电影天堂| 精品一区二区三区免费播放| 91啦中文在线观看| 久久影院午夜片一区| 亚洲va欧美va天堂v国产综合| 一区二区三区中文字幕| 国产高清成人在线| 欧美xxxxx牲另类人与| 天天影视色香欲综合网老头| 亚洲h精品动漫在线观看| 国产精品一区二区在线看| 欧美一区二区三区男人的天堂| 中文字幕中文在线不卡住| 国产乱子轮精品视频| 欧美精品久久99久久在免费线| 成人免费在线视频| 看片的网站亚洲| 成人精品免费视频| 日本一区二区三区视频视频| 蜜臀va亚洲va欧美va天堂| 欧美日韩免费观看一区二区三区 | 7777精品伊人久久久大香线蕉完整版 | 国产精品毛片大码女人| 国产激情91久久精品导航 | 国产麻豆视频精品| 日韩精品资源二区在线| 奇米精品一区二区三区在线观看| 欧美亚洲国产一区二区三区va | 91麻豆.com| 亚洲人午夜精品天堂一二香蕉| 精品在线一区二区三区| 欧美高清www午色夜在线视频| 一区二区三区四区视频精品免费 | 色综合亚洲欧洲| 中文字幕一区二区三区av | 亚洲国产精品久久久久婷婷884| 亚洲一二三四区| 色综合久久久久久久久| 性欧美疯狂xxxxbbbb| 欧美电影免费观看高清完整版| 国产在线精品一区二区三区不卡 | 久久久五月婷婷| 欧美午夜一区二区| 国产999精品久久| 天涯成人国产亚洲精品一区av| 国产性色一区二区| 日韩一区二区麻豆国产| 日本伦理一区二区| 国产v综合v亚洲欧| 韩国精品久久久| 日本不卡一二三| 视频一区在线播放| 亚洲精品免费电影| 国产精品久久二区二区| 欧美成人乱码一区二区三区| 91高清视频在线| 国产福利91精品一区| 欧美肥胖老妇做爰| a4yy欧美一区二区三区| 亚洲一区二区中文在线| 亚洲美女淫视频| 欧美日韩国产一级二级| av在线不卡免费看| 国产大陆亚洲精品国产| 免费在线看成人av| 日韩欧美高清一区| 三级在线观看一区二区| 欧美亚洲愉拍一区二区| 激情图区综合网| 久久久国产午夜精品| 日韩精品综合一本久道在线视频| 欧美zozozo| 午夜久久久久久| 亚洲成人av一区二区| 91麻豆精品国产91久久久使用方法 | 亚洲国产成人av| 欧美国产日本韩| 久久久久久久精| 国产精品麻豆99久久久久久| 中文字幕一区三区| 亚洲视频一区二区免费在线观看| 亚洲欧洲国产日本综合| 一区二区三区成人在线视频| 亚洲精品视频在线观看网站| 一区二区高清视频在线观看| 亚洲123区在线观看| 免费看欧美女人艹b| 国产在线播放一区| 色综合久久中文综合久久牛| 欧美日韩一区国产| 欧美精品一区二区久久久| 欧美大黄免费观看| 国产精品无圣光一区二区| 亚洲精品高清在线观看| 秋霞av亚洲一区二区三| 极品销魂美女一区二区三区| 国产精品主播直播| 欧亚洲嫩模精品一区三区| 在线播放欧美女士性生活| 久久综合九色综合97_久久久| 国产精品传媒在线| 视频一区视频二区中文| 国产一区二区三区久久久| 99久久99久久精品免费看蜜桃| 91成人免费电影| 久久久综合九色合综国产精品| 亚洲欧洲成人av每日更新| 男人的天堂久久精品| 成人av在线电影| 日韩丝袜情趣美女图片| 亚洲欧美怡红院| 免费久久精品视频| 色一情一乱一乱一91av| 欧美变态凌虐bdsm| 亚洲一级片在线观看| 国产精品1区2区3区| 欧美精选午夜久久久乱码6080| 中文乱码免费一区二区|