Skip to content
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

Significant MessageBox and Dialog Improvements #590

Closed
wants to merge 19 commits into from
Closed

Significant MessageBox and Dialog Improvements #590

wants to merge 19 commits into from

Conversation

tig
Copy link
Collaborator

@tig tig commented Jun 1, 2020

This PR requires #586

It includes many fixes, mostly focused on improving the look, feel, and usability of Dialog and MessageBox

The following bugs should be closed by this PR:

In addition we get these new features:

  • MessageBox.Query called with width and height == 0 get auto-size behavior. A new constructor is added making this easy to use.
  • Multi-line MessageBoxes are now supported. Just use \n to add lines. The height of the MessageBox will adjust automatically.
  • The MessageBoxes Scenario in UI Catalog provides a full demo/test-case.
  • Dialog called with width and height == 0 are sized to 85% container. A new constructor is added making this easy to use.
  • Dialog (and MessageBox Buttons are now dynamically laid out using Computed layout.
  • A Dialogs Scenario has been added to UI Catalog making it easy to test the API.
  • Button now supports BOTH specifying a hotkey with '' and the old behavior of using the first uppercase char (if '' is not found).
  • All UI Catalog scenarios that use Dialog or MessageBox now use the simplified API.
  • Terminal.Gui.dll now has version metadata and UI Catalog's about box displays it as a test case.
  • Button, Dialog, and MessageBox API documentation has been updated/revised.
  • View, Window, FrameView, and Dialog have been upgraded to use the new ConsoleDriver.DrawFrameWindow API directly.

@tig tig added the breaking-change For PRs that introduces a breaking change (behavior or API) label Jun 1, 2020
@tig tig requested a review from migueldeicaza June 1, 2020 18:41
@tig tig marked this pull request as ready for review June 3, 2020 05:49
@tig
Copy link
Collaborator Author

tig commented Jun 3, 2020

This has to go in as part of my other big PR. @migueldeicaza : Please comment.

This was referenced Jun 3, 2020
@tig tig changed the title Fix frame, messagebox, dialog, and more Significant MessageBox and Dialog Improvements Jun 3, 2020
@migueldeicaza
Copy link
Collaborator

I am in awe at this work Charlie - thank you so much for this contribution.

I looked at the samples, and it looks like the only breaking change was the incoming parameters for the message box, we could add an API that ignores those parameters?

Did I miss something else?

I think this can go in, given that you have a mondo pull request with too many good enhancements, and we can later add a compatbility layer if someone complains.

migueldeicaza pushed a commit that referenced this pull request Jun 3, 2020
This PR includes:

#586 - Fixed Clipping
#587 - LayoutComplete
#591 - Sys Console Scenario
#590 - Significantly improves MessageBox, Dialog, Frame drawning and more
See the PRs above for all the details.

Here are the issues this closes:

Closes #299 - MessageBox now auto sizes
Closes #557 - MessageBoxes on small screens
Closes #432 - MessageBox does not deal with long text; width/height params are goofy
Closes #521 - MessageBox should take ustrings (BREAKING CHANGE)
Closes #35 - Dialog should have 1 char padding around edges
Closes #570 - Dialog should use computed layout for buttons
Closes #470 - UI Catalog: Add Dialogs Scenario
Closes #569 - LayoutComplete event
Plus probably more.
@tig
Copy link
Collaborator Author

tig commented Jun 3, 2020

I am in awe at this work Charlie - thank you so much for this contribution.

I looked at the samples, and it looks like the only breaking change was the incoming parameters for the message box, we could add an API that ignores those parameters?

Did I miss something else?

I think this can go in, given that you have a mondo pull request with too many good enhancements, and we can later add a compatbility layer if someone complains.

Miguel, I'm afraid we are going to need to do a 'breaking changes' release prior to 1.0 if we really want this project to "sing" long-term. There are enough deep bugs due to code churn/atrophy and inconsistencies (such as Frame v Bounds, weirdness around embedded ContentViews, and inconsistencies in how events are defined) that I really think we should bite the bullet and clean some stuff up. This will require breaking existing apps.

IMO, we should do this ONCE.

I think the build we are converging on (which I am calling 0.90) should be that ONCE.

The latest release notes show the breaking changes I've already identified (there may be more, but I've not done any testing to see).

@tig
Copy link
Collaborator Author

tig commented Jun 3, 2020

That said, I'll ensure the old constructors still work on this one.

@tig
Copy link
Collaborator Author

tig commented Jun 3, 2020

Now that Miguel's approved, I'm closing this PR as it will be incorporated in mondo #600

@tig tig closed this Jun 3, 2020
@tig tig deleted the fix_frame_dialog_messageboxes branch June 3, 2020 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change For PRs that introduces a breaking change (behavior or API)
Projects
None yet
2 participants