Hi Guys/Gals...
I've been programming procedural languages (including Pascal) for over 22 years. I'm attempting to teach myself Delphi 7 (with Borland's free 30-day demo) as an introduction to OOP techniques and I've run into a problem.
I'm trying to write a program which shows all the drives on my system as buttons on a horizontal bar. Each button will display the drive letter, a gauge (showing percentage utilisation) and a text field displaying the actual space remaining - eg. "2.3Gb".. Pressing a button will open an explorer view of that drive (if I ever get that far)...
I've created a form containing a single frame into which I've placed my two text fields and gauge and successfully produced code in the CreateForm method to populate an array of records corresponding to the available hard-drives with fields for DriveLetter, TotalCapacity, UnusedSpace etc.
The Problem is that I now want to replicate my "button" for each entry of my DiskParameters array and I can't figure out how to do this. I've studied Borland's documentation, messed around with constructor etc. but to no avail. If the Form is an object, containing the frame (an object) which itself contains my labels and gauge, surely I can create another frame object (with labels & gauge) for each array element "inheriting" the attributes of the existing one, reposition it and save a pointer to the new object in the array..
Any help would be gratefully appreciated..
Thanx
Gordon
I've been programming procedural languages (including Pascal) for over 22 years. I'm attempting to teach myself Delphi 7 (with Borland's free 30-day demo) as an introduction to OOP techniques and I've run into a problem.
I'm trying to write a program which shows all the drives on my system as buttons on a horizontal bar. Each button will display the drive letter, a gauge (showing percentage utilisation) and a text field displaying the actual space remaining - eg. "2.3Gb".. Pressing a button will open an explorer view of that drive (if I ever get that far)...
I've created a form containing a single frame into which I've placed my two text fields and gauge and successfully produced code in the CreateForm method to populate an array of records corresponding to the available hard-drives with fields for DriveLetter, TotalCapacity, UnusedSpace etc.
The Problem is that I now want to replicate my "button" for each entry of my DiskParameters array and I can't figure out how to do this. I've studied Borland's documentation, messed around with constructor etc. but to no avail. If the Form is an object, containing the frame (an object) which itself contains my labels and gauge, surely I can create another frame object (with labels & gauge) for each array element "inheriting" the attributes of the existing one, reposition it and save a pointer to the new object in the array..
Any help would be gratefully appreciated..
Thanx
Gordon