Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.GTK
comparison 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 |
comparison
equal
deleted
inserted
replaced
39:146b7a893a01 | 40:0bd9c85d3c5d |
---|---|
1 // ------------------------------------------------------------------------------ | |
2 // <autogenerated> | |
3 // This code was generated by a tool. | |
4 // | |
5 // | |
6 // Changes to this file may cause incorrect behavior and will be lost if | |
7 // the code is regenerated. | |
8 // </autogenerated> | |
9 // ------------------------------------------------------------------------------ | |
10 | 1 |
11 namespace Stetic { | 2 // This file has been generated by the GUI designer. Do not modify. |
12 | 3 namespace Stetic |
13 | 4 { |
14 internal class Gui { | 5 internal class Gui |
15 | 6 { |
16 private static bool initialized; | 7 private static bool initialized; |
17 | 8 |
18 internal static void Initialize(Gtk.Widget iconRenderer) { | 9 static internal void Initialize(Gtk.Widget iconRenderer) |
19 if ((Stetic.Gui.initialized == false)) { | 10 { |
20 Stetic.Gui.initialized = true; | 11 if ((Stetic.Gui.initialized == false)) |
21 } | 12 { |
22 } | 13 Stetic.Gui.initialized = true; |
23 } | 14 } |
24 | 15 } |
25 internal class IconLoader { | 16 } |
26 | 17 |
27 public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) { | 18 internal class IconLoader |
28 Gdk.Pixbuf res = widget.RenderIcon(name, size, null); | 19 { |
29 if ((res != null)) { | 20 public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size) |
30 return res; | 21 { |
31 } | 22 Gdk.Pixbuf res = widget.RenderIcon(name, size, null); |
32 else { | 23 if ((res != null)) |
33 try { | 24 { |
34 return Gtk.IconTheme.Default.LoadIcon(name, sz, 0); | 25 return res; |
35 } | 26 } |
36 catch (System.Exception ) { | 27 |
37 if ((name != "gtk-missing-image")) { | 28 else |
38 return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz); | 29 { |
39 } | 30 int sz; |
40 else { | 31 int sy; |
41 Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz); | 32 global::Gtk.Icon.SizeLookup(size, out sz, out sy); |
42 Gdk.GC gc = new Gdk.GC(pmap); | 33 try |
43 gc.RgbFgColor = new Gdk.Color(255, 255, 255); | 34 { |
44 pmap.DrawRectangle(gc, true, 0, 0, sz, sz); | 35 return Gtk.IconTheme.Default.LoadIcon(name, sz, 0); |
45 gc.RgbFgColor = new Gdk.Color(0, 0, 0); | 36 } |
46 pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1)); | 37 catch (System.Exception) |
47 gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); | 38 { |
48 gc.RgbFgColor = new Gdk.Color(255, 0, 0); | 39 if ((name != "gtk-missing-image")) |
49 pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); | 40 { |
50 pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); | 41 return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size); |
51 return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); | 42 } |
52 } | 43 |
53 } | 44 else |
54 } | 45 { |
55 } | 46 Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz); |
56 } | 47 Gdk.GC gc = new Gdk.GC(pmap); |
57 | 48 gc.RgbFgColor = new Gdk.Color(255, 255, 255); |
58 internal class BinContainer { | 49 pmap.DrawRectangle(gc, true, 0, 0, sz, sz); |
59 | 50 gc.RgbFgColor = new Gdk.Color(0, 0, 0); |
60 private Gtk.Widget child; | 51 pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1)); |
61 | 52 gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); |
62 private Gtk.UIManager uimanager; | 53 gc.RgbFgColor = new Gdk.Color(255, 0, 0); |
63 | 54 pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4))); |
64 public static BinContainer Attach(Gtk.Bin bin) { | 55 pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4))); |
65 BinContainer bc = new BinContainer(); | 56 return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); |
66 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); | 57 } |
67 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); | 58 } |
68 bin.Added += new Gtk.AddedHandler(bc.OnAdded); | 59 } |
69 return bc; | 60 } |
70 } | 61 } |
71 | 62 |
72 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) { | 63 internal class BinContainer |
73 if ((this.child != null)) { | 64 { |
74 args.Requisition = this.child.SizeRequest(); | 65 private Gtk.Widget child; |
75 } | 66 |
76 } | 67 private Gtk.UIManager uimanager; |
77 | 68 |
78 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) { | 69 public static BinContainer Attach(Gtk.Bin bin) |
79 if ((this.child != null)) { | 70 { |
80 this.child.Allocation = args.Allocation; | 71 BinContainer bc = new BinContainer(); |
81 } | 72 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); |
82 } | 73 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); |
83 | 74 bin.Added += new Gtk.AddedHandler(bc.OnAdded); |
84 private void OnAdded(object sender, Gtk.AddedArgs args) { | 75 return bc; |
85 this.child = args.Widget; | 76 } |
86 } | 77 |
87 | 78 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) |
88 public void SetUiManager(Gtk.UIManager uim) { | 79 { |
89 this.uimanager = uim; | 80 if ((this.child != null)) |
90 this.child.Realized += new System.EventHandler(this.OnRealized); | 81 { |
91 } | 82 args.Requisition = this.child.SizeRequest(); |
92 | 83 } |
93 private void OnRealized(object sender, System.EventArgs args) { | 84 } |
94 if ((this.uimanager != null)) { | 85 |
95 Gtk.Widget w; | 86 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) |
96 w = this.child.Toplevel; | 87 { |
97 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) { | 88 if ((this.child != null)) |
98 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup); | 89 { |
99 this.uimanager = null; | 90 this.child.Allocation = args.Allocation; |
100 } | 91 } |
101 } | 92 } |
102 } | 93 |
103 } | 94 private void OnAdded(object sender, Gtk.AddedArgs args) |
104 | 95 { |
105 internal class ActionGroups { | 96 this.child = args.Widget; |
106 | 97 } |
107 public static Gtk.ActionGroup GetActionGroup(System.Type type) { | 98 |
108 return Stetic.ActionGroups.GetActionGroup(type.FullName); | 99 public void SetUiManager(Gtk.UIManager uim) |
109 } | 100 { |
110 | 101 this.uimanager = uim; |
111 public static Gtk.ActionGroup GetActionGroup(string name) { | 102 this.child.Realized += new System.EventHandler(this.OnRealized); |
112 return null; | 103 } |
113 } | 104 |
114 } | 105 private void OnRealized(object sender, System.EventArgs args) |
106 { | |
107 if ((this.uimanager != null)) | |
108 { | |
109 Gtk.Widget w; | |
110 w = this.child.Toplevel; | |
111 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) | |
112 { | |
113 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup); | |
114 this.uimanager = null; | |
115 } | |
116 } | |
117 } | |
118 } | |
119 | |
120 internal class ActionGroups | |
121 { | |
122 public static Gtk.ActionGroup GetActionGroup(System.Type type) | |
123 { | |
124 return Stetic.ActionGroups.GetActionGroup(type.FullName); | |
125 } | |
126 | |
127 public static Gtk.ActionGroup GetActionGroup(string name) | |
128 { | |
129 return null; | |
130 } | |
131 } | |
115 } | 132 } |