Robert Meek wrote:
For example, although one can set the columns up so that the user
can alter their individual widths at runtime, I have not been able to find a
way of storing this info back into an ini-file so that these settings can be
retained and used again in future sessions.  Is this possible?  If so how,
because the StrGrid.Col[0] doesn't have a width property...only a default
width that sets all of them the same including the fixed column!

The grid has a ColWidths array property. It also has a RowHeights array property.


Also, I was under the impression I could store a stringgrid with any
string info it's cells contain, including that in it's fixed columns, to a
text file and then load the stringgrid back up with that same info directly
from the file.  It seems the individual column text can be saved that way
but not all in one file.  How is this handled?

Each row and each column is represented by a TStrings object. TStrings.LoadFromFile loads the entire file. So you obviously can't store more than one column or row in a file if you're going to use TStrings.LoadFromFile. You're free to use some other way of saving multiple rows and columns to a file.


Finally, Because this particular grid will be used by a restaurant
manager to set her waitress's working hours, I need to be able to print a
copy of the grid out in landscape format after she has made all the entries
for a particular week.  I don't want a print screen because that would show
the entire form...just the grid itself.  How can this best be accomplished?

With some definitions for functions x() and y():

for i := 0 to Pred(ColCount) do
  for j := 0 to Pred(RowCount) do
    Printer.Canvas.TextOut(x(i), y(j), Cells[i, j]);

Format to taste. You might get some hints from looking at the implementation of TCustomGrid.Paint.

--
Rob

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to