annotate gtk-gui/generated.cs @ 40:0bd9c85d3c5d

Re #86: Complete initial GTK# UI * Add sln to make solution loading easier * Commit rebuild UI files
author IBBoard <dev@ibboard.co.uk>
date Sat, 07 Aug 2010 19:56:05 +0000
parents 58961ff391d4
children 68804784bf6f
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
9 static internal void Initialize(Gtk.Widget iconRenderer)
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
28 else
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
29 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
30 int sz;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
31 int sy;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
32 global::Gtk.Icon.SizeLookup(size, out sz, out sy);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
33 try
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
34 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
35 return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
36 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
37 catch (System.Exception)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
38 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
39 if ((name != "gtk-missing-image"))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
40 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
41 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
42 }
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 else
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
45 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
46 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
47 Gdk.GC gc = new Gdk.GC(pmap);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
48 gc.RgbFgColor = new Gdk.Color(255, 255, 255);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
49 pmap.DrawRectangle(gc, true, 0, 0, sz, sz);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
50 gc.RgbFgColor = new Gdk.Color(0, 0, 0);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
51 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
52 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
53 gc.RgbFgColor = new Gdk.Color(255, 0, 0);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
54 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
55 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
56 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
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 }
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 internal class BinContainer
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
64 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
65 private Gtk.Widget child;
0
1bb28f84d567 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66
40
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
67 private Gtk.UIManager uimanager;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
68
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
69 public static BinContainer Attach(Gtk.Bin bin)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
70 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
71 BinContainer bc = new BinContainer();
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
72 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
73 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
74 bin.Added += new Gtk.AddedHandler(bc.OnAdded);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
75 return bc;
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
78 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
79 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
80 if ((this.child != null))
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 args.Requisition = this.child.SizeRequest();
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
83 }
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
86 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
87 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
88 if ((this.child != null))
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 this.child.Allocation = args.Allocation;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
91 }
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
94 private void OnAdded(object sender, Gtk.AddedArgs args)
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 this.child = args.Widget;
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
99 public void SetUiManager(Gtk.UIManager uim)
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 this.uimanager = uim;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
102 this.child.Realized += new System.EventHandler(this.OnRealized);
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
105 private void OnRealized(object sender, System.EventArgs args)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
106 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
107 if ((this.uimanager != null))
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
108 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
109 Gtk.Widget w;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
110 w = this.child.Toplevel;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
111 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w)))
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 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
114 this.uimanager = null;
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 }
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
120 internal class ActionGroups
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
121 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
122 public static Gtk.ActionGroup GetActionGroup(System.Type type)
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 return Stetic.ActionGroups.GetActionGroup(type.FullName);
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
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
127 public static Gtk.ActionGroup GetActionGroup(string name)
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
128 {
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
129 return null;
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
130 }
0bd9c85d3c5d Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
131 }
0
1bb28f84d567 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132 }