12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6<br />

202 Day 6<br />

components at one time. For example, to change the width of several<br />

components at one time, you can select all the buttons and then modify<br />

the Width property <strong>in</strong> the Object Inspector. When you press Enter or<br />

move to another property, all the components you selected will have<br />

their Width property modified.<br />

Figure 6.<strong>14</strong> shows the Object Inspector when a Memo component is selected.<br />

Figure 6.<strong>14</strong>.<br />

The Object Inspector<br />

show<strong>in</strong>g Memo<br />

component properties.<br />

NOTE<br />

On Day 5, “<strong>C++</strong> Class Frameworks and the Visual Component Model,” I talked about<br />

properties. I discussed how properties can be <strong>in</strong>teger values, enumerations, sets, other objects,<br />

str<strong>in</strong>gs, and other types. The Object Inspector deals with each type of property accord<strong>in</strong>g to<br />

the data type of the property. <strong>C++</strong>Builder has several built-<strong>in</strong> property editors to handle data<br />

<strong>in</strong>put for the property. For example, the Top property accepts an <strong>in</strong>teger value. Because an<br />

<strong>in</strong>t is a basic data type, no special handl<strong>in</strong>g is required, so the property editor is fairly basic.<br />

The property editor for this type of property allows you to type a value (such as Top, Left,<br />

Width, and Height) directly <strong>in</strong> the Value column for <strong>in</strong>teger properties.<br />

In most cases, the property editor does parameter check<strong>in</strong>g for any<br />

properties <strong>in</strong> which you can enter an <strong>in</strong>teger value. The Width property,<br />

for <strong>in</strong>stance, cannot be a negative number. If you attempt to enter a<br />

negative number for the width of a control, <strong>C++</strong>Builder will force the<br />

width to the m<strong>in</strong>imum allowed for that control (usually 0). If you enter<br />

a str<strong>in</strong>g value for a property that expects an <strong>in</strong>teger value, <strong>C++</strong>Builder<br />

will display an error message. It is the job of the property editor to do<br />

parameter check<strong>in</strong>g.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!