Commit Graph

101 Commits

Author SHA1 Message Date
Charlie Kindel
e4f5df6daf Merge pull request #987 from BDisp/demo-keys-fix
Fixes #986. Comparing with ShortcutHelper.GetModifiersKey in the demo.cs
2020-11-02 13:52:06 -07:00
BDisp
6ca91f7b87 Fixes #988. Update NStack.Core to version 0.15.0. 2020-10-31 00:01:09 +00:00
BDisp
3343062cad Change to Key.Q because it conflicts with Linux terminal. 2020-10-29 15:49:42 +00:00
BDisp
c53acea225 Fixes #986. Comparing with ShortcutHelper.GetModifiersKey in the demo.cs 2020-10-29 15:05:07 +00:00
BDisp
01d4b4f55f Added wide improvements on keys managements. 2020-10-26 00:46:51 +00:00
BDisp
21650576eb Recover from rebase. 2020-10-24 01:35:04 +01:00
Charlie Kindel
dc0397641c readme updates 2020-10-22 09:27:07 -06:00
Charlie Kindel
295b2ac779 Merge pull request #950 from tig/remove_ienumerable
POC to remove IEnumerable from View & Window
2020-10-21 16:18:09 -06:00
BDisp
b56edacbac Fixes #225 and maybe #41. Allowing Rune.ColumnWidth greater than one. 2020-10-16 17:08:57 +01:00
Charlie Kindel
473afe0732 poc 2020-10-08 13:47:47 -06:00
Artyom
64fdcea6b5 Define View actions as events 2020-09-23 01:26:46 +03:00
Artyom
6aef632633 Button.Clicked as a C# event 2020-09-23 01:01:53 +03:00
Charlie Kindel
7aa3079274 Merge pull request #846 from BDisp/dynamic-menu-bar
Fixes #644. Added a UICatalog Scenario for a dynamic menu bar.
2020-08-07 06:19:50 -07:00
BDisp
109fd25c9e Fixes #644. Added a UICatalog Scenario for a dynamic menu bar. 2020-08-03 03:08:32 +01:00
BDisp
d232715e62 Fixes #844. Now selects the correct Directory. 2020-08-02 11:17:10 +01:00
BDisp
fda4e21341 Making SetFocus (View) private. 2020-07-28 18:42:10 +01:00
BDisp
cf5527a917 Fixes #803. Init and Shutdown only run once. 2020-07-17 01:20:22 +01:00
Ross Ferguson
b9c8758d2d ComboBox. Adhere to ListView interface, added:-
SelectedItem (read only) from @BDisp
OpenSelectedItem
2020-07-05 01:50:59 +01:00
Ross Ferguson
852400957e Merge branch 'master' of https://github.com/migueldeicaza/gui.cs into combobox_fixes2 2020-07-04 01:28:30 +01:00
Ross Ferguson
de5a30bb90 ComboBox hand pick @BDisp changes:-
Test dir more robust "\Windows"
Use ListViewItemEventArgs
2020-07-03 05:22:00 +01:00
BDisp
67785f7e7f Forgot shutdown the driver at exit. 2020-07-03 01:04:18 +01:00
BDisp
aa51de0bf0 Improvement the Application.Top in Demo. 2020-07-02 23:57:50 +01:00
Ross Ferguson
3d8ef9a2de Rebase 2020-06-28 12:08:15 +01:00
Ross Ferguson
acacd0c9e7 Accomodate upstream changes 2020-06-20 19:56:12 +01:00
Ross Ferguson
cfcf8efb59 ComboBox multiple fixes. Dim.Fill() incorrectly calculated. List height not resizing. SetSource() not immeadiately updating list. Double click not selecting item. Example now demo resizes with view 2020-06-20 18:28:58 +01:00
Charlie Kindel
606e2728ae Merge branch 'master' into crlf_label 2020-06-18 10:26:04 -07:00
BDisp
9b695799ab Fixes #705 setting current Application.Top. 2020-06-18 16:34:12 +01:00
Charlie Kindel
49bfe6a6c2 progress...rabbit hole 2020-06-17 08:50:38 -07:00
Charlie Kindel
634f214d6a fixed status bar resize on Windows; not in cmd.exe 2020-06-13 08:13:58 -07:00
BDisp
554202f5e7 Removing the unnecessary force from the View. 2020-06-11 21:37:06 +01:00
BDisp
2766af8afe Allowing negative coordinates for scrolling purpose. 2020-06-11 18:55:15 +01:00
Ross Ferguson
36a658d3e8 ComboBox. Color/Dim.Fill() issues when hosted inside a dialog 2020-06-11 08:16:08 +01:00
Ross Ferguson
6f94a776fd ComboBox: Refactor. Resize Width working 2020-06-08 10:05:16 +01:00
Ross Ferguson
4a3e1d0959 ComboBox. Adopt ListView interface pattern 2020-06-08 10:01:10 +01:00
Ross Ferguson
89e2790a1c ComboBox supports Dim.Fill() Dim.Percent() 2020-06-08 10:01:10 +01:00
Charlie Kindel
dc878b899c enabled better characters 2020-06-07 15:12:25 -06:00
BDisp
89a4bdeb03 Changed from Terminal.Gui all EventHandler to Action. 2020-06-06 19:02:37 +01:00
BDisp
d32c631dfd Changed from DateTime to TimeSpan. Changed from EventHandler to Action. 2020-06-06 15:35:07 +01:00
Charlie Kindel
da5bfd46f2 feature complete 2020-06-04 23:09:14 -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
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
BDisp
fa29269ade Added mouse support to the StatusBar. (#598) 2020-06-02 22:24:11 -04:00
BDisp
4fcb164f4b Added class KeyModifiers which improvements better control over the combinations keys. 2020-05-31 01:43:47 +01:00
Charlie Kindel
8e63b9fdf8 merged with master 2020-05-28 12:26:12 -06:00
Charlie Kindel
9abe84125d merged docs 2020-05-27 19:23:18 -06:00
Charlie Kindel
532285db8d Moved NetDriver's IMainLoopDriver impl to NetDriver.cs 2020-05-27 17:24:08 -06:00
Charlie Kindel
140bb276ee moved mainloop out of CursesDriver 2020-05-27 17:10:36 -06:00
Charlie Kindel
4d7ae9d2f2 refactored per #541 2020-05-24 22:23:35 -06:00
Fabian R
46b4c9025b Improved View Key event handling
+ Added Handled property of type bool to the KeyEventEventArgs class.
+ Added ability to stop further propagation for already handled events on Views for Keyboard related event subscribers (like KeyDown, KeyUp and KeyPress). The driver will check the Handled property of the KeyEventEventArgs passed to the subscribers and will stop any further invocations when its found true.
+ Updated Example project to expose the ability to programatically Open/Close a MenuBar from custom keystrokes.

This commit fixes an issue where the library would crash if the Subviews collection of the currently active View gets updated from inside any of the Keyboard event handlers, such as when the view is updated as a result of a custom Hotkey/Coldkey press.
2020-05-24 06:36:42 -05:00
Charlie Kindel
635b565097 merge 2020-05-23 23:06:31 -06:00