Comments (7)
I did a whole refactoring to supporting styling and lists, and got stuck on a bug, and never maanged to release the update. Tables is part of that update, I show cased tables in our gitter chat, ...you can do stuff like this easily;
see the discussion in gitter here: https://gitter.im/goblinfactory-konsole/community
I have been consumed with another project and since the conversation in gitter didn't get any attention konsole has been on my backlog of nice to fix, but not urgent.
I have one small bug I need some volunteers to help me iron out, then I have a massive update for konsole that will include list controls, with highlighted current item, with hooks for OnItemSelected, as well as inline form editing. I need the big styling refactoring since to get editing to work smoothly I need to be able to re-render a control with .active styling and .inactive styling when tabbing away. Windows need to be selectable as well (double line in color X when selected and single line when inactive etc).
A lot of work has gone into preparing for that, ...tables was done first. The same above uses a control DirectoryListView that implements ListView ...which is ...the table view you're asking for.
you can see table view in this branch, and you can use the code easily now with current Konsole if you want;
https://github.com/goblinfactory/konsole/tree/feature/list-view
from konsole.
code for the above screen, with the branch mentioned above, using custom business rules to style directories and large files differently based on business rules is just this
public static void Main(string[] args)
{
var window = new Window();
var console = window.SplitLeft("left");
var right = window.SplitRight("right");
var listView = new DirectoryListView(console, "../../..");
// let's highlight - all files > 4 Mb and make directories green
listView.BusinessRuleColors = (o, column) =>
{
if (column == 2 && o.Size > 4000000) return new Colors(White, DarkBlue);
if (column == 1 && o.Item is DirectoryInfo) return new Colors(Green, Black);
return null;
};
listView.Refresh();
Console.ReadKey(true);
}
from konsole.
your business rule can easily be ... if o.Selected == true
to easily support highlighting current item.
from konsole.
here's how to use the raw ListView
object to draw tables
var window = Window.OpenBox("openings", 50, sy, 35, 12, style);
var moves = new[] {
("Kings Gambit", 39, "win"),
("Sicilian Defence", 35, "draw"),
("French Defence", 22, "win"),
("Alekhine Defence", 19, "win"),
("Kings Gambit", 33, "win"),
("Kings Indian", 21, "draw"),
("Ruy Lopaz", 82, "lose") };
var view = new ListView<(string opening, int moves, string result)>( window,
_ => moves, (u) => new[] {
u.opening,
u.moves.ToString(),
u.result,
},
new Column("Opening", 0),
new Column("Moves", 7),
new Column("Result", 7)
); );
view.Refresh(); view.Refresh();
from konsole.
I am also working konsole Table
that automatically prints any collection as a table, var table = new Table(window); table.Print(myUserCollection)
or if you're not using a parent window, new Table(users).Print()
for the simplest use.
from konsole.
@DkAngelito just finished branch with ListView in it, ready for merging to master for testing.
https://github.com/goblinfactory/konsole/tree/feature/list-view-themes-no-tuples-docmd
Just need to update documentation and will release new version next few days.
from konsole.
Here's my test for the listview theming, almost all done, next I need to write the updates to the documentation then create new package for testing
from konsole.
Related Issues (20)
- Prevent console window resize HOT 16
- ProgressBar does not expose current HOT 8
- IWrite allow StringBuilder type of parameter HOT 9
- SplitRows and SplitColumns without border HOT 1
- Embedded CrLf cause window isolation to break.
- HighSpeed writer to support resize on window size change
- Fix spelling, Boxstyle.Thickness to Thickness.
- Menu not explained in the README. HOT 2
- when splitRows with 3 splits, with even number of parent rows, the last split is not expanding by 1 row
- Konsole.Writer.MoveBufferArea throws System.PlatformNotSupportedException on Nix Platforms HOT 4
- ProgressBar not working on Linux HOT 2
- Does window support chinese character text auto wrap? HOT 4
- Trying to use Konsole for First Time HOT 3
- Ability to close boxes. HOT 9
- Support non "lined" borders (line numbers, blue statusbar, and text header) HOT 1
- Seemingly impossible divide by zero exception thrown HOT 4
- System.ArgumentOutOfRangeException in ProgressBar.Refresh() HOT 16
- How to prevent console from being moved by user? Snap windows feature is changing size of Console. HOT 1
- The simple initialization of ProgressBar is throwing "The handle is invalid." exception in VSCode while debugging. HOT 7
- Add image support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from konsole.