About Bugs History |
About
It now allows to set a alignment for each cell, single columns and/or row
(separate for the normal and the fixed ones); and the same for the background
color and the font. Additional to that it offers to set the hint not only
globally for the grid but for each cell alone, e.g. to explain acronyms.
Download TStringAlignGrid (Zipped archive, 100kB)
Bugs of V2.1
This was the first component I wrote, and it's somehow still my favourite one.
Originally it was a descendant of TStringGrid with the possibility to change
the alignment of the text to left (same as StringGrid) or right aligned or
centered, but with newer versions many more features appeared but the name
stayed (as there is already a TSuperGrid I've to stick to the name...)
Bugs of V2.0
You just need to do the patches below, and additionally download the file
ah_def.inc and exchange the one in the archive.
Of course the next version will include the new version.
The main reason for creating the 2.1 version was to make it compatible with
Delphi 6, however for a strange reason the file ah_tool.pas which
made it into the archive wasn't the one I changed for D6, but the old version. However
it's easy to correct as it's just the use of the typed constants which creates the
problems. Just add the compiler directive (*$ j+*) in the header of this file
and it will work compile.
Shame on me - I forgot to check if it compiles in Delphi 1 and of course
it doesn't. And it's too many places to change for a patch, however you can use
the Version 2.0, which has the same functionality.
In the event OnKeyPress the Cells[] property of the current cell returns the value the
cell had before the editing, not the current contents of the inplace edit.
This is caused by some code I did plan to use for a future feature, which has
no function yet, so it can be removed easily by
exchanging the WMCommand message handler by the following empty one (or
remove it completely from interface and implementation):
procedure TStringAlignGrid.WMCommand(var Message: TWMCommand);
begin
inherited;
end;
Occasionally the cell hints don't show even though everything is set correctly.
This can be fixed by providing a OnShowHintCell event which sets CanShow to true,
or by adding the initialization of the CanShow I forgot:
procedure TStringAlignGrid.CMHintShow(var Message: THintMessage);
var
canshow: boolean;
begin
canshow:=true;
ShowHintCell(message.HintInfo^.HintStr, canshow, message.HintInfo^);
[...]
end;
Editing fonts in the component editor can occasionally lead to an invalid
property value error message due to an wrong integer value written in the DFM file.
This can be fixed by changing cardinal to integer in
the WriteFont procedure.
procedure WriteFont(Writer: TWriter; v:TFont);
var
t: TFontStyles;
begin
[...]
Writer.WriteInteger(integer(pointer(@t)^));
end;
You can always import the component by including the file aligridr.pas
in any package you like, if you want to use the ah_comp.dpk there's
just one line to delete:
{$R 'Aligrid.d32'}
Editing with EditMask does not work
The OnKeyPress event is not working the same way as it is in the
TStringgrid, when in editing mode the OnKeyPress event is not called
anymore. Another problem which is funnily caused by the same bug is that
cells with a EditMask set by the OnGetEditMask event only allow editing of
the first character. By changing the method TNewInplaceEdit.KeyPress to the
following both problems should disappear.
procedure TNewInplaceEdit.KeyPress(var Key: Char);
begin
if (col=-1) or (row=-1) then key:=#0;
if (key=#13) then begin
if not f_multiline then
postmessage(TStringAlignGrid(self.owner).handle,cn_edit_return,col,row)
else if f_multiline then
if not TStringAlignGrid(self.owner).CanEditModify then
Key := #0;
end;
if (key=#27) and not f_multiline then begin
self.text:=oldtext;
postmessage(TStringAlignGrid(self.owner).handle,cn_edit_cancel,col,row);
key:=#13;
end;
if key=#9 then key:=#0;
inherited KeyPress(key);
end;
As I don't speak C++ much I don't have the Builder, so I can only rely on the
feedback of users about it. It seems like the problem is that the spinedit
control (which I used for the component editor) has a different name in the
builder. The next version of the component editor will be without the spinedit
again, however for the existing version I have no idea how to make it work.
Date | Version | Changes |
---|---|---|
1995-12 | only a global alignment of the text in the cells | |
1995-12-17 | 1.0 | first published version, alignment for cells, columns or global |
1996-07-03 | 1.1 | added reset methods to set the alignment back to the default value |
1996-12-14 | 1.2 | rewrote the saving of data to the internal lists to make this
usable for saving other data added individual hints for each cell |
1997-02 | 1.3 | internally only; added fonts the same way as the alignments rewrote the Application.OnXXX handling for more flexibility |
1997-03-07 | 1.4 | added alignments and fonts for rows created a component editor to set the alignments, hints and cells at design time and all the stuff needed to save this to the DFM files |
1997-05-22 | 1.5 | corrected bug with D2 and hints corrected bug in component editor: the caption for left and right alignment were mixed up corrected strange behaviour of component editor: now cells which will become fixed are shown as fixed, but allow edit font colors now set back to clHighlightText when selected added background colors the same way as the alignments added font and color support in the component editor added InPlaceEditor which also uses the special properties of the respective cell added utility functions like RemoveRow RowMoving and ColMoving now supported correctly |
1997-09-10 | 1.6 | editor functions and events, read only cells import and export methods brushs instead of colors used internally multi lined text support selected cell colors |
1997-12-07 | 1.7 | sorting import and export to the clipboard enhanced the next editable cell functions |
2000-02-12 | 2.0 | redesigned internal storage of the array properties for more flexibility cut and paste cell sizing events and methods more wordwrap options online help compatibility to Delphi 5 and restored full compatibility with Delphi 1 |
2001-07-09 | 2.1 | Delphi 6 compatibility |
Last changed 2002-09-25