亚洲欧美第一页_禁久久精品乱码_粉嫩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| av不卡在线播放| 欧美日韩一区二区不卡| 欧美精品久久一区| 国产亚洲1区2区3区| 最新国产成人在线观看| 亚洲美女少妇撒尿| 依依成人综合视频| 午夜日韩在线观看| 蜜臀av一区二区在线观看| 国产精品一区在线观看你懂的| 成人高清av在线| 欧美高清hd18日本| 欧美高清在线视频| ...xxx性欧美| 亚洲精品成人在线| 三级在线观看一区二区| 国产精品小仙女| 欧美又粗又大又爽| 国产免费久久精品| 天天亚洲美女在线视频| 成人精品视频.| 日韩精品中文字幕在线一区| 综合在线观看色| 琪琪久久久久日韩精品| 国产精品一区二区久久精品爱涩| 一本到不卡免费一区二区| 日韩欧美一区在线观看| 亚洲精品成人天堂一二三| 国产精品综合一区二区| 欧美综合天天夜夜久久| 亚洲国产成人一区二区三区| 狠狠色综合色综合网络| 欧美午夜精品一区二区三区| 国产精品美女视频| 激情成人综合网| 日韩片之四级片| 一区二区不卡在线播放| 久久国产人妖系列| 宅男在线国产精品| 首页国产欧美日韩丝袜| 91麻豆免费看| 国产精品国产三级国产a| 日韩不卡手机在线v区| 欧美三级日韩三级国产三级| 中文字幕乱码亚洲精品一区| 免费人成在线不卡| 欧美日韩性生活| 亚洲蜜臀av乱码久久精品| 国产精品77777| 精品国产成人在线影院 | 精品视频色一区| 国产精品美女视频| 成人免费av资源| 亚洲国产精品成人综合| 懂色av中文字幕一区二区三区 | 国产露脸91国语对白| 91精品国产欧美一区二区18| 午夜精品久久久久久久99樱桃| 色爱区综合激月婷婷| 亚洲蜜臀av乱码久久精品| eeuss鲁片一区二区三区| 国产精品国产a| voyeur盗摄精品| 亚洲欧洲美洲综合色网| 99re8在线精品视频免费播放| 中文字幕制服丝袜成人av| www.欧美日韩国产在线| 亚洲人快播电影网| 欧美在线免费观看视频| 亚洲3atv精品一区二区三区| 欧美精品日韩一区| 久久精品999| 精品免费日韩av| 成人的网站免费观看| 一区二区三区四区五区视频在线观看| 不卡欧美aaaaa| 亚洲激情六月丁香| 欧美精品99久久久**| 美女视频一区在线观看| 久久精品亚洲精品国产欧美kt∨| 成人午夜看片网址| 亚洲国产成人tv| 欧美精品一区男女天堂| av在线不卡电影| 午夜精品视频在线观看| 欧美巨大另类极品videosbest| 亚洲成人福利片| 欧美精品一区二区三区在线| 精品亚洲成a人| 中文字幕在线观看一区二区| 成人av午夜电影| 日本不卡不码高清免费观看| 欧美一区二区三区四区高清| 国产精品一区一区| 亚洲国产精品久久久男人的天堂| 777久久久精品| 国产成人午夜视频| 日本大胆欧美人术艺术动态 | 91精品国产黑色紧身裤美女| 国产精品综合二区| 亚洲不卡一区二区三区| 久久精品在这里| 日韩一级黄色大片| 一本一道综合狠狠老| 国产高清在线精品| 日本中文字幕不卡| 一区二区三区影院| 国产精品护士白丝一区av| 日韩午夜三级在线| 欧美午夜精品一区二区三区| 成人手机电影网| 麻豆国产欧美日韩综合精品二区| 日韩一区日韩二区| 久久久久亚洲蜜桃| 日韩三级视频中文字幕| 欧美性大战久久久久久久蜜臀| 成人影视亚洲图片在线| 久久 天天综合| 美日韩一区二区三区| 国产精品初高中害羞小美女文| 91精品啪在线观看国产60岁| 国产成人av电影在线观看| 一区二区三区在线看| 精品久久久久久最新网址| 91麻豆成人久久精品二区三区| 国产综合久久久久久鬼色| 日本伊人色综合网| 亚洲国产欧美在线人成| 一区二区三区在线播| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 日韩一区二区三区在线视频| 色哟哟一区二区| 在线观看日韩国产| 欧美在线观看18| 99久久久国产精品| 97se亚洲国产综合自在线观| 成人免费av在线| 成人动漫一区二区| 91婷婷韩国欧美一区二区| 99久久久精品免费观看国产蜜| youjizz久久| 97久久精品人人做人人爽 | 欧美午夜精品一区二区三区 | 激情图区综合网| 国产成人综合网站| 成人午夜在线播放| 91一区在线观看| 色噜噜狠狠色综合欧洲selulu| 色妞www精品视频| 欧美日韩视频在线观看一区二区三区| 欧美大胆人体bbbb| 精品1区2区在线观看| 国产天堂亚洲国产碰碰| 中文字幕电影一区| 亚洲曰韩产成在线| 日韩 欧美一区二区三区| 奇米一区二区三区| 国产电影一区在线| 91免费观看在线| 欧美日韩精品综合在线| 欧美一区二区在线观看| 国产调教视频一区| 亚洲永久免费视频| 麻豆精品国产传媒mv男同| 国产精品 日产精品 欧美精品| 成人丝袜高跟foot| 欧美精品日韩一本| 国产欧美日韩不卡免费| 中文字幕亚洲在| 亚洲成a人v欧美综合天堂下载| 免费欧美日韩国产三级电影| 国内精品写真在线观看| 色视频一区二区| 欧美一区二区黄| 国产精品美女一区二区三区 | 91高清视频在线| 欧美日韩中文字幕一区| 日韩欧美国产高清| 一区二区三区美女| 国产成人av影院| 91精品国产综合久久久久久久| wwww国产精品欧美| 亚洲成人777| 成人av第一页| 欧美一区二区三区免费在线看| 国产精品欧美一区二区三区| 午夜在线成人av| 成人动漫视频在线| 日韩精品在线网站| 一区二区三区四区精品在线视频| 国产毛片精品视频| 欧美日韩不卡在线| 自拍偷拍国产精品| 国产凹凸在线观看一区二区| 制服丝袜国产精品| 亚洲图片欧美一区| 国产伦理精品不卡|