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

Scientific charting control

Rate me:
Please Sign up or sign in to vote.
4.84/5 (122 votes)
17 Jan 20055 min read 1.3M   42.6K   405  
Multi-purpose scientific charting control.
// XGraphObjectBase.cpp: Implementierung der Klasse CXGraphObjectBase.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "XGraph.h"
#include "XGraphObjectBase.h"

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

//////////////////////////////////////////////////////////////////////
// Konstruktion/Destruktion
//////////////////////////////////////////////////////////////////////

IMPLEMENT_SERIAL( CXGraphObject, CObject, 1 )

CXGraphObject::CXGraphObject()
{
	m_bSelected	 = false;
	m_bCanResize = false;
	m_bCanMove	 = false;
	m_bSizing	 = false;
	m_bEditing	 = false;
	m_bVisible   = true;
	m_bCanEdit   = true;
	m_pGraph	 = NULL;
	m_clRect.SetRectEmpty ();
}

CXGraphObject::CXGraphObject(const CXGraphObject& copy)
{
	*this = copy;
}

CXGraphObject& CXGraphObject::operator=(const CXGraphObject& copy)
{
	m_clRect     = copy.m_clRect;
	m_bSelected  = copy.m_bSelected;
	m_bCanResize = copy.m_bCanResize;
	m_bCanMove	 = copy.m_bCanMove;
	m_bSizing	 = copy.m_bSizing;
	m_bEditing	 = copy.m_bEditing;
	m_crColor	 = copy.m_crColor;
	m_pGraph	 = copy.m_pGraph;
	m_Tracker	 = copy.m_Tracker;
	m_bVisible   = copy.m_bVisible;
	m_bCanEdit   = copy.m_bCanEdit;
	
	return *this;
}

CXGraphObject::~CXGraphObject()
{
}

void CXGraphObject::BeginSize()
{
	m_bSizing = true;
	m_Tracker.m_nStyle = CRectTracker::hatchedBorder | CRectTracker::resizeOutside;
	m_Tracker.m_rect   = m_clRect;
}

void CXGraphObject::EndSize()
{
	m_bSizing = false;
};


void CXGraphObject::Serialize( CArchive& archive )
{
	CObject::Serialize (archive);

    if( archive.IsStoring() )
    {
		archive << m_bSelected;
		archive << m_bCanResize;
		archive << m_bCanMove;
		archive << m_bSizing;
		archive << m_bEditing;
		archive << m_bVisible;
		archive << m_bCanEdit;
		archive << m_clRect;
		archive << m_crColor;
    }
	else
    {
		archive >> m_bSelected;
		archive >> m_bCanResize;
		archive >> m_bCanMove;
		archive >> m_bSizing;
		archive >> m_bEditing;
		archive >> m_bVisible;
		archive >> m_bCanEdit;
		archive >> m_clRect;
		archive >> m_crColor;
    }
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions