Miguel de Icaza 6 years ago
parent
commit
bc19c74c60
2 changed files with 28 additions and 4 deletions
  1. 4 1
      Example/demo.cs
  2. 24 3
      docfx/articles/overview.md

+ 4 - 1
Example/demo.cs

@@ -257,7 +257,9 @@ static class Demo {
 	{
 	{
 		//Application.UseSystemConsole = true;
 		//Application.UseSystemConsole = true;
 		Application.Init ();
 		Application.Init ();
+		
 		var top = Application.Top;
 		var top = Application.Top;
+		
 		var tframe = top.Frame;
 		var tframe = top.Frame;
 		//Open ();
 		//Open ();
 #if true
 #if true
@@ -294,10 +296,11 @@ static class Demo {
 
 
 			ml.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count++}";
 			ml.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count++}";
 		};
 		};
+		
 		var test = new Label (3, 18, "Se iniciará el análisis");
 		var test = new Label (3, 18, "Se iniciará el análisis");
 		win.Add (test);
 		win.Add (test);
 		win.Add (ml);
 		win.Add (ml);
-
+		
 		// ShowTextAlignments (win);
 		// ShowTextAlignments (win);
 		top.Add (win);
 		top.Add (win);
 		top.Add (menu);
 		top.Add (menu);

+ 24 - 3
docfx/articles/overview.md

@@ -386,14 +386,26 @@ to background views when a modal view is running.
 
 
 More details are available on the [`Keyboard Event Processing`](keyboard.html) document.
 More details are available on the [`Keyboard Event Processing`](keyboard.html) document.
 
 
-Color Schemes
-=============
+Colors and Color Schemes
+========================
 
 
 All views have been configured with a color scheme that will work both in color
 All views have been configured with a color scheme that will work both in color
 terminals as well as the more limited black and white terminals.   
 terminals as well as the more limited black and white terminals.   
 
 
 The various styles are captured in the [`Colors`](../api/Terminal.Gui/Terminal.Gui.Colors.html) class which defined color schemes for
 The various styles are captured in the [`Colors`](../api/Terminal.Gui/Terminal.Gui.Colors.html) class which defined color schemes for
-the normal views, the menu bar, popup dialog boxes and error dialog boxes.
+the normal views, the menu bar, popup dialog boxes and error dialog boxes, that you can use like this:
+
+* `Colors.Base`
+* `Colors.Menu`
+* `Colors.Dialog`
+* `Colors.Error`
+
+You can use them for example like this to set the colors for a new Window:
+
+```
+var w = new Window ("Hello");
+w.ColorScheme = Colors.Error
+```
 
 
 The [`ColorScheme`](../api/Terminal.Gui/Terminal.Gui.ColorScheme.html) represents
 The [`ColorScheme`](../api/Terminal.Gui/Terminal.Gui.ColorScheme.html) represents
 four values, the color used for Normal text, the color used for normal text when
 four values, the color used for Normal text, the color used for normal text when
@@ -402,6 +414,15 @@ a view is focused an the colors for the hot-keys both in focused and unfocused m
 By using `ColorSchemes` you ensure that your application will work correctbly both
 By using `ColorSchemes` you ensure that your application will work correctbly both
 in color and black and white terminals.
 in color and black and white terminals.
 
 
+Some views support setting individual color attributes, you create an
+attribute for a particular pair of Foreground/Background like this:
+
+```
+var myColor = Application.Driver.MakeAttribute (Color.Blue, Color.Red);
+var label = new Label (...);
+label.TextColor = myColor
+```
+
 MainLoop, Threads and Input Handling
 MainLoop, Threads and Input Handling
 ====================================
 ====================================