Bug 343364 - MessageBox: Show() does not display OK button for large message
Summary: MessageBox: Show() does not display OK button for large message
Status: RESOLVED DUPLICATE of bug 327039
Alias: None
Product: Mono: Class Libraries
Classification: Mono
Component: libgdiplus (show other bugs)
Version: 1.2.6
Hardware: All All
: P5 - None : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard: MessageBox
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-21 16:47 UTC by Forgotten User lsqq-oKg62
Modified: 2008-05-05 14:16 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
if it's just the visiblity of buttons u wanted, here's the patch. however this doesnot rectify the problem. i'm working on it (1.99 KB, text/plain)
2007-11-22 10:20 UTC, Srikanth Madikeri
Details
somthing wrong with the previous one.. try this instead (1.96 KB, text/plain)
2007-11-22 10:52 UTC, Srikanth Madikeri
Details
Alternative solution (752 bytes, text/x-patch)
2007-11-23 05:30 UTC, Everaldo Canuto
Details
Screenshot (Ubuntu 7.10) (3.12 KB, image/x-png)
2008-01-22 07:27 UTC, Gert Driesen
Details
Screenshot (Mono - Windows XP) (6.93 KB, image/x-png)
2008-01-22 07:29 UTC, Gert Driesen
Details
Screenshot (.NET - WinXP) (5.96 KB, image/x-png)
2008-01-22 07:33 UTC, Gert Driesen
Details
My Linux screenshot (3.80 KB, image/png)
2008-01-22 22:12 UTC, Everaldo Canuto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Forgotten User lsqq-oKg62 2007-11-21 16:47:37 UTC
To reproduce, execute the line of code:

MessageBox.Show(new StringBuilder().Insert(0,"aa ",1000).ToString());

Observed:

Ok button does not appear

Expected:

OK button should appear.


MONO 1.2.6 preview 2
 .NET 2 profile
Windows XP
640x480 screen resolution
Comment 1 Srikanth Madikeri 2007-11-22 10:20:57 UTC
Created attachment 184365 [details]
if it's just the visiblity of buttons u wanted, here's the patch. however this doesnot rectify the problem. i'm working on it
Comment 2 Srikanth Madikeri 2007-11-22 10:52:47 UTC
Created attachment 184376 [details]
somthing wrong with the previous one.. try this instead
Comment 3 Everaldo Canuto 2007-11-23 05:30:11 UTC
Created attachment 184474 [details]
Alternative solution

Your patch looks to be very complex, a better and more simple approach is to use parameter width of TextRenderer.MeasureString, this patch use it, with one line of code we can calculate mas size based on 60% of screen width.

This patch also need more changes to draw text correct, for this I will attach a final patch. Probably we will need to use a Rectangle parameter in DrawString to limit the width area when drawing text. Patch coming soon.
Comment 4 Everaldo Canuto 2007-11-23 05:46:06 UTC
Patch commited to SVN r90215.
Comment 5 Everaldo Canuto 2007-11-23 06:01:01 UTC
The SVN r90216 fixed remaining issues.
Comment 6 Gert Driesen 2007-11-23 20:29:43 UTC
Everaldo, the line wrapping does not appear to work on Linux. Works fine on Win32 though.
Comment 7 Everaldo Canuto 2007-11-23 22:36:24 UTC
After r90216 it works on Linux, I use Linux and it works fine here.

Maybe you tested before 90216.
Comment 8 Gert Driesen 2008-01-16 21:09:13 UTC
Still get the same result (using Ubuntu).
Comment 9 Everaldo Canuto 2008-01-17 04:26:52 UTC
Could you please provide an screenshot? For me it works really fine.

What version of Ubuntu you use?
Comment 10 Gert Driesen 2008-01-17 07:40:20 UTC
7.10 (Gutsy Gibson). I'll attach a screenshot later today.
Comment 11 Everaldo Canuto 2008-01-21 19:27:46 UTC
I installed one ubuntu Vm, tested it and also works for me. I will mark as NEEDINFO because I cant reproduce it after my fixes.

Please give us an screenshot or more details if problem still remain for you.
Comment 12 Forgotten User lsqq-oKg62 2008-01-21 19:42:58 UTC
You entered wrong info provider email. Please enter Gert as info provider.
Comment 13 Gert Driesen 2008-01-22 07:27:01 UTC
Created attachment 191262 [details]
Screenshot (Ubuntu 7.10)
Comment 14 Gert Driesen 2008-01-22 07:29:41 UTC
Created attachment 191263 [details]
Screenshot (Mono - Windows XP)
Comment 15 Gert Driesen 2008-01-22 07:33:00 UTC
Created attachment 191264 [details]
Screenshot (.NET - WinXP)
Comment 16 Gert Driesen 2008-01-22 07:34:40 UTC
Everaldo: do you actually get other results?

Note: There's still a horizontal spacing difference between Mono and .NET on Windows XP.
Comment 17 Everaldo Canuto 2008-01-22 22:10:37 UTC
In r93577 I just fixed the right border and now it looks exactly like in .NET.

I tested in Mono Win32, Mono opensuse 10.3 and Mono Ubuntu 7.10 and in all environments it looks ok.
Comment 18 Everaldo Canuto 2008-01-22 22:12:33 UTC
Created attachment 191407 [details]
My Linux screenshot

This is my screenshot, everything looks fine.
Comment 19 Everaldo Canuto 2008-01-22 22:15:50 UTC
Gert,

Are you sure that you have last Mono and Libgdiplus, I am sure that I already fixed this problem and it works for me in all environments.
Comment 20 Everaldo Canuto 2008-01-22 22:21:48 UTC
Ah, finally I found it, your sample code on report is:

MessageBox.Show(new StringBuilder().Insert(0,"aa ",1000).ToString());

and you are running screenshots maybe using:

MessageBox.Show(new StringBuilder().Insert(0,"aa",1000).ToString());

Small difference take get different results.
Comment 21 Gert Driesen 2008-01-23 08:08:51 UTC
My mistake, the code I use does indeed not insert a blank:

MessageBox.Show (new String ('a', 1000), "bug #343364");
Comment 22 Everaldo Canuto 2008-05-03 22:26:42 UTC
Ok. I am moving from WinForms to libgdiplus because it is an issue with Measure and Draw functions in libgdiplus. On Win32 if you make a long string with no space between chars it break in some line, on Linux it dont happens.
Comment 23 Sebastien Pouliot 2008-05-05 14:16:03 UTC

*** This bug has been marked as a duplicate of bug 327039 ***