Click here to Skip to main content
15,921,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I got lines written over by other text in a CEdit control Pin
JWood22-Sep-03 12:32
JWood22-Sep-03 12:32 
GeneralRe: I got lines written over by other text in a CEdit control Pin
ASchunk22-Sep-03 12:56
ASchunk22-Sep-03 12:56 
GeneralProgrammers week! Pin
Anonymous22-Sep-03 8:39
Anonymous22-Sep-03 8:39 
GeneralRe: Programmers week! Pin
ASchunk22-Sep-03 9:27
ASchunk22-Sep-03 9:27 
GeneralMaking an interactive periodic table of the elements using VC++ Pin
b_girl22-Sep-03 8:38
b_girl22-Sep-03 8:38 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 9:32
Terry O'Nolley22-Sep-03 9:32 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl22-Sep-03 9:41
b_girl22-Sep-03 9:41 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 12:58
Terry O'Nolley22-Sep-03 12:58 
You should create a PeriodicTable class first and one of its data members would be an array of Element objects. I would attack it by creating an Element class and making sure it had a data member for its row and column in the periodic table.
You would also need a data member for what type of element it was so you could use that type to determine the background color for that element and the font colors.

To draw each cell, you could take the width in pixels of the current window and divide 18 (number of columns). That would act as the height and width of each element's cell. Call this variable
cellwidth.

To determine where to draw each cell, you could take its column, multiply by cellwidth and that number would be the left extent of it's rectangle. Multiplying its row by cellwidth would give you the top boundry of its rectangle. The right and bottom of the rectangle could be determined by adding cellwidth to the left and top values. This will enable you to handle the window resize message and adjust the values in the PeriodicTable class so that your entire table will automatically resize when the window resizes.

Most of that functionality should be stuck in the PeriodicTable class's DrawTable method.

Draw table would call each Element in the arrays DrawElement method.

You do not need to use controls in the resource editor to do any of this. Just use GDI calls to draw the rectangles in the Element::DrawElement() method.








GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Joaquín M López Muñoz22-Sep-03 10:33
Joaquín M López Muñoz22-Sep-03 10:33 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
act_x22-Sep-03 11:02
act_x22-Sep-03 11:02 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson22-Sep-03 11:05
Jason Henderson22-Sep-03 11:05 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 13:29
Terry O'Nolley22-Sep-03 13:29 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson22-Sep-03 16:18
Jason Henderson22-Sep-03 16:18 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 16:41
Terry O'Nolley22-Sep-03 16:41 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson22-Sep-03 17:01
Jason Henderson22-Sep-03 17:01 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Terry O'Nolley22-Sep-03 17:14
Terry O'Nolley22-Sep-03 17:14 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl23-Sep-03 3:09
b_girl23-Sep-03 3:09 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson25-Sep-03 9:04
Jason Henderson25-Sep-03 9:04 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl25-Sep-03 9:24
b_girl25-Sep-03 9:24 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson25-Sep-03 9:48
Jason Henderson25-Sep-03 9:48 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
b_girl25-Sep-03 9:53
b_girl25-Sep-03 9:53 
GeneralRe: Making an interactive periodic table of the elements using VC++ Pin
Jason Henderson25-Sep-03 10:48
Jason Henderson25-Sep-03 10:48 
Questionwhat is the ? thingy called? Pin
keegan22-Sep-03 8:27
keegan22-Sep-03 8:27 
AnswerRe: what is the ? thingy called? Pin
ZoogieZork22-Sep-03 8:32
ZoogieZork22-Sep-03 8:32 
AnswerRe: what is the ? thingy called? Pin
Michael Dunn22-Sep-03 9:04
sitebuilderMichael Dunn22-Sep-03 9:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.