gui-cs / terminalguidesigner Goto Github PK
View Code? Open in Web Editor NEWForms Designer for Terminal.Gui (aka gui.cs)
License: MIT License
Forms Designer for Terminal.Gui (aka gui.cs)
License: MIT License
If not using the CLI args then the 'New..' menu item should prompt an 'Overwrite File' warning if the user selects something that already exists.
Some consoles need --usc
to render properly out of the box (linux mostly, and without messing with $TERM variable). The README should be up front about this.
Also with best intentions in the world sometimes designer can hard crash. Telling user they can fix console by typing reset
into borked console is friendly.
To reproduce:
Also undo/redo should force redraw, currently they sometimes don't for some activities.
Failed to open 'MyWindow.Designer.cs'
One or more errors occurred. (Could not compile ../../MyWindow.Designer.cs:
(19,36): error CS0102: The type 'MyWindow' already contains a definition for
'label1'
(21,36): error CS0102: The type 'MyWindow' already contains a definition for
'label1'
(23,36): error CS0102: The type 'MyWindow' already contains a definition for
'label1'
(27,37): error CS0102: The type 'MyWindow' already contains a definition for
'button1'
If you right click in the wrong place it is quite easy to Copy
the root
instead of the control you thought you were clicking. This can lead to duplicating the whole form. We should prevent copy/paste of the root.
Value does not fall within the expected range.
Terminal.Gui.View.set_Y(Pos value)TerminalGuiDesigner.UI.Editor.MoveControl(Int32 deltaX, Int32 deltaY) in /home/runner/work/TerminalGuiDesigner/TerminalGuiDesigner/src/UI/Editor.cs:line 510 at TerminalGuiDesigner.UI.Editor.HandleKey(KeyEvent keyEvent) in /home/runner/work/TerminalGuiDesigner/TerminalGuiDesigner/src/UI/Editor.cs:line 438
If user exits with Ctrl+Q warn the user if there are unsaved changes.
We can probably look at the undo stack size for that. Track it on save and watch for changes
In gui.cs having a null in the Menu items of a MenuItemBar indicates that a horizontal separator line should be added.
We should let the user define such separators with an intuitive notation e.g. ---
(or simply more than x hyphens).
When you press keyboard Enter key on the Cancel button it just moves to Ok. Maybe theres a handled state that needs set?
Also how about it says (nah, its highlighted there in gray - thats fine, they can always undo anyway).Clear Property 'Text'
just so the user is absolutely clear on what is getting nuked
The following issues need workarounds or additions
Other nice to haves
Lets keep those dependencies uptodate!
If A is PosRelative Right of B and you multi copy/paste then the copies C and D should also have a PosRelative mapping (C is Right of D).
This happened when I was setting up a FrameView. I set a width with a percent and it saved it as a double into the designer. This causes an exception when loading that form again later (TerminalGuiDesigner won't load it until it is corrected manually).
this.FrameViewName.Width = Dim.Percent(60.000004);
I typed 60
in the field, so there is a precision issue as well.
Thanks for making an awesome tool!!
When using direct typing to edit the name of a button it seems to loose the last character you type.
Also using underscore to denote hotkey e.g. "Cl_ickMe" results in the wrong size for the button
There is no way to avoid the console closing after user clicked the X icon or press Alt+F4. What I suggesting is always auto saving the changes to a temporary file. If the user unexpected close the console the changes already are in that temporary file. If the user saves the designer before exit that temporary file is deleted. When the user reopen the designer later if still exist the temporary file, the tool will ask to the user if he wants to save the unsaved changes and thus this tool will be more reliability for the user.
MyView.cs
file (because it is intended for user editing).The following would be nice before releasing next version of software (which includes ColorScheme designing)
GraphView respects only its GraphColor
attribute and not ColorScheme
so setting ColorScheme
to the selection indication does not alter it's colors. Since we need to save/restore ColorScheme
when editing for the purposes of selection to support GraphView
we would need a Memento pattern and also set the GraphColor
.
Another annoying thing is
ComboBox
not hiding the list on click but only by double clicking or clicking on the down symbol. I don't remember if there is any option to close on click.
Originally posted by @BDisp in #62 (comment)
Hangs at DragOperation.cs:107
(DropInto.Add(mem.Design.View);
)
Seems like maybe it is trying to add the Top as a root view of its child. We should prevent dragging a control into one of it's own children as that will result in an infinite child loop I think.
Testing on Raspberry Pi lite with large font size shows several issues including the help box needing scroll support. Add that and review anything else and then document the minimum supported resolution.
If you delete a view and another view uses X/Y as PosRelative to that view then you get unrecoverable errors from the rendering engine. We need to detect these and:
Fix it
I think maybe because it is a container view, resizing other controls with click and drag still works e.g. Button
Triggered in Linux closing app with Ctrl+Q at random
Global Exception
Object reference not set to an instance of an object.
at Terminal.Gui.View.set_CanFocus(Boolean value)
at Terminal.Gui.MenuBar.CleanUp()
at Terminal.Gui.MenuBar.OnLeave(View view)
at Terminal.Gui.View.SetHasFocus(Boolean value, View view, Boolean force)
at Terminal.Gui.View.set_CanFocus(Boolean value)
at Terminal.Gui.View.Remove(View view)
at Terminal.Gui.View.Dispose(Boolean disposing)
at Terminal.Gui.View.Dispose(Boolean disposing)
at Terminal.Gui.TabView.Dispose(Boolean disposing)
at Terminal.Gui.View.Dispose(Boolean disposing)
at Terminal.Gui.View.Dispose(Boolean disposing)
at Terminal.Gui.View.Dispose(Boolean disposing)
at Terminal.Gui.Responder.Dispose()
at Terminal.Gui.Application.RunState.Dispose(Boolean disposing)
at Terminal.Gui.Application.RunState.Dispose()
at Terminal.Gui.Application.End(RunState runState)
at Terminal.Gui.Application.Run(Toplevel view, Func`2 errorHandler)
Terminal.Gui tab order between controls is dependent on the sequence in which they are added to the parent view.
TerminalGuiDesigner outputs controls in order of Ascending Y then X so that tab order is from top left to lower right.
TerminalGuiDesigner/src/ToCode/ViewToCode.cs
Lines 224 to 235 in 34d434d
However when views are in a TabView
this behaviour is not the same and controls are instead output in the order they are specified in .Designer.cs
which is typically the order the user added them to the tab view. This becomes a problem when a user makes changes to an old tab view and inserts new controls in the middle of the View - these get a tab order of 'last'
We need to centralise the order and update the following to use the centralised Order delegate:
TerminalGuiDesigner/src/ToCode/TabToCode.cs
Lines 41 to 48 in 34d434d
To reproduce this issue
You would expect tab order to be top to bottom but instead goes top,bottom,middle
Doing the same thing outside of a TabView works correctly.
The order in which items are output in InitializeComponent
is important when considering PosRelative.
Currently designer declares controls in the order they appear (top left to lower right). This ensures that tab order is roughly correct when user loads/uses the form.
However if using PosRelative for X/Y we need to make sure the Dependant
view is output before the Depender
view. Otherwise you get this error: #59 (comment)
Updating the Orientation
property of LineView
should also update the line rune (if it is the default value of the previous orientation).
Currently if user creates a line it is vertical |
and if they change Orientation to horizontal the line rune itself does not change. Also since the line rune is a unicode line symbol not a hyphen its hard for user to enter the horizontal pipe value in the UI.
Currently there are 2 ways to edit properties. You can right click something and access its 'Properties' submenu
Then there is F4 (which displays all properties and values).
View/edit all properties (default key F4 or click the view title in the context menu)
This is the Window ShowEditProperties
. It currently only works for a singular Design
. We should expand it to also work for multi selection in same way Context menu does (thanks to #42)
The new Label
seems not to be associated with the root view and its View.SuperView
is null despite appearing in the UI
Create a new MenuBar
Press F9 to edit the menu
Press Delete
Global Exception
Index was outside the bounds of the array.
at Terminal.Gui.Menu.MoveUp()
at Terminal.Gui.Menu.<>c__DisplayClass5_0.<.ctor>b__0()
at Terminal.Gui.View.InvokeKeybindings(KeyEvent keyEvent)
at Terminal.Gui.Menu.ProcessKey(KeyEvent kb)
at Terminal.Gui.View.ProcessHotKey(KeyEvent keyEvent)
at Terminal.Gui.Application.ProcessKeyEvent(KeyEvent ke)
at Terminal.Gui.WindowsDriver.ProcessInput(InputRecord inputEvent)
at Terminal.Gui.WindowsMainLoop.Terminal.Gui.IMainLoopDriver.MainIteratio
n()
at Terminal.Gui.MainLoop.MainIteration()
at Terminal.Gui.Application.RunLoop(RunState state, Boolean wait)
at Terminal.Gui.Application.Run(Toplevel view, Func`2 errorHandler)
Workaround is to run with the command line parameter --usc
Running without this setting seems to result in the mouse getting 'attached' to things that you are trying to drag making them impossible to drop even after releasing the mouse button. Starting drags also seems sluggish without --usc
.
Since menu separators are in code a 'null' and in the gui unselectable it is not possible to remove them other than by manually editing the .Designer.cs file.
If you create a separator by typing ---
as the name then you can undo it with Ctrl+Z but there is no way to revert it if opening an existing .Designer.cs that has separators you want to remove.
Maybe we could add a shortcut or if the separator is the last entry on the list then auto delete it or something?
Add checkbox
Type to edit name
Try to drag by selecting the name
With keyboard space ticks Checkboxes. In designer however we support direct typing to provide Text
when checkbox is focused (and other controls). This means that as the user types "My lovely checkbox" the tick appears and disapears each time they hit space.
As a 'design time' change (see CreateSubControlDesign
) we should remove this keybinding (Space)
Some consoles are very restrictive about what key strikes are allowed. Some (Raspain Lite I'm looking at you) don't even report function keys (F2 etc).
Having a shortcut on the main page to wizard the user through all the keybindings the first time would be nice.
Maybe we should also store keybindings in User Settings / Home as alternative to the current directory
Found this issue but was not able to reproduce how it occurs.
Tool produces the following (see below). Problem is this.label2.Border
is null when trying to load/use the class the code is produced for.
this.label2 = new Terminal.Gui.Label();
this.label2.Width = 4;
this.label2.Height = 1;
this.label2.X = 17;
this.label2.Y = 7;
this.label2.Data = "label2";
this.label2.Text = "Heya";
this.label2.Border.BorderStyle = Terminal.Gui.BorderStyle.Double;
this.label2.Border.BorderBrush = Terminal.Gui.Color.Black;
this.label2.Border.Effect3D = false;
this.label2.TextAlignment = Terminal.Gui.TextAlignment.Left;
this.Add(this.label2);
Multi delete is a composite command which prevents itself from running if an IsImpossible
Being a PosRelative target for another View prevents deleting (to prevent Exception from an orphaned reference). Normally you have to delete the PosRelative (dependant) first then you can delete the target.
However if you are multi deleting both at the same time it should be allowed.
Or we could just make Delete convert PosRelative to absolute on all Views pointing at the deleted View. This would have to support Undo
It is currently possible to name 2 objects with the same name (Name)
. This should be detected at edit time, also we should validate the fieldname against leading numbers, spaces etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.