On Thu, 2005-09-29 at 14:56, Marc Weustink wrote:
> Thats why you usually create a func/proc for it.
> IMO it can be perfecly added as local form method and no need to add it 
> in an inc.
I myself are not in favor of repeatedly occurring functions or
procedures in a project (or several projects), that extend functionality
of classes. I believe that the power of OOP is that you can inherit this
functionality from more basic classes. 

> But back to the basic question, what is the need: Why index by name ?
CheckBoxGroup's like RadioGroup's show their "components" based on a
number of items, that come from a resource (trough IDE) or from code. An
application that has internationalization typically will add the items
from code, namely add all resource strings of the items. So how can you
tell if a checkbox is set or not?? Well IMHO you can only do that by
checking the position of the items in the stringlist and then check the
checked property on that position.
Now, like you say, I could add a method to the form and extend the forms
functionality, but I believe that it has nothing to do with the form.
It's in fact extending the functionality of the groupbox. By definition
the resource strings used in the list are know to the code, so searching
by name is improving readability and making the code more robust.

EditorOptionsGroupBox.CheckedByName[dlgUseSyntaxHighlight]

will always be more clear than 

EditorOptionsGroupBox.CheckedByName[13]

and inserting an item in the groupbox will not require to renumber all
other checkboxes.

I could be wrong, but that's just the way I see it...

Darius



_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to