Re: Programming Delphi all in text


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by webmaster Guido on May 15, 2003 at 16:56:35:

In Reply to: Programming Delphi all in text posted by julianbury on May 15, 2003 at 14:00:20:

: I would like to program Delphi 3 all in text.
: Can this be done?

----------------
I don't know if I understand "all in text". Do you mean that the creation of the text-boxes has to be done fully in code, instead of using the visual development? That's possible.
----------------

: The reason for this is the repetative nature of the layout of the intended form and the manner in which its gadgets must be accessed.
: the layout instructions would look something like:-

: for y=0 to 15
: txtbox(0,y) := CreateTextBox( 0,y*24,100,22);
: txtbox(1,y) := CreateTextBox(102,y*24,200,22);
: txtbox(2,y) := CreateTextBox(304,y*24,500,22);
: next

: I also need to shift the focus from textbox to textbox using the TAB and up/down Cursor Keys.
: I need to use an array of textbox IDs.
: There are to be 16 rows of 3 text gadgets each.
: There will be an array of 3 columns x 256 rows of text data to be displayed and edited, 16 rows being visible in the textboxes. The text will be single-line only.
: When the cursor is on the bottom row, the offset will increment with each further Cursor-Down event and all the textboxes must be refreshed from the data array.
: Before this occurs, the edited data must be copied into the array.
: It is not practical to write to 48 gadgets, addressing them individually as:
: Edit1, Edit2, Edit3,
: Edit4, Edit5, Edit6,
: etc.
: I need to access them as something like:
: Data(x,y+offset)=txtbox(x,y)
: and fill them with data in some equivilent of
: txtbox(x,y)=Data(x,y+offset)

: Have I picked the wrong language?

---------------

What you describe here, is Delphi's StringGrid component. It does all these things, except automatically storing the contents of its cells in an array. But you can easily program that part.

If your Delphi version has support for databases, you can use a Table component that is connected to a DBGrid. In this case, all data are automatically retrieved from and stored to a database (for Delphi 3: a dBase file or Paradox file; for later versions of Delphi: also many other formats, depending of the version).

Regards,
webmaster Guido


Related Articles and Replies:


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]