Mercurial > repos > IBBoard.GtkSharp
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 wrap: on
line diff
--- a/IBBoard.GtkSharp.csproj Sat Oct 08 20:29:21 2011 +0100 +++ b/IBBoard.GtkSharp.csproj Tue Oct 18 20:58:49 2011 +0100 @@ -43,6 +43,9 @@ <Compile Include="Translatable\TranslatableButton.cs" /> <Compile Include="GtkSharp.cs" /> <Compile Include="Translatable\TranslatableCheckButton.cs" /> + <Compile Include="gtk-gui\generated.cs" /> + <Compile Include="SimpleDialog.cs" /> + <Compile Include="gtk-gui\IBBoard.GtkSharp.SimpleDialog.cs" /> </ItemGroup> <ItemGroup> <None Include="COPYING.GPL" /> @@ -53,6 +56,7 @@ <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> + <Reference Include="Mono.Posix" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ItemGroup> @@ -75,4 +79,9 @@ </Properties> </MonoDevelop> </ProjectExtensions> + <ItemGroup> + <EmbeddedResource Include="gtk-gui\gui.stetic"> + <LogicalName>gui.stetic</LogicalName> + </EmbeddedResource> + </ItemGroup> </Project> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimpleDialog.cs Tue Oct 18 20:58:49 2011 +0100 @@ -0,0 +1,27 @@ +// This file (SimpleDialog.cs) is a part of the IBBoard.GtkSharp project and is copyright 2011 IBBoard +// +// 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. +using System; +using Gtk; + +namespace IBBoard.GtkSharp +{ + /// <summary> + /// Simple dialog that takes a set of widgets and puts them in the dialog's VBox. The dialog is a convenience + /// for doing the steps manually for each dialog required. + /// </summary> + public partial class SimpleDialog : Dialog + { + public SimpleDialog(string title, Window parent, DialogFlags flags, params Bin[] widgets) : base(title, parent, flags) + { + this.AddButton("Ok", ResponseType.Ok); + this.Build(); + foreach (Bin item in widgets) + { + VBox.PackEnd(item); + item.Show(); + } + } + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-gui/IBBoard.GtkSharp.SimpleDialog.cs Tue Oct 18 20:58:49 2011 +0100 @@ -0,0 +1,59 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace IBBoard.GtkSharp +{ + public partial class SimpleDialog + { + private global::Gtk.Button buttonCancel; + private global::Gtk.Button buttonOk; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget IBBoard.GtkSharp.SimpleDialog + this.Name = "IBBoard.GtkSharp.SimpleDialog"; + this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + // Internal child IBBoard.GtkSharp.SimpleDialog.VBox + global::Gtk.VBox w1 = this.VBox; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); + // Internal child IBBoard.GtkSharp.SimpleDialog.ActionArea + global::Gtk.HButtonBox w2 = this.ActionArea; + w2.Name = "dialog1_ActionArea"; + w2.Spacing = 10; + w2.BorderWidth = ((uint)(5)); + w2.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonCancel = new global::Gtk.Button (); + this.buttonCancel.CanDefault = true; + this.buttonCancel.CanFocus = true; + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.UseStock = true; + this.buttonCancel.UseUnderline = true; + this.buttonCancel.Label = "gtk-cancel"; + this.AddActionWidget (this.buttonCancel, -6); + global::Gtk.ButtonBox.ButtonBoxChild w3 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2 [this.buttonCancel])); + w3.Expand = false; + w3.Fill = false; + // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonOk = new global::Gtk.Button (); + this.buttonOk.CanDefault = true; + this.buttonOk.CanFocus = true; + this.buttonOk.Name = "buttonOk"; + this.buttonOk.UseStock = true; + this.buttonOk.UseUnderline = true; + this.buttonOk.Label = "gtk-ok"; + this.AddActionWidget (this.buttonOk, -5); + global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2 [this.buttonOk])); + w4.Position = 1; + w4.Expand = false; + w4.Fill = false; + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.DefaultWidth = 303; + this.DefaultHeight = 199; + this.Show (); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-gui/generated.cs Tue Oct 18 20:58:49 2011 +0100 @@ -0,0 +1,29 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace Stetic +{ + internal class Gui + { + private static bool initialized; + + internal static void Initialize (Gtk.Widget iconRenderer) + { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + + internal class ActionGroups + { + public static Gtk.ActionGroup GetActionGroup (System.Type type) + { + return Stetic.ActionGroups.GetActionGroup (type.FullName); + } + + public static Gtk.ActionGroup GetActionGroup (string name) + { + return null; + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk-gui/gui.stetic Tue Oct 18 20:58:49 2011 +0100 @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<stetic-interface> + <configuration> + <images-root-path>..</images-root-path> + <target-gtk-version>2.12</target-gtk-version> + </configuration> + <import> + <widget-library name="../bin/Debug/IBBoard.GtkSharp.dll" internal="true" /> + </import> + <widget class="Gtk.Dialog" id="IBBoard.GtkSharp.SimpleDialog" design-size="303 199"> + <property name="MemberName" /> + <property name="WindowPosition">CenterOnParent</property> + <property name="Buttons">2</property> + <property name="HelpButton">False</property> + <child internal-child="VBox"> + <widget class="Gtk.VBox" id="dialog1_VBox"> + <property name="MemberName" /> + <property name="BorderWidth">2</property> + <child> + <placeholder /> + </child> + </widget> + </child> + <child internal-child="ActionArea"> + <widget class="Gtk.HButtonBox" id="dialog1_ActionArea"> + <property name="MemberName" /> + <property name="Spacing">10</property> + <property name="BorderWidth">5</property> + <property name="Size">2</property> + <property name="LayoutStyle">End</property> + <child> + <widget class="Gtk.Button" id="buttonCancel"> + <property name="MemberName" /> + <property name="CanDefault">True</property> + <property name="CanFocus">True</property> + <property name="UseStock">True</property> + <property name="Type">StockItem</property> + <property name="StockId">gtk-cancel</property> + <property name="ResponseId">-6</property> + <property name="label">gtk-cancel</property> + </widget> + <packing> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Button" id="buttonOk"> + <property name="MemberName" /> + <property name="CanDefault">True</property> + <property name="CanFocus">True</property> + <property name="UseStock">True</property> + <property name="Type">StockItem</property> + <property name="StockId">gtk-ok</property> + <property name="ResponseId">-5</property> + <property name="label">gtk-ok</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> +</stetic-interface> \ No newline at end of file