changeset 39:35b88b848524

* Add simple dialog to add basic widgets to for use in WarFoundry
author IBBoard <dev@ibboard.co.uk>
date Tue, 18 Oct 2011 20:58:49 +0100
parents af65343516ba
children 7c15adc333ea
files IBBoard.GtkSharp.csproj SimpleDialog.cs gtk-gui/IBBoard.GtkSharp.SimpleDialog.cs gtk-gui/generated.cs gtk-gui/gui.stetic
diffstat 5 files changed, 191 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/IBBoard.GtkSharp.csproj	Sat Oct 08 20:29:21 2011 +0100
     1.2 +++ b/IBBoard.GtkSharp.csproj	Tue Oct 18 20:58:49 2011 +0100
     1.3 @@ -43,6 +43,9 @@
     1.4      <Compile Include="Translatable\TranslatableButton.cs" />
     1.5      <Compile Include="GtkSharp.cs" />
     1.6      <Compile Include="Translatable\TranslatableCheckButton.cs" />
     1.7 +    <Compile Include="gtk-gui\generated.cs" />
     1.8 +    <Compile Include="SimpleDialog.cs" />
     1.9 +    <Compile Include="gtk-gui\IBBoard.GtkSharp.SimpleDialog.cs" />
    1.10    </ItemGroup>
    1.11    <ItemGroup>
    1.12      <None Include="COPYING.GPL" />
    1.13 @@ -53,6 +56,7 @@
    1.14      <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    1.15      <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    1.16      <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    1.17 +    <Reference Include="Mono.Posix" />
    1.18    </ItemGroup>
    1.19    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    1.20    <ItemGroup>
    1.21 @@ -75,4 +79,9 @@
    1.22        </Properties>
    1.23      </MonoDevelop>
    1.24    </ProjectExtensions>
    1.25 +  <ItemGroup>
    1.26 +    <EmbeddedResource Include="gtk-gui\gui.stetic">
    1.27 +      <LogicalName>gui.stetic</LogicalName>
    1.28 +    </EmbeddedResource>
    1.29 +  </ItemGroup>
    1.30  </Project>
    1.31 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/SimpleDialog.cs	Tue Oct 18 20:58:49 2011 +0100
     2.3 @@ -0,0 +1,27 @@
     2.4 +//  This file (SimpleDialog.cs) is a part of the IBBoard.GtkSharp project and is copyright 2011 IBBoard
     2.5 +// 
     2.6 +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     2.7 +using System;
     2.8 +using Gtk;
     2.9 +
    2.10 +namespace IBBoard.GtkSharp
    2.11 +{
    2.12 +	/// <summary>
    2.13 +	/// Simple dialog that takes a set of widgets and puts them in the dialog's VBox. The dialog is a convenience
    2.14 +	/// for doing the steps manually for each dialog required.
    2.15 +	/// </summary>
    2.16 +	public partial class SimpleDialog : Dialog
    2.17 +	{
    2.18 +		public SimpleDialog(string title, Window parent, DialogFlags flags, params Bin[] widgets) : base(title, parent, flags)
    2.19 +		{
    2.20 +			this.AddButton("Ok", ResponseType.Ok);
    2.21 +			this.Build();
    2.22 +			foreach (Bin item in widgets)
    2.23 +			{
    2.24 +				VBox.PackEnd(item);
    2.25 +				item.Show();
    2.26 +			}
    2.27 +		}
    2.28 +	}
    2.29 +}
    2.30 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/gtk-gui/IBBoard.GtkSharp.SimpleDialog.cs	Tue Oct 18 20:58:49 2011 +0100
     3.3 @@ -0,0 +1,59 @@
     3.4 +
     3.5 +// This file has been generated by the GUI designer. Do not modify.
     3.6 +namespace IBBoard.GtkSharp
     3.7 +{
     3.8 +	public partial class SimpleDialog
     3.9 +	{
    3.10 +		private global::Gtk.Button buttonCancel;
    3.11 +		private global::Gtk.Button buttonOk;
    3.12 +		
    3.13 +		protected virtual void Build ()
    3.14 +		{
    3.15 +			global::Stetic.Gui.Initialize (this);
    3.16 +			// Widget IBBoard.GtkSharp.SimpleDialog
    3.17 +			this.Name = "IBBoard.GtkSharp.SimpleDialog";
    3.18 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
    3.19 +			// Internal child IBBoard.GtkSharp.SimpleDialog.VBox
    3.20 +			global::Gtk.VBox w1 = this.VBox;
    3.21 +			w1.Name = "dialog1_VBox";
    3.22 +			w1.BorderWidth = ((uint)(2));
    3.23 +			// Internal child IBBoard.GtkSharp.SimpleDialog.ActionArea
    3.24 +			global::Gtk.HButtonBox w2 = this.ActionArea;
    3.25 +			w2.Name = "dialog1_ActionArea";
    3.26 +			w2.Spacing = 10;
    3.27 +			w2.BorderWidth = ((uint)(5));
    3.28 +			w2.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
    3.29 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
    3.30 +			this.buttonCancel = new global::Gtk.Button ();
    3.31 +			this.buttonCancel.CanDefault = true;
    3.32 +			this.buttonCancel.CanFocus = true;
    3.33 +			this.buttonCancel.Name = "buttonCancel";
    3.34 +			this.buttonCancel.UseStock = true;
    3.35 +			this.buttonCancel.UseUnderline = true;
    3.36 +			this.buttonCancel.Label = "gtk-cancel";
    3.37 +			this.AddActionWidget (this.buttonCancel, -6);
    3.38 +			global::Gtk.ButtonBox.ButtonBoxChild w3 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2 [this.buttonCancel]));
    3.39 +			w3.Expand = false;
    3.40 +			w3.Fill = false;
    3.41 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
    3.42 +			this.buttonOk = new global::Gtk.Button ();
    3.43 +			this.buttonOk.CanDefault = true;
    3.44 +			this.buttonOk.CanFocus = true;
    3.45 +			this.buttonOk.Name = "buttonOk";
    3.46 +			this.buttonOk.UseStock = true;
    3.47 +			this.buttonOk.UseUnderline = true;
    3.48 +			this.buttonOk.Label = "gtk-ok";
    3.49 +			this.AddActionWidget (this.buttonOk, -5);
    3.50 +			global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2 [this.buttonOk]));
    3.51 +			w4.Position = 1;
    3.52 +			w4.Expand = false;
    3.53 +			w4.Fill = false;
    3.54 +			if ((this.Child != null)) {
    3.55 +				this.Child.ShowAll ();
    3.56 +			}
    3.57 +			this.DefaultWidth = 303;
    3.58 +			this.DefaultHeight = 199;
    3.59 +			this.Show ();
    3.60 +		}
    3.61 +	}
    3.62 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/gtk-gui/generated.cs	Tue Oct 18 20:58:49 2011 +0100
     4.3 @@ -0,0 +1,29 @@
     4.4 +
     4.5 +// This file has been generated by the GUI designer. Do not modify.
     4.6 +namespace Stetic
     4.7 +{
     4.8 +	internal class Gui
     4.9 +	{
    4.10 +		private static bool initialized;
    4.11 +		
    4.12 +		internal static void Initialize (Gtk.Widget iconRenderer)
    4.13 +		{
    4.14 +			if ((Stetic.Gui.initialized == false)) {
    4.15 +				Stetic.Gui.initialized = true;
    4.16 +			}
    4.17 +		}
    4.18 +	}
    4.19 +	
    4.20 +	internal class ActionGroups
    4.21 +	{
    4.22 +		public static Gtk.ActionGroup GetActionGroup (System.Type type)
    4.23 +		{
    4.24 +			return Stetic.ActionGroups.GetActionGroup (type.FullName);
    4.25 +		}
    4.26 +		
    4.27 +		public static Gtk.ActionGroup GetActionGroup (string name)
    4.28 +		{
    4.29 +			return null;
    4.30 +		}
    4.31 +	}
    4.32 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/gtk-gui/gui.stetic	Tue Oct 18 20:58:49 2011 +0100
     5.3 @@ -0,0 +1,67 @@
     5.4 +<?xml version="1.0" encoding="utf-8"?>
     5.5 +<stetic-interface>
     5.6 +  <configuration>
     5.7 +    <images-root-path>..</images-root-path>
     5.8 +    <target-gtk-version>2.12</target-gtk-version>
     5.9 +  </configuration>
    5.10 +  <import>
    5.11 +    <widget-library name="../bin/Debug/IBBoard.GtkSharp.dll" internal="true" />
    5.12 +  </import>
    5.13 +  <widget class="Gtk.Dialog" id="IBBoard.GtkSharp.SimpleDialog" design-size="303 199">
    5.14 +    <property name="MemberName" />
    5.15 +    <property name="WindowPosition">CenterOnParent</property>
    5.16 +    <property name="Buttons">2</property>
    5.17 +    <property name="HelpButton">False</property>
    5.18 +    <child internal-child="VBox">
    5.19 +      <widget class="Gtk.VBox" id="dialog1_VBox">
    5.20 +        <property name="MemberName" />
    5.21 +        <property name="BorderWidth">2</property>
    5.22 +        <child>
    5.23 +          <placeholder />
    5.24 +        </child>
    5.25 +      </widget>
    5.26 +    </child>
    5.27 +    <child internal-child="ActionArea">
    5.28 +      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
    5.29 +        <property name="MemberName" />
    5.30 +        <property name="Spacing">10</property>
    5.31 +        <property name="BorderWidth">5</property>
    5.32 +        <property name="Size">2</property>
    5.33 +        <property name="LayoutStyle">End</property>
    5.34 +        <child>
    5.35 +          <widget class="Gtk.Button" id="buttonCancel">
    5.36 +            <property name="MemberName" />
    5.37 +            <property name="CanDefault">True</property>
    5.38 +            <property name="CanFocus">True</property>
    5.39 +            <property name="UseStock">True</property>
    5.40 +            <property name="Type">StockItem</property>
    5.41 +            <property name="StockId">gtk-cancel</property>
    5.42 +            <property name="ResponseId">-6</property>
    5.43 +            <property name="label">gtk-cancel</property>
    5.44 +          </widget>
    5.45 +          <packing>
    5.46 +            <property name="Expand">False</property>
    5.47 +            <property name="Fill">False</property>
    5.48 +          </packing>
    5.49 +        </child>
    5.50 +        <child>
    5.51 +          <widget class="Gtk.Button" id="buttonOk">
    5.52 +            <property name="MemberName" />
    5.53 +            <property name="CanDefault">True</property>
    5.54 +            <property name="CanFocus">True</property>
    5.55 +            <property name="UseStock">True</property>
    5.56 +            <property name="Type">StockItem</property>
    5.57 +            <property name="StockId">gtk-ok</property>
    5.58 +            <property name="ResponseId">-5</property>
    5.59 +            <property name="label">gtk-ok</property>
    5.60 +          </widget>
    5.61 +          <packing>
    5.62 +            <property name="Position">1</property>
    5.63 +            <property name="Expand">False</property>
    5.64 +            <property name="Fill">False</property>
    5.65 +          </packing>
    5.66 +        </child>
    5.67 +      </widget>
    5.68 +    </child>
    5.69 +  </widget>
    5.70 +</stetic-interface>
    5.71 \ No newline at end of file