Commit Graph

167 Commits

Author SHA1 Message Date
Charlie Kindel
51f698d595 fixed 2020-06-08 20:15:48 -06:00
BDisp
86423c52a2 Keep the master's. 2020-06-08 23:52:21 +01:00
BDisp
15e38550c5 Fixed a layout bug that preventing the redrawing on Pos and Dim changes. Now the TextAlignment is working well. I move them to the view for a generic uses to others views. 2020-06-08 23:39:31 +01:00
Charlie Kindel
1b8abd1421 RadioGroup event fix 2020-06-08 08:46:20 +01:00
Charlie Kindel
157255bc1b enabled better characters 2020-06-08 08:46:17 +01:00
Charlie Kindel
199e3aa113 double spacing 2020-06-08 08:46:04 +01:00
BDisp
43c958842e Resolves Button Text Alignment with Unicode chars. 2020-06-08 01:50:33 +01:00
Charlie Kindel
f00cdb0258 RadioGroup event fix 2020-06-07 16:00:39 -06:00
Charlie Kindel
dc878b899c enabled better characters 2020-06-07 15:12:25 -06:00
Charlie Kindel
f888d4de25 Merge branch 'master' into charmap_improvements 2020-06-07 10:03:24 -06:00
Charlie Kindel
1b5549bc07 tweaked api docs; adjusted enum name to match LayoutStyle 2020-06-07 00:09:07 -06:00
Charlie Kindel
dc4636a458 implemented menu checked and test scenario in UI Catalog 2020-06-06 22:46:46 -06:00
Charlie Kindel
19a717ee38 poc 2020-06-06 19:28:31 -06:00
Charlie Kindel
bb452a1c91 double spacing 2020-06-06 17:27:52 -06:00
Charlie Kindel
ffb17a7614 backed out charmap changes 2020-06-06 17:22:48 -06:00
Charlie Kindel
aedacd17a4 updated button scenario and tweaked button.cs 2020-06-06 17:15:22 -06:00
BDisp
6eeb3149b9 Change some Action and Class names. 2020-06-06 23:01:35 +01:00
Charlie Kindel
05a1944913 layout 2020-06-06 14:24:37 -06:00
Charlie Kindel
8feab947fd POC 2020-06-06 13:58:02 -06:00
BDisp
89a4bdeb03 Changed from Terminal.Gui all EventHandler to Action. 2020-06-06 19:02:37 +01:00
BDisp
db4fe3bc0f Added Text Alignment to the Button view. 2020-06-06 17:40:03 +01:00
Charlie Kindel
03104495a5 Merge pull request #628 from BDisp/date-time-field
Nicely done. Added DateTimeEventArgs and improved data and time validation.
2020-06-06 10:25:31 -06:00
Charlie Kindel
6b9645bdde compile warning 2020-06-06 09:51:16 -06:00
BDisp
d32c631dfd Changed from DateTime to TimeSpan. Changed from EventHandler to Action. 2020-06-06 15:35:07 +01:00
BDisp
f75a511057 Added DateTimeEventArgs and improved data and time validation. 2020-06-06 00:31:28 +01:00
Charlie Kindel
da5bfd46f2 feature complete 2020-06-04 23:09:14 -06:00
Charlie Kindel
5f67da9c54 progress demo bug 2020-06-04 17:15:26 -06:00
Charlie Kindel
17163a76a9 initial implementation 2020-06-04 17:09:32 -06:00
Charlie Kindel
90b19a5e04 POC 2020-06-04 12:43:19 -06:00
Ross Ferguson
4d2ddcf45f ComboBox. Support parameterless constructor. Update scenario demo 2020-06-04 10:11:46 +01:00
Charlie Kindel
e87b56cd77 updated api docs; implemented inheritdoc; may break deploy 2020-06-03 18:18:19 -06: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
857bdcbe24 fixes crashing bug on exit 2020-06-03 10:18:13 -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
f89fc03a0c merged onlayoutcomplete PR 2020-06-02 10:13:50 -06: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
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
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
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
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
b286ba6e0a updated documentation to clarify superview, view, and screen-relative regions 2020-05-30 20:05:05 -06:00