Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005233 [JEDI VCL] 04 Feature Request feature always 2010-05-10 08:50 2012-02-29 16:55
Reporter ZENsan View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0005233: TJvDBGrid wordwrap
Description It will be good to add special event for DbGrid called like "OnColumnWordwrap" returning bollean if drawed column must be wordwrapped.
If we allow row resizing, then really I see only OnDrawCell possibility for that or modifying source unit and then including it into project.
Additional Information
Tags No tags attached.
Attached Files zip file icon JvDbGridWordWrap.zip [^] (1,353 bytes) 2010-06-08 09:29
png file icon Clipboard-1.png [^] (5,363 bytes) 2010-11-23 16:46

- Relationships

-  Notes
(0017452)
obones (administrator)
2010-06-07 13:49

Could you please provide the zipped sources of a sample application showing this?
(0017532)
ZENsan (reporter)
2010-07-09 14:09

Hello?
(0017800)
obones (administrator)
2010-10-08 15:57

Thanks, someone with DB knowledge will have to look at this
(0018152)
ZENsan (reporter)
2010-11-23 16:46

I just checked this issue again. So there is no problems with String Fields. If Grid.WordWrap is true, then everything goes fine. But Date fields and other fielda re not wordwrapped. That's strange...
(0018153)
ZENsan (reporter)
2010-11-23 16:55

That is because of:

on line 3450 of JvDBGrid.pas must be this text instead of previous:

if (Field.DataType in [ftString, ftWideString]) or WordWrap or (FShowMemos and ((Field.DataType in [ftMemo{$IFDEF COMPILER10_UP}, ftWideMemo{$ENDIF}]) then
(0018154)
ZENsan (reporter)
2010-11-23 16:57

begin
      if (Field.DataType in [ftString, ftWideString]) or WordWrap or (FShowMemos and (Field.DataType in [ftMemo{$IFDEF COMPILER10_UP}, ftWideMemo{$ENDIF}])) then
      begin
        if Assigned(Field.OnGetText) then
          MemoText := Field.DisplayText
        else
          MemoText := Field.AsString;
        WriteCellText(Rect, 2, 2, MemoText, Column.Alignment,
          UseRightToLeftAlignmentForField(Field, Column.Alignment), False);
      end
      else
        DefaultDrawColumnCell(Rect, DataCol, Column, State);
    end;

This works like a magic.
(0018155)
ZENsan (reporter)
2010-11-23 16:59

before there was check only for TSrtingField... And how About all ancestors, TWideStringField and so on.

I think checking datatype is quite good idea.
(0018159)
ZENsan (reporter)
2010-11-24 09:10

begin
      if (Field.DataType in [ftString, ftWideString]) or WordWrap or (FShowMemos and (Field.DataType in [ftMemo{$IFDEF COMPILER10_UP}, ftWideMemo{$ENDIF}])) then
      begin
        if Assigned(Field.OnGetText) or not (Field.DataType in [ftString, ftWideString])then
          MemoText := Field.DisplayText
        else
          MemoText := Field.AsString;
        WriteCellText(Rect, 2, 2, MemoText, Column.Alignment,
          UseRightToLeftAlignmentForField(Field, Column.Alignment), False);
      end
      else
        DefaultDrawColumnCell(Rect, DataCol, Column, State);
    end;

This is correction for previous post.
(0018206)
AHUser (developer)
2010-11-28 12:03

Fixed in svn revision 12927.
There is now a "WordWrapAllFields: Boolean default False" property.


@ZENsan: The check for "Field is TStringField" also includes the TWideStringField because it derives from it and the is-operator handles this.

- Issue History
Date Modified Username Field Change
2010-05-10 08:50 ZENsan New Issue
2010-06-07 13:49 obones Note Added: 0017452
2010-06-07 13:49 obones Status new => feedback
2010-06-08 09:29 ZENsan File Added: JvDbGridWordWrap.zip
2010-07-09 14:09 ZENsan Note Added: 0017532
2010-10-08 15:57 obones Note Added: 0017800
2010-10-08 15:57 obones Status feedback => acknowledged
2010-11-23 16:46 ZENsan Note Added: 0018152
2010-11-23 16:46 ZENsan File Added: Clipboard-1.png
2010-11-23 16:55 ZENsan Note Added: 0018153
2010-11-23 16:57 ZENsan Note Added: 0018154
2010-11-23 16:59 ZENsan Note Added: 0018155
2010-11-24 09:10 ZENsan Note Added: 0018159
2010-11-28 12:03 AHUser Note Added: 0018206
2010-11-28 12:03 AHUser Status acknowledged => resolved
2010-11-28 12:03 AHUser Fixed in Version => Daily / SVN
2010-11-28 12:03 AHUser Resolution open => fixed
2010-11-28 12:03 AHUser Assigned To => AHUser
2012-02-29 16:55 obones Fixed in Version Daily / SVN => 3.45


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker