Click here to Skip to main content
15,891,033 members
Articles / Desktop Programming / MFC

An Interactive Periodic Table of the Elements

Rate me:
Please Sign up or sign in to vote.
4.81/5 (22 votes)
4 Oct 20032 min read 120.7K   2.5K   34  
An article using GDI to create a scalable periodic table of the elements
#ifndef CLASSX_H_INCLUDED
#define CLASSX_H_INCLUDED 

class pteElement
{
	public:
		        pteElement::pteElement();
				~pteElement();
		void    pteElement::SetAtomicNumber(CString);
		void    pteElement::SetAtomicWeight(CString);
		void    pteElement::SetGroupNumber(CString);
		void    pteElement::SetGroupName(CString);
		void    pteElement::SetPeriod(CString);
		void    pteElement::SetBlock(CString);
		void    pteElement::SetCASRegistryID(CString);
		void    pteElement::SetElementName(CString);
		void    pteElement::SetElementSymbol(CString);
		void    pteElement::SetDiscoveryDate(CString);
		void    pteElement::SetDiscovererName(CString);
		void    pteElement::SetRow(CString);
		void    pteElement::SetColumn(CString);

		CString pteElement::GetAtomicNumber();
		CString pteElement::GetAtomicWeight();
		CString pteElement::GetGroupNumber();
		CString pteElement::GetGroupName();
		CString pteElement::GetPeriod();
		CString pteElement::GetBlock();
		CString pteElement::GetCASRegistryID();
		CString pteElement::GetElementName();
		CString pteElement::GetElementSymbol();
		CString pteElement::GetDiscoveryDate();
		CString pteElement::GetDiscovererName();
		int     pteElement::GetRow();
		int     pteElement::GetColumn();
		void    pteElement::BuildRect(int);
		BOOL    pteElement::CheckHit(CPoint);
		CRect*  pteElement::GetRect();
		
	protected:
		CString  AtomicNumber;
		CString  AtomicWeight;
		CString  GroupNumber;
		CString  GroupName;
		CString  Period;
		CString  Block;
		CString  CASRegistryID;
		CString  ElementName;
		CString  ElementSymbol;
		CString  DiscoveryDate;
		CString  DiscovererName;
		int      Row;
		int      Column;
		CRect    ElementArea;
		COLORREF CellColor;
};

#endif 

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.


Written By
Web Developer
United States United States
I'm an ENTP personality type, Ex Army Ranger, former software design engineer for Hewlett-Packard's TV network and now self employed.

Best job: Golf caddy in high school
Worst job: Tele-marketer

Countries Lived in, or visited: USA, Mexico, South Korea, Canada, Japan, North Korea (for 10 seconds), Spain, Germany, Bahrain, Iraq, Saudi Arabia & Panama

Hobbies: Classical Guitar, Video Games, Golf, Pool, Beer, 1/48 scale WWII airplane models, Reading & B-Movies

Comments and Discussions