View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001361 | JEDI VCL | 00 JVCL Components | public | 2004-02-24 01:41 | 2004-04-22 01:10 |
| Reporter | ogiesen | Assigned To | ogiesen | ||
| Priority | normal | Severity | major | Reproducibility | random |
| Status | closed | Resolution | fixed | ||
| Platform | OS | Windows 2000 Pro | OS Version | SP4 + Hotfixes | |
| Product Version | 3.00 BETA | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0001361: Painting issues in TJvDatePickerEdit | ||||
| Description | As discussed already on bug 0001345, there appears to be an issue with the control painting for TJvDatePickerEdit and descendants. To summarize, the problem is that for some users (e.g. Peter) the button is overpainted when typing in the control or when clicking the button unless the button is wrapped in a dummy TWinControl parent. This fix however for me has the effect that there suddenly is an extra right margin of 7 pixels in the text area which is bad if the control has to be sized rather narrowly. I never ever saw the symptom that the button holder is supposed to cure myself nor has it ever been reported by any of our numerous users. I am attaching screenshots of both the extra margin that I see with the button holder and the overpainting that Peter reported without it. BTW: Funny thing about the margin issue is that it doesn't happen at designtime. It only appears at runtime and even then it is rather unpredictable: I have one form with a TJvDatePickerEdit on it that consistently shows the text clipping seen in the attached screenshot. If I copy and paste this same control onto another form for testing, the text will not be clipped but the last digit will merely be invisible (scrolled off to the right). Without the button holder the date will fit into the visible text area completely. I tested this with both Delphi 5 and 7. | ||||
| Tags | No tags attached. | ||||
|
2004-02-24 01:41
|
|
|
2004-02-24 01:43
|
|
|
|
Maybe it's just a width calculation that isn't correct anymore when the button holder is in place? |
|
|
I think the solution is here (i.e remove the method): procedure TJvCustomDatePickerEdit.GetInternalMargins(var ALeft, ARight: Integer); begin inherited GetInternalMargins(ALeft, ARight); // ARight := ARight + FDropButton.Width; end; |
|
|
Well, this does indeed remove the extra margin but now the cursor vanishes under the button instead of scrolling the text if the control is too narrow. The whole purpose of the GetInternalMargins code is exactly to avoid the problem you keep experiencing and I can only say that it is working perfectly for me and always has been on all machines I ever distributed this to (0000140:0000150 around the world on all kinds of platforms and locales). I am totally at a loss why the two of us see such different behaviour. Could maybe someone else comment on this as well? BTW: I am working off the very latest CVS sources. |
|
|
> I can only say that it is working perfectly for me > and always has been on all machines I ever distributed this to It only takes one :) Anyway, I've looked into this in more detail and it turns out that the FDropButton's Width is 23 pixels although the FButtonHolder is 17px wide (sset by the GetSystemMetrics call) and FDropButton.Align = alClient. Very strange. The easiest solution is probably to change: procedure TJvCustomDatePickerEdit.GetInternalMargins(var ALeft, ARight: Integer); begin inherited GetInternalMargins(ALeft, ARight); ARight := ARight + FButtonHolder.Width; end; but you could also uncomment: ... FDropButton := TSpeedButton.Create(Self); ... // uncomment this line: Width := GetSystemMetrics(SM_CXVSCROLL) + 1; |
|
|
Swapping the Align and Parent calls, sets the button's width correctly as well: with FDropButton do begin Align := alClient; Parent := FButtonHolder; |
|
|
Right, exchanging Parent and Align AND making the proposed change to GetInternalMargins finally solved it for me. I have checked in the new revision now. Does this work for you as well this time (just to make sure ;) )? |
|
|
Works for me as well. Glad we solved that one<g>. Now, on to the next one... PS You can close this bug now, I guess |
|
|
Yay! Thanks again! :] ...but we still don't know why the previous version didn't work for you... ;) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2004-02-24 01:41 | ogiesen | New Issue | |
| 2004-02-24 01:41 | ogiesen | File Added: extra-margin.png | |
| 2004-02-24 01:43 | ogiesen | File Added: JvDBDatePickerEdit.gif | |
| 2004-02-24 03:43 |
|
Note Added: 0003025 | |
| 2004-02-24 03:46 |
|
Note Added: 0003026 | |
| 2004-02-24 04:03 | ogiesen | Note Added: 0003027 | |
| 2004-02-24 04:34 |
|
Note Added: 0003029 | |
| 2004-02-24 04:35 |
|
Note Added: 0003031 | |
| 2004-02-24 04:45 | ogiesen | Note Added: 0003033 | |
| 2004-02-24 04:47 | ogiesen | Assigned To | => ogiesen |
| 2004-02-24 04:47 | ogiesen | Status | new => feedback |
| 2004-02-24 04:47 | ogiesen | Resolution | open => fixed |
| 2004-02-24 04:47 |
|
Note Added: 0003034 | |
| 2004-02-24 04:48 | ogiesen | Status | feedback => resolved |
| 2004-02-24 04:48 | ogiesen | Note Added: 0003035 | |
| 2004-04-22 01:10 |
|
Status | resolved => closed |