Commit Graph

880 Commits

Author SHA1 Message Date
Charlie Kindel
46cde0cb16 Merge branch 'master' of tig:migueldeicaza/gui.cs 2020-06-03 13:20:17 -06:00
Charlie Kindel
cb04a81ae0 Merge pull request #606 from BDisp/textview-features
Added some features to TextView like mouse wheeling and Ctrl+End/Home to navigate to the end and begin of the text.
2020-06-03 13:19:47 -06:00
BDisp
ca036453b3 Added some features to TextView like mouse welling and Ctrl+End/Home to navigate to the end and begin of the text. 2020-06-03 19:21:29 +01:00
Charlie Kindel
7a0c522a20 Upgraded ScrollView + Charmap (#601)
Note this PR should not be merged until after #600 is in. 

I went on a rampage tonight. It all started with wanting to use more/better characters for frame and other UI elements like the round corners:

![image](https://user-images.githubusercontent.com/585482/83601742-659ba800-a52e-11ea-9ee9-c888a7db5444.png)

I decided I needed a character map app that would let me test which fonts had which Unicode sets in them.

As a result we have this PR

- Fixes `ScrollView` in several key ways:
   - It now supports Computed layout and has constructors that don't require parameters.
   - `ScrollBarViews` are now positioned using Computed layout versus error prone absoulte
   - `ScrollBarViews` now correctly position themselves when one, either, or both are on/off.
   - `IsVertical` is now a public property that does the expected thing when changed
   - Mouse handling is better; there's still a bug where the mouse doesn't get grabbed by the `ScrollView` initially but I think this is a broader problem. I need @BDisp's help on this.

- The `Scrolling` Scenario was enhanced to demo dynamically adding/removing horizontal/vertical scrollbars (and to prove it was working right).

- I Enabled easy "infinite scroll capability" - CharMap literally lets you scroll over `int.MaxValue / 16` rows of data. Filling a `ContentView` with all of this and panning it around won't work. So I needed a way of having `Redraw` give me virtual coordinates. I did this by defining `OnDrawContent(Rect viewport)` and it's associated `event`:

```csharp
/// <summary>
/// Event invoked when the content area of the View is to be drawn.
/// </summary>
/// <remarks>
/// <para>
/// Will be invoked before any subviews added with <see cref="Add(View)"/> have been drawn.
/// </para>
/// <para>
/// Rect provides the view-relative rectangle describing the currently visible viewport into the <see cref="View"/>.
/// </para>
/// </remarks>
public event EventHandler<Rect> DrawContent;

/// <summary>
/// Enables overrides to draw infinitely scrolled content and/or a background behind added controls. 
/// </summary>
/// <param name="viewport">The view-relative rectangle describing the currently visible viewport into the <see cref="View"/></param>
/// <remarks>
/// This method will be called before any subviews added with <see cref="Add(View)"/> have been drawn. 
/// </remarks>
public virtual void OnDrawContent (Rect viewport)
{
	DrawContent?.Invoke (this, viewport);
}

```

I originally just implemented this pattern in `ScrollView`. Then I realized I wanted the same thing out of ALL `Views`. Namely: the ability to do drawing on an event, particularly to be able to paint something in the background. So I added it to `View`.

Note, that these changes mean we are about 3 small steps away from moving the scollbars from `ScrollView` into ALL views. Which makes a lot of sense to me because I don't think we want to implement duplicative logic in, say `ListView` and `TextView` as well. Why not just do it once?

Along the way I fixed some other things:

- The `Checkbox.Toggled` event now passes state. 

Here's some gifs. 
![](https://i.imgur.com/o5nP5Lo.gif)

Note:

- Scrollbars appear dynamically.
- Fast scrolling of huge data (using no memory).
- Static header
- Dynamic scrollbars on/off
- Note the bottom/right corner now draw correctly in all situations
2020-06-03 13:16:35 -04:00
Charlie Kindel
cfb76b1abb Merge branch 'master' of tig:migueldeicaza/gui.cs 2020-06-03 10:37:40 -06:00
Charlie Kindel
78b0517599 Merge pull request #595 from BDisp/mouse-tasks
Added mouse tasks to the idle handlers. Fixed keyModifiers.
2020-06-03 10:37:17 -06:00
Charlie Kindel
fae3285371 Merge pull request #603 from tig/application_shutdown_crash
Fixes UI Catalog shutdown crash
2020-06-03 10:31:04 -06:00
Charlie Kindel
eaf254b4f4 Merge branch 'master' of tig:migueldeicaza/gui.cs 2020-06-03 10:22:40 -06:00
Charlie Kindel
cdae703610 Merge pull request #593 from BDisp/hexview-enter
Changed Tab key to Enter key as per the tenets. Closes #589
2020-06-03 10:21:03 -06:00
Charlie Kindel
857bdcbe24 fixes crashing bug on exit 2020-06-03 10:18:13 -06:00
Charlie Kindel
1040ec64a4 Merge branch 'master' of tig:migueldeicaza/gui.cs 2020-06-03 10:10:19 -06:00
Charlie Kindel
fddfcf8802 Charlie's Mondo Patch (#600)
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.
2020-06-03 11:33:06 -04:00
Miguel de Icaza
55b17d9fcc Update README.md 2020-06-03 11:31:53 -04:00
Charlie Kindel
3e02b9e1ef Merge branch 'mondo_onlayoutcomplete_clip_msgboxdlg' of tig:tig/gui.cs 2020-06-03 09:24:03 -06:00
Charlie Kindel
672e38bb9a Merge branch 'master' of tig:tig/gui.cs 2020-06-03 09:20:19 -06:00
Charlie Kindel
95de2ca9e6 fixed window drag redraw 2020-06-03 08:58:19 -06:00
Charlie Kindel
918ee5d06f merged sysconsole 2020-06-02 23:53:34 -06:00
Charlie Kindel
2e1132f484 merged upstream master 2020-06-02 23:50:40 -06:00
Charlie Kindel
7602b3e674 Merge branch 'master' into mondo_onlayoutcomplete_clip_msgboxdlg 2020-06-02 23:28:42 -06:00
Charlie Kindel
24087d75ea merged upstream master' 2020-06-02 23:28:26 -06:00
BDisp
72ee72807b ColorScheme inside the View instance. Updating OnKeyDownPressUpDemo to reflect the news changes. (#594) 2020-06-02 22:35:49 -04:00
BDisp
fa29269ade Added mouse support to the StatusBar. (#598) 2020-06-02 22:24:11 -04:00
BDisp
5d6fe403f5 Fixes ColorScheme null exception # 597. (#599) 2020-06-02 22:23:53 -04:00
BDisp
3f1ce65127 Added Async in the end as per tenets for async calls. 2020-06-02 20:08:35 +01:00
BDisp
f89555710f Added mouse tasks to the idle handlers. Fixed keyModifiers. 2020-06-02 19:34:36 +01:00
Charlie Kindel
f89fc03a0c merged onlayoutcomplete PR 2020-06-02 10:13:50 -06:00
Charlie Kindel
99e52ea05a Merge branch 'fix_frame_dialog_messageboxes' into mondo_onlayoutcomplete_clip_msgboxdlg 2020-06-02 09:46:34 -06:00
Charlie Kindel
ecec2c9312 Merge branch 'more_clip' into mondo_onlayoutcomplete_clip_msgboxdlg 2020-06-02 09:46:10 -06:00
BDisp
aadf3caede Changed Tab key to Enter key as per the tenets. Closes #589 2020-06-02 00:05:04 +01:00
Charlie Kindel
052a8cf5f6 added menu item to enable system console; fixed Init/Shutdown bug 2020-05-31 22:24:50 -06:00
Charlie Kindel
d4075a1a12 added menu item to enable system console; fixed Init/Shutdown bug 2020-05-31 22:17:18 -06:00
Charlie Kindel
db0ebfd04a Fixes #557 - MessageBox should take ustrings 2020-05-31 21:24:18 -06:00
Charlie Kindel
7e0b0d35e6 updated release notes in csproj 2020-05-31 20:59:51 -06:00
Charlie Kindel
00b90cb480 Merge branch 'master' into fix_frame_dialog_messageboxes 2020-05-31 19:58:05 -06:00
Charlie Kindel
6f078e29a6 Merge branch 'master' of tig:migueldeicaza/gui.cs 2020-05-31 19:50:22 -06:00
Charlie Kindel
a33fd89a9c Merge pull request #584 from BDisp/keys-modifiers
Added class KeyModifiers which improvements better control over the combinations keys.
2020-05-31 19:50:01 -06:00
Charlie Kindel
8e58434e72 fixed frame drawing, buttons, dialogs, messageboxes and more 2020-05-31 19:48:21 -06:00
BDisp
d8e1577594 Added shift keys status on the UICatalog StatusBar. 2020-06-01 01:45:29 +01:00
BDisp
30edaebaae No need to made KeyModifiers public in the class KeyEvent because his settings is already expose in the IsShift, IsAlt, IsCtrl, IsCapslock, IsNumlock and IsScrolllock. 2020-06-01 01:16:55 +01:00
BDisp
4c30df4347 Prevents ScrollView from handling the mouse if the content view needs to handle it. 2020-06-01 00:07:13 +01:00
BDisp
4234d9b614 Resolved some changes requested. 2020-05-31 23:59:31 +01:00
Charlie Kindel
1610e772bb merge 2020-05-31 09:41:09 -06:00
Charlie Kindel
222a71d9ea removed extraneous changes 2020-05-31 09:14:32 -06:00
Charlie Kindel
2e79a20581 fixed merge conflict 2020-05-31 09:11:01 -06:00
Charlie Kindel
844c0f7038 enhanced Scrolling demos 2020-05-31 09:05:10 -06:00
Charlie Kindel
31379aa03e review items 2020-05-31 00:58:51 -06:00
Charlie Kindel
d035fb1116 fixed clipping once and for all 2020-05-31 00:34:35 -06:00
Charlie Kindel
320d8c3f06 Merge branch 'master' into more_clip 2020-05-30 20:25:11 -06:00
Charlie Kindel
830160372a Merge branch 'master' of tig:migueldeicaza/gui.cs 2020-05-30 20:25:01 -06:00
Charlie Kindel
507713c07d Merge pull request #582 from BDisp/scroll-view-overridden
Prevents ScrollView from handling the mouse if the content view needs to handle it.
2020-05-30 20:24:45 -06:00