Permalink
Browse files

Menus work

svn path=/trunk/mono-curses/; revision=144314
  • Loading branch information...
1 parent f80ea38 commit 2f2980c72e135a7abc497615eb667347a72b1c3a @migueldeicaza migueldeicaza committed Oct 18, 2009
Showing with 228 additions and 33 deletions.
  1. +6 −0 binding.cs.in
  2. +8 −2 docs/Mono.Terminal/Application.xml
  3. +1 −1 docs/Mono.Terminal/Curses.xml
  4. +3 −11 docs/Mono.Terminal/MenuBar.xml
  5. +11 −1 docs/Mono.Terminal/Widget.xml
  6. +3 −1 docs/index.xml
  7. +196 −17 gui.cs
View
@@ -203,6 +203,12 @@ namespace Mono.Terminal {
[DllImport ("@CURSES@")]
extern public static int addstr (string s);
+ public static int addstr (string format, params object [] args)
+ {
+ var s = string.Format (format, args);
+ return addstr (s);
+ }
+
[DllImport ("@CURSES@")]
extern internal static int wmove (IntPtr win, int line, int col);
@@ -169,8 +169,14 @@
<AssemblyVersion>0.0.0.0</AssemblyVersion><AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
- </Member><Member MemberName="ColorMenuSelected"><MemberSignature Language="C#" Value="public static int ColorMenuSelected;" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Docs><summary>
- The basic color of the terminal.
+ </Member><Member MemberName="ColorMenu"><MemberSignature Language="C#" Value="public static int ColorMenu;" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Docs><summary>
+ The regular color for a menu entry
+ </summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="ColorMenuHot"><MemberSignature Language="C#" Value="public static int ColorMenuHot;" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Docs><summary>
+ The hot color for a menu entry
+ </summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="ColorMenuHotSelected"><MemberSignature Language="C#" Value="public static int ColorMenuHotSelected;" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Docs><summary>
+ The hot color for a selected item on a menu
+ </summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="ColorMenuSelected"><MemberSignature Language="C#" Value="public static int ColorMenuSelected;" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Docs><summary>
+ The regular color for a selected item on a menu
</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="ColorNormal">
<MemberSignature Language="C#" Value="public static int ColorNormal;" />
<MemberType>Field</MemberType>
@@ -260,7 +260,7 @@
<AssemblyVersion>0.0.0.0</AssemblyVersion><AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
- </Member><Member MemberName="attroff">
+ </Member><Member MemberName="addstr"><MemberSignature Language="C#" Value="public static int addstr (string format, object[] args);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Parameters><Parameter Name="format" Type="System.String" /><Parameter Name="args" Type="System.Object[]"><Attributes><Attribute><AttributeName>System.ParamArray</AttributeName></Attribute></Attributes></Parameter></Parameters><Docs><param name="format">To be added.</param><param name="args">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member><Member MemberName="attroff">
<MemberSignature Language="C#" Value="public static int attroff (int attrs);" />
<MemberType>Method</MemberType>
<ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue>
@@ -14,23 +14,15 @@
</Docs>
<Members>
- <Member MemberName=".ctor">
- <MemberSignature Language="C#" Value="public MenuBar (Mono.Terminal.Menu[] menus);" />
- <MemberType>Constructor</MemberType>
- <AssemblyInfo>
- <AssemblyVersion>1.0.0.0</AssemblyVersion>
- </AssemblyInfo>
- <Parameters><Parameter Name="menus" Type="Mono.Terminal.Menu[]" /></Parameters>
- <Docs><param name="menus">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
- </Member><Member MemberName="Activate"><MemberSignature Language="C#" Value="public void Activate (int idx);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="idx" Type="System.Int32" /></Parameters><Docs><param name="idx">To be added.</param><summary>
+ <Member MemberName=".ctor"><MemberSignature Language="C#" Value="public MenuBar (Mono.Terminal.MenuBarItem[] menus);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="menus" Type="Mono.Terminal.MenuBarItem[]" /></Parameters><Docs><param name="menus">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Activate"><MemberSignature Language="C#" Value="public void Activate (int idx);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="idx" Type="System.Int32" /></Parameters><Docs><param name="idx">To be added.</param><summary>
Activates the menubar
</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Menus">
- <MemberSignature Language="C#" Value="public Mono.Terminal.Menu[] Menus { set; get; }" />
+ <MemberSignature Language="C#" Value="public Mono.Terminal.MenuBarItem[] Menus { set; get; }" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
- <ReturnValue><ReturnType>Mono.Terminal.Menu[]</ReturnType></ReturnValue>
+ <ReturnValue><ReturnType>Mono.Terminal.MenuBarItem[]</ReturnType></ReturnValue>
<Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs>
</Member>
</Members>
@@ -194,7 +194,17 @@
<AssemblyVersion>0.0.0.0</AssemblyVersion><AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
- </Member><Member MemberName="Fill">
+ </Member><Member MemberName="DrawFrame"><MemberSignature Language="C#" Value="public static void DrawFrame (int col, int line, int width, int height, bool fill);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="col" Type="System.Int32" /><Parameter Name="line" Type="System.Int32" /><Parameter Name="width" Type="System.Int32" /><Parameter Name="height" Type="System.Int32" /><Parameter Name="fill" Type="System.Boolean" /></Parameters><Docs><param name="col">To be added.</param><param name="line">To be added.</param><param name="width">To be added.</param><param name="height">To be added.</param><param name="fill">To be added.</param><summary>
+ Utility function to draw frames
+ </summary><remarks>
+ Draws a frame with the current color in the
+ specified coordinates.
+ </remarks></Docs></Member><Member MemberName="DrawHotString"><MemberSignature Language="C#" Value="public static void DrawHotString (string s, int hotcolor, int color);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="s" Type="System.String" /><Parameter Name="hotcolor" Type="System.Int32" /><Parameter Name="color" Type="System.Int32" /></Parameters><Docs><param name="s">To be added.</param><param name="hotcolor">To be added.</param><param name="color">To be added.</param><summary>
+ Utility function to draw strings that contain a hotkey
+ </summary><remarks>
+ Draws a string with the given color. If a character "_" is
+ found, then the next character is drawn using the hotcolor.
+ </remarks></Docs></Member><Member MemberName="Fill">
<MemberSignature Language="C#" Value="public Mono.Terminal.Fill Fill;" />
<MemberType>Field</MemberType>
<ReturnValue><ReturnType>Mono.Terminal.Fill</ReturnType></ReturnValue>
View
@@ -27,6 +27,7 @@
<Copyright>To be added.</Copyright>
<Types>
<Namespace Name="Mono.Terminal">
+ <Type Name="Action" />
<Type Name="Application" Kind="Class" />
<Type Name="Button" Kind="Class" />
<Type Name="CheckBox" Kind="Class" />
@@ -41,8 +42,9 @@
<Type Name="IListProvider" Kind="Interface" />
<Type Name="Label" Kind="Class" />
<Type Name="ListView" Kind="Class" />
- <Type Name="Menu" />
<Type Name="MenuBar" />
+ <Type Name="MenuBarItem" />
+ <Type Name="MenuItem" />
<Type Name="Screen" Kind="Class" />
<Type Name="TrimLabel" Kind="Class" />
<Type Name="Widget" Kind="Class" />
Oops, something went wrong.

0 comments on commit 2f2980c

Please sign in to comment.