-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: KryptonMessageBox cuts off the last line (sometimes) #1599
Comments
Update:The above test was done on .NET 8.0. The situation is much worse on .NET Framework:
|
I'll have look at this. One question though: If possible would a scrollbar be an option to limit the size of the dialog (e.g. a percentage of the screen) as the WinForms MB does overshoot the screen when getting to big? @Wagnerp |
Hi @giduac Now assigned to you
No, there will be a patch for v85 in July, fixing the navigator issue (already been dealt with), so you can append to that. In V100, I suggest that we look at the possibility of overhauling |
Okay, I did some digging, found the root cause of the problem, and was going to create a PR but there are a few things that I'm not sure I understand. First, the cause of the problem is that in I checked the history of the file and looks like this bug was introduced in this commit when Now, I'm not sure whether the right thing to do is replicate that same logic for |
One question though: If possible would a scrollbar be an option to limit the size of the dialog (e.g. a percentage of the screen) as the WinForms MB does overshoot the screen when getting to big? Sure, that might be a nice-to-have to consider in the future. Although it's not really best practice to display a message box with text that would fill the entire height of the screen, so I wouldn't prioritize this if I were you. |
The measuring and sizing thereafter is indeed the problem. I'll keep you posted. |
Hi @Smurf-IV & @Wagnerp, I've been testing a bit with this. Since @Wagnerp said that KMB will get a review in V100 I suggest a quick fix for now. KMB is really not suited for "pages" of text and more centered toward simple messages and questions as is the standard Win(forms) MB. The easiest certain thing to do for now is to enlarge the calculated vertical message size by a certain percentage....??? Your advice please... |
Hi @giduac Yeah, once I found out the root cause, it became clear why it's more prominent in .NET Framework (i.e., because the default Re: "quick fix" Note that this isn't about displaying pages of text or anything. It happens with as few as 3 lines. Check the following for example: |
How about if you for now push it to your own branch on you account (without submitting a PR). Let us know when you pushed the commit? |
Done. Here's the commit: Ahmed-Abdelhameed@a82ce80 So, the font was not the only problem. There were a couple more that I fixed as well:
There are a couple of things left (I will fix in a separate commit):
I will push another commit for this shortly and will create a new issue for this so you can reference it in your own commit. |
This commit was made against the V85 branch. |
Oh, okay. Let me fix that. |
Done: Ahmed-Abdelhameed@16b4440 |
Hi @Ahmed-Abdelhameed & @giduac My $0.02 cents on this... Patch it for V90, then do a complete overhaul for V100. It is possible to use a KRichTextBox for the content area. The added benefits would be scrolling & detection of URLs. Doing a test for KToasts, using KRichTextBoxes and it works really well. Maybe either of you can come up with a todo list for the V100 overhaul? cc. @Smurf-IV |
I tested the fix, it works nicely and don't think there will be any objections to it. So before we all publish a PR we always build the project from the command line and include a screenshot of the results. For V85 there maybe no errors of course. Screenshot of the included build results image in a PR: Include a link to the issue being handled which makes the PR show up in the issue.. When you create the PR in GitHub Desktop make sure to set it against the correct branch (V85 of course in this case). If you have questions ..... |
PR submitted.
RTB will most likely introduce more bugs and overcomplicate things. In my opinion, KMessageBox should be very simple and behave as close as possible to the original Win32 MessageBox. Then, for extra functionality (URLs, etc.), we can have another component like the one(s) that exist in the extended suite (I haven't tested any of them myself). |
@Wagnerp & @Ahmed-Abdelhameed There's a plan for an instantiable MessageDialog in V100 which will have more options to it and will be designed differently. |
Looks like V90 requires the latest version of Visual Studio Preview, which I'm not using at the moment. I'll see if I can upgrade to it later. |
@Ahmed-Abdelhameed , |
Been a long time :)... |
Hi @giduac Sorry for the sudden disappearance. It was a pretty hectic week for me. Okay, I finally installed VS 2022 Preview so that I can build against .NET 9.0. Let me see what I can do. |
If you are pressed for time I can finish the KMB tickets? |
They're all merged into the V85 branch, right? I was just about to review the changes made to V90, see what's missing, and go from there but I was faced with this problem. I'll wait and see what gets decided and then continue with the fixes. |
I think @Wagnerp is in charge of the icons around here ;) |
Well, the icon itself isn't the problem, but rather the PictureBox control that contains the icon (that's what I meant). The icon size is the same, AFAICT. I think we should make the default size the same as in Edit: Actually, the PictureBox is docked, so the form size is the problem. |
The actual size of the image does not need to be changed, but the size of the form itself. This can be done in the |
Hi @Ahmed-Abdelhameed, The WinForms MessageBox always closes on escape, the krypton kmb sometimes. // Escape key kills the dialog if we allow it to be closed
if (ControlBox
&& (e.KeyCode == Keys.Escape)
)
{
Close();
}
else if (e.KeyData == (Keys.Control | Keys.C))
Could you please have look (when you have time) if |
Hey @giduac
Definitely not. The WinForms MessageBox does not always close with the Esc key. It only allows closing when it makes sense (i.e., when there's either an OK or a Cancel button), so for example, a |
TY & Case closed then I would say :) |
This is already fixed and merged into both V85 and alpha branches. |
@Ahmed-Abdelhameed |
When using KryptonMessageBox to display multiple lines, it sometimes cuts off the last line. I noticed it when displaying exactly three lines, so I ran some tests.
AFAICT, it only happens when displaying exactly 3 or 4 lines (less bad for 4 lines though).(this is only true for .NET Core. See comment below for .NET Framework test).Not sure if this is related to #1592 but it happens whether or not an icon is displayed.
Screenshots:
Code to reproduce:
Tested on latest stable (v85.24.6.176) and latest nightly (v90.24.7.183-alpha).
The text was updated successfully, but these errors were encountered: