annotate gtk-gui/generated.cs @ 126:d4e6bfeb1c61

Re #361: Add XML export UI to GTK# * Separate out the "transform" section so we can add it as an ExtraWidget on the file chooser
author IBBoard <dev@ibboard.co.uk>
date Sat, 01 Oct 2011 16:19:48 +0100
parents 68804784bf6f
children 135491fd1830
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
1
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
2 // This file has been generated by the GUI designer. Do not modify.
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
3 namespace Stetic
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
4 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
5 internal class Gui
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
6 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
7 private static bool initialized;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
8
77
68804784bf6f Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 40
diff changeset
9 internal static void Initialize(Gtk.Widget iconRenderer)
40
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
10 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
11 if ((Stetic.Gui.initialized == false))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
12 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
13 Stetic.Gui.initialized = true;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
14 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
15 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
16 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
17
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
18 internal class IconLoader
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
19 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
20 public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
21 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
22 Gdk.Pixbuf res = widget.RenderIcon(name, size, null);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
23 if ((res != null))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
24 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
25 return res;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
26 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
27 else
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
28 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
29 int sz;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
30 int sy;
77
68804784bf6f Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 40
diff changeset
31 global::Gtk.Icon.SizeLookup(size, out sz, out sy);
40
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
32 try
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
33 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
34 return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
35 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
36 catch (System.Exception)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
37 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
38 if ((name != "gtk-missing-image"))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
39 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
40 return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
41 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
42 else
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
43 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
44 Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
45 Gdk.GC gc = new Gdk.GC(pmap);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
46 gc.RgbFgColor = new Gdk.Color(255, 255, 255);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
47 pmap.DrawRectangle(gc, true, 0, 0, sz, sz);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
48 gc.RgbFgColor = new Gdk.Color(0, 0, 0);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
49 pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1));
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
50 gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
51 gc.RgbFgColor = new Gdk.Color(255, 0, 0);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
52 pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
53 pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
54 return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
55 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
56 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
57 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
58 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
59 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
60
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
61 internal class BinContainer
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
62 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
63 private Gtk.Widget child;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
64 private Gtk.UIManager uimanager;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
65
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
66 public static BinContainer Attach(Gtk.Bin bin)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
67 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
68 BinContainer bc = new BinContainer();
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
69 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
70 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
71 bin.Added += new Gtk.AddedHandler(bc.OnAdded);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
72 return bc;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
73 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
74
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
75 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
76 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
77 if ((this.child != null))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
78 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
79 args.Requisition = this.child.SizeRequest();
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
80 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
81 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
82
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
83 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
84 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
85 if ((this.child != null))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
86 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
87 this.child.Allocation = args.Allocation;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
88 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
89 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
90
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
91 private void OnAdded(object sender, Gtk.AddedArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
92 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
93 this.child = args.Widget;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
94 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
95
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
96 public void SetUiManager(Gtk.UIManager uim)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
97 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
98 this.uimanager = uim;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
99 this.child.Realized += new System.EventHandler(this.OnRealized);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
100 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
101
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
102 private void OnRealized(object sender, System.EventArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
103 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
104 if ((this.uimanager != null))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
105 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
106 Gtk.Widget w;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
107 w = this.child.Toplevel;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
108 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w)))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
109 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
110 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
111 this.uimanager = null;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
112 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
113 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
114 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
115 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
116
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
117 internal class ActionGroups
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
118 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
119 public static Gtk.ActionGroup GetActionGroup(System.Type type)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
120 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
121 return Stetic.ActionGroups.GetActionGroup(type.FullName);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
122 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
123
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
124 public static Gtk.ActionGroup GetActionGroup(string name)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
125 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
126 return null;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
127 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
128 }
0
1bb28f84d567 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 }