http://bugs.winehq.org/show_bug.cgi?id=21489
Summary: simple Delphi program: wrong text label height in some cases Product: Wine Version: 1.1.37 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comctl32 AssignedTo: wine-bugs@winehq.org ReportedBy: iggy@inbox.ru
Created an attachment (id=25881) --> (http://bugs.winehq.org/attachment.cgi?id=25881) sources and executable 7z
There is label with right justify alignment and with word wrap on a form. Changing label caption runtime from short word to phrase of 3 words, cause label height increase, but wrong value. Phrase appears consisting of 2 string, but label height corresponds if it was 3 string. And phrase vertically centered. There are buttons to change label caption and to get label heigth. Same program (in attachment) works correct on WinXP. May be somewhere in DrawText Windows GDI...
http://bugs.winehq.org/show_bug.cgi?id=21489
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com 2010-01-25 06:56:22 --- Correct me if I'm wrong - TLabel uses Static control?
Does native comctl32 really help here?
http://bugs.winehq.org/show_bug.cgi?id=21489
Igor Savchenko iggy@inbox.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal
--- Comment #2 from Igor Savchenko iggy@inbox.ru 2010-01-25 06:58:25 ---
And phrase vertically centered.
sorry. this is not WINE bug. it is coded in program )
http://bugs.winehq.org/show_bug.cgi?id=21489
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com 2010-01-25 07:03:16 --- (In reply to comment #2)
And phrase vertically centered.
sorry. this is not WINE bug. it is coded in program )
Whole report is invalid or only text placement part?
P.S. don't change severity field please.
http://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #4 from Igor Savchenko iggy@inbox.ru 2010-01-25 07:04:51 ---
Whole report is invalid or only text placement part?
only text placement
http://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com 2010-01-25 07:07:40 --- (In reply to comment #4)
Whole report is invalid or only text placement part?
only text placement
Ok. What about questions from comment 1?
http://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #6 from Igor Savchenko iggy@inbox.ru 2010-01-25 07:08:06 --- wrong text height
http://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #7 from Igor Savchenko iggy@inbox.ru 2010-01-25 07:12:36 ---
Ok. What about questions from comment 1? Does native comctl32 really help here?
not tested yet. please wait.
Correct me if I'm wrong - TLabel uses Static control?
I'm suppose it is true.
TLabel in StdCtrls.pas TLabel Hierarchy (from Help): System.TObject Classes.TPersistent Classes.TComponent Controls.TControl Controls.TGraphicControl StdCtrls.TCustomLabel
http://bugs.winehq.org/show_bug.cgi?id=21489
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|comctl32 |-unknown
--- Comment #8 from Dmitry Timoshkov dmitry@codeweavers.com 2010-01-25 07:14:00 --- Wrong component then.
http://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #9 from Igor Savchenko iggy@inbox.ru 2010-01-25 07:21:45 --- (In reply to comment #8)
Wrong component then.
yes, thanks. using native comctl32 not helps - tested.
http://bugs.winehq.org/show_bug.cgi?id=21489
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase
http://bugs.winehq.org/show_bug.cgi?id=21489
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #10 from Igor Savchenko iggy@inbox.ru 2010-02-24 03:41:43 --- There is more detailed bug description. Bug is occasional. It happens when word wrap is enabled and two lines of text, RENDERED IN CURRENT FONT, match to this rule: first string length less or equal than second string length. thus, first string consist of first word and second word. and second string is third word. Example: firstword and second_word instead of "and" there could be "an", "a" or "nd".
I suppose bug is in DrawText (Windows GDI function) implementation.
int DrawText( HDC hDC, // handle to DC LPCTSTR lpString, // text to draw int nCount, // text length LPRECT lpRect, // formatting dimensions UINT uFormat // text-drawing options );
Delphi uses it (simplistic) like: DrawText(Canvas.Handle, PChar(DText), Length(DText), Rect, DT_EXPANDTABS or DT_CALCRECT or DT_WORDBREAK); DT_EXPANDTABS = $40,DT_CALCRECT = $400,DT_WORDBREAK = $10
Please try to use function like writed above. var Rect's initialization dimensions must be less then Rect's result dimensions (triggered by DT_CALCRECT).
Bug is when var Rect's result height is 3x greater then text string height (when text consists of two strings). New attachment program (with sources) demonstrates bug, just click button to set two string text. Program shows heights, heights relation, and bug status (relation 1 or 2 - ok, 3 - bug) in its status bar sections. Text has white background (this is Rect) - so bug is visual.
http://bugs.winehq.org/show_bug.cgi?id=21489
Igor Savchenko iggy@inbox.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #25881|0 |1 is obsolete| |
--- Comment #11 from Igor Savchenko iggy@inbox.ru 2010-02-24 03:46:21 --- Created an attachment (id=26445) --> (http://bugs.winehq.org/attachment.cgi?id=26445) sources and executable zip - bug demonstration
http://bugs.winehq.org/show_bug.cgi?id=21489
ocean04@suomi24.fi changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ocean04@suomi24.fi
--- Comment #12 from ocean04@suomi24.fi 2011-07-05 09:27:41 CDT --- Still in 1.3.23
http://bugs.winehq.org/show_bug.cgi?id=21489
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |00cpxxx@gmail.com Ever Confirmed|0 |1
--- Comment #13 from Bruno Jesus 00cpxxx@gmail.com 2012-07-18 16:53:54 CDT --- Still in wine 1.5.9.
https://bugs.winehq.org/show_bug.cgi?id=21489
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Abandoned?
--- Comment #14 from Ken Sharp imwellcushtymelike@gmail.com --- Is this still an issue in Wine 1.7.45 or later?
https://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #15 from ocean04@suomi24.fi --- No change, wine-1.7.46
https://bugs.winehq.org/show_bug.cgi?id=21489
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #16 from winetest@luukku.com --- Assuming the program is made to print bug! when there is a bug to be seen if not it prints ok.
Still valid then 1.9.21-git.
https://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #17 from Igor Savchenko iggy@inbox.ru --- Created attachment 55989 --> https://bugs.winehq.org/attachment.cgi?id=55989 not a bug
https://bugs.winehq.org/show_bug.cgi?id=21489
--- Comment #18 from Igor Savchenko iggy@inbox.ru --- it's not a bug. please mark it so. I was ordered to report this problem like a bug. mistakenly. this behavior is repeated on Windows too, but rarely. depends of font size. see attachment png.
https://bugs.winehq.org/show_bug.cgi?id=21489
Igor Savchenko iggy@inbox.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID
--- Comment #19 from Igor Savchenko iggy@inbox.ru --- not a bug. sorry
https://bugs.winehq.org/show_bug.cgi?id=21489
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #20 from Bruno Jesus 00cpxxx@gmail.com --- Closing invalid bugs.