Re: CEdit white
Hi GT,
David is write, they are still objects even though you don't have to do
anything with them. However, I think you will want to change the IDs away
from IDC_STATIC (basically -1) and make them something else so you could
eventually change them the same way you do your edit controls.
I mostly just leave the labels as statics (without their own ID's) when I
don't have to enable or disable or change the text or attributes of the
control. That isn't very often these days.
Don't worry about Ajay, he can dish it out, but he can also take it :o)
Tom
"GT" <ContactGT_remove_@hotmail.com> wrote in message
news:4610d64d$0$24409$c3e8da3@news.astraweb.com...
Actually I'm not yet convinced that we have as many objects as it appears.
My dialog has 9 CEdit boxes that are definitely objects (3x3 grid). I also
have 6 'labels' (3 top, 3 left labels). These labels are added to the
dialog through the toolbox, so exist as a line of code in the project
resource file. They are just static labels and I define no control
variables for them. As they are not instantiated in my code, I have no
type (class) for them, so from my code's point of view they are simply a
part of the resource that forms the dialog, the drawing of which is
handled be the drawing/rendering operations on the CDialog class. Should I
choose to instantiate an object for one of these controls, it would be a
CStatic (or derivative), but I don't do this, so my dialog consists of a
CDialog (derivative) instance and 6 CEdit instances - 7 objects in total.
My knowledge of the inner workings of the MFC fails me here as I don't
know how these label 'things' are actually rendered on the screen. Are
they drawn as part of the CDialog's Paint method, or does the MFC
instantiate CStatic objects for me and tell them to draw themselves. The
first option here means that from an OO point of view, they are not
objects, but attributes of the CDialog. The second option here means that
they are transient objects and have attributes and operations of their
own. I suspect the latter, but when modelling an instance diagram for this
dialog, I would be modelling 7 objects.
I have commented on Ajay's reply in another message. Perhaps a little
harshly, but he started to tell us what makes good OOP, then said he
doesn't understand basic OOP - a bit odd! I suspect he is using the term
OOP, when he actually means MFC coding practice.