⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imessagespage.cpp

📁 c++系统开发实例精粹内附的80例源代码 环境:windows2000,c++6.0
💻 CPP
字号:
//////////////////////////////////////////////////////////////////////
// FileFury
// Copyright (c) 2000 Tenebril Incorporated
// All rights reserved.
//
// This source code is governed by the Tenebril open source
// license (http://www.tenebril.com/developers/opensource/license.html)
//
// For more information on this and other open source applications,
// visit the Tenebril OpenSource page:
//       http://www.tenebril.com/developers/opensource
//
//////////////////////////////////////////////////////////////////////

// IMessagesPage.cpp : implementation file
//

#include "stdafx.h"
#include "Oscar.h"
#include "IMessagesPage.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CIMessagesPage property page

IMPLEMENT_DYNCREATE(CIMessagesPage, CPropertyPage)

CIMessagesPage::CIMessagesPage() : CPropertyPage(CIMessagesPage::IDD)
{
	//{{AFX_DATA_INIT(CIMessagesPage)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_bHasInit = FALSE;
	m_pArchive = NULL;
}

CIMessagesPage::~CIMessagesPage()
{
}

void CIMessagesPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CIMessagesPage)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CIMessagesPage, CPropertyPage)
	//{{AFX_MSG_MAP(CIMessagesPage)
	ON_BN_CLICKED(IDC_SETTEXTCOLOR, OnSettextcolor)
	ON_BN_CLICKED(IDC_SETBUBBLECOLOR, OnSetbubblecolor)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIMessagesPage message handlers

void CIMessagesPage::OnSettextcolor() 
{
	CColorDialog ColorDialog(m_crText, CC_ANYCOLOR | CC_FULLOPEN, this);

	// Display the color choice dialog box.
	if(ColorDialog.DoModal() == IDOK)
	{
		// OK.  Save the new color, and update the color box.
		m_crText = ColorDialog.GetColor();
		m_cTextColorBox.SetColor(m_crText);
	}

	return;
}

void CIMessagesPage::OnSetbubblecolor() 
{
	CColorDialog ColorDialog(m_crBubble, CC_ANYCOLOR | CC_FULLOPEN, this);

	// Display the color choice dialog box.
	if(ColorDialog.DoModal() == IDOK)
	{
		// OK.  Save the new color, and update the color box.
		m_crBubble = ColorDialog.GetColor();
		m_cBubbleColorBox.SetColor(m_crBubble);
	}

	return;
}

BOOL CIMessagesPage::OnSetActive() 
{
	if(!m_bHasInit && m_pArchive)
	{
		m_bHasInit = TRUE;

		// Setup the checkbox.
		if(m_pArchive->m_arch2.bPopIMWindow)
			CheckDlgButton(IDC_SHOWONRECV, 1);
		else
			CheckDlgButton(IDC_SHOWONRECV, 0);

		// Setup the color boxes.
		CStatic *Guider;
		CRect GuiderRect;

		Guider = (CStatic *)GetDlgItem(IDC_TEXTCOLORGUIDER);
		Guider->GetWindowRect(&GuiderRect);
		ScreenToClient(&GuiderRect);

		m_cTextColorBox.Create(WS_VISIBLE | WS_CHILD | WS_BORDER | WS_DISABLED,
			GuiderRect, this, IDC_TEXTCOLORBOX);

		m_cTextColorBox.SetColor(m_pArchive->m_arch2.crMyText);

		Guider = (CStatic *)GetDlgItem(IDC_BUBBLECOLORGUIDER);
		Guider->GetWindowRect(&GuiderRect);
		ScreenToClient(&GuiderRect);

		m_cBubbleColorBox.Create(WS_VISIBLE | WS_CHILD | WS_BORDER | WS_DISABLED,
			GuiderRect, this, IDC_BUBBLECOLORBOX);

		m_cBubbleColorBox.SetColor(m_pArchive->m_arch2.crMyBubble);

		// Set up buffers.
		m_crText = m_pArchive->m_arch2.crMyText;
		m_crBubble = m_pArchive->m_arch2.crMyBubble;
	}
	
	return CPropertyPage::OnSetActive();
}

void CIMessagesPage::SetArchive(CSettingsArchive *pArchive)
{
	m_pArchive = pArchive;
}

void CIMessagesPage::SaveSettings()
{
	if(m_bHasInit && m_pArchive)
	{
		m_pArchive->m_arch1.bShowMainOnStart = IsDlgButtonChecked(IDC_SHOWONSTART);
		m_pArchive->m_arch2.crMyText = m_crText;
		m_pArchive->m_arch2.crMyBubble = m_crBubble;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -