Click here to Skip to main content
15,884,010 members
Articles / Desktop Programming / MFC

Porcupine

Rate me:
Please Sign up or sign in to vote.
4.78/5 (25 votes)
15 Sep 2009CPOL4 min read 570.3K   15.4K   118  
A library for visible and invisible image watermarking
// text.cpp : implementation file
//

#include "stdafx.h"
#include "eikona.h"
#include "text.h"

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

/////////////////////////////////////////////////////////////////////////////
// text dialog


text::text(CWnd* pParent /*=NULL*/)
	: CDialog(text::IDD, pParent)
{
	//{{AFX_DATA_INIT(text)
	m_text = _T("");
	m_red = 255;
	m_green = 255;
	m_blue = 255;
	//}}AFX_DATA_INIT
}


void text::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(text)
	DDX_Text(pDX, IDC_EDIT1, m_text);
	DDX_Text(pDX, IDC_EDIT2, m_red);
	DDX_Text(pDX, IDC_EDIT3, m_green);
	DDX_Text(pDX, IDC_EDIT4, m_blue);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(text, CDialog)
	//{{AFX_MSG_MAP(text)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
	ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
	ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
	ON_BN_CLICKED(IDC_BUTTON1, Oncolortable)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// text message handlers

BOOL text::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_red=255;
	m_green=255;
	m_blue=255;
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void text::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	position=1;
}

void text::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	position=2;
}

void text::OnRadio3() 
{
	// TODO: Add your control notification handler code here
	position=3;	
}

void text::OnRadio4() 
{
	// TODO: Add your control notification handler code here
	position=4;
}

void text::OnRadio5() 
{
	// TODO: Add your control notification handler code here
	position=5;
}

void text::Oncolortable() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	CColorDialog table;
	if (table.DoModal()==IDOK)
	{
	COLORREF color;
	color=table.GetColor();
	m_blue=GetBValue(color);
	m_green=GetGValue(color);
	m_red=GetRValue(color);
	UpdateData(FALSE);
	}
}

void text::OnButton2() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	m_text=m_text+"�";
	UpdateData(FALSE);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Greece Greece
Physicist/SW Engineer

Comments and Discussions