View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004034 | JEDI VCL | 00 JVCL Components | public | 2007-01-09 15:08 | 2007-06-19 08:11 |
Reporter | martinalex | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | won't fix | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0004034: JvgCheckListBox multi line error | ||||
Description | For multiline display JvgCheckListBox works ok when I display data the first time with FormShow. For all data added later only the first line for each entry is shown. The data for e.g. a second line in one entry is there but the drawing rectangle is not high enough. TJvgListBox.CNMeasureItem In procedure TJvgListBox.CNMeasureItem the text height is calculated with Windows function DrawText and DT_CALCRECT There is already a workaround in place if DrawText returns zero height - use 14 then. Windows.DrawText(Canvas.Handle, PChar(Items[itemID]), Length(Items[itemID]), R, DT_CALCRECT or WordBreak[fboWordWrap in Options]); if R.Bottom = 0 then R.Bottom := 14 This workaround is ok only for single line items and for default font size 8 pt, otherwise the item field is not high enough. DrawText ALWAYS returns ZERO when called after FormShow. I don't know why, but I think the canvas handle is invalid. My fix uses CreateCompatibleDC to have a valid device context. This DC is used instead of Canvas.Handle. Now DrawText never returns zero height. Multi line items or items with larger font are now displayed correctly. Unfortunately the calculated height differs by +1 or +2 pixels per line to the prior method, but all data is visible. Var DC: HDC; ... DC := CreateCompatibleDC(0); Windows.DrawText(DC, PChar(Items[itemID]), Length(Items[itemID]), R, DT_CALCRECT or WordBreak[fboWordWrap in Options]); DeleteDC(DC); Fixed module attached Martin | ||||
Tags | No tags attached. | ||||
2007-01-09 15:08
|
JvgListBox.pas (32,058 bytes) |
|
The Globus components are progressively phased out (starting with TJvg) and you should not use them. Please use components from other tabs. If they are lacking features from the Globus ones, please try to implement them and let us know. |
|
For the moment the (fixed) TJvxCheckListBox is ok for me. Which JVCL checkListBox is maintained in the future? I have found four others TJvCheckListBox TJvTextListBox TJvxCheckListBox TJvHTListBox |
|
All of them, only the TJvg (notice the g at the end of the prefix) will be progressively phased out. Shall I close this issue then? |
|
Yes, can be closed |
|
As indicated to original poster |
Date Modified | Username | Field | Change |
---|---|---|---|
2007-01-09 15:08 | martinalex | New Issue | |
2007-01-09 15:08 | martinalex | File Added: JvgListBox.pas | |
2007-01-27 14:15 | obones | Note Added: 0010681 | |
2007-01-27 14:15 | obones | Status | new => feedback |
2007-02-14 03:59 | martinalex | Note Added: 0010811 | |
2007-02-16 00:57 | obones | Note Added: 0010887 | |
2007-02-24 13:36 | martinalex | Note Added: 0011160 | |
2007-06-19 08:10 | obones | Status | feedback => resolved |
2007-06-19 08:10 | obones | Resolution | open => won't fix |
2007-06-19 08:10 | obones | Assigned To | => obones |
2007-06-19 08:10 | obones | Note Added: 0013455 |