1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = GtkFixed.html 27 * outPack = gtk 28 * outFile = Fixed 29 * strct = GtkFixed 30 * realStrct= 31 * ctorStrct= 32 * clss = Fixed 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_fixed_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.Widget 47 * structWrap: 48 * - GtkWidget* -> Widget 49 * module aliases: 50 * local aliases: 51 * overrides: 52 */ 53 54 module gtk.Fixed; 55 56 public import gtkc.gtktypes; 57 58 private import gtkc.gtk; 59 private import glib.ConstructionException; 60 private import gobject.ObjectG; 61 62 private import gtk.Widget; 63 64 65 private import gtk.Container; 66 67 /** 68 * The GtkFixed widget is a container which can place child widgets 69 * at fixed positions and with fixed sizes, given in pixels. GtkFixed 70 * performs no automatic layout management. 71 * 72 * For most applications, you should not use this container! It keeps 73 * you from having to learn about the other GTK+ containers, but it 74 * results in broken applications. With GtkFixed, the following 75 * things will result in truncated text, overlapping widgets, and 76 * other display bugs: 77 * 78 * Themes, which may change widget sizes. 79 * 80 * Fonts other than the one you used to write the app will of course 81 * change the size of widgets containing text; keep in mind that 82 * users may use a larger font because of difficulty reading the 83 * default, or they may be using Windows or the framebuffer port of 84 * GTK+, where different fonts are available. 85 * 86 * Translation of text into other languages changes its size. Also, 87 * display of non-English text will use a different font in many 88 * cases. 89 * 90 * In addition, the fixed widget can't properly be mirrored in 91 * right-to-left languages such as Hebrew and Arabic. i.e. normally 92 * GTK+ will flip the interface to put labels to the right of the 93 * thing they label, but it can't do that with GtkFixed. So your 94 * application will not be usable in right-to-left languages. 95 * 96 * Finally, fixed positioning makes it kind of annoying to add/remove 97 * GUI elements, since you have to reposition all the other 98 * elements. This is a long-term maintenance problem for your 99 * application. 100 * 101 * If you know none of these things are an issue for your application, 102 * and prefer the simplicity of GtkFixed, by all means use the 103 * widget. But you should be aware of the tradeoffs. 104 */ 105 public class Fixed : Container 106 { 107 108 /** the main Gtk struct */ 109 protected GtkFixed* gtkFixed; 110 111 112 /** Get the main Gtk struct */ 113 public GtkFixed* getFixedStruct() 114 { 115 return gtkFixed; 116 } 117 118 119 /** the main Gtk struct as a void* */ 120 protected override void* getStruct() 121 { 122 return cast(void*)gtkFixed; 123 } 124 125 /** 126 * Sets our main struct and passes it to the parent class 127 */ 128 public this (GtkFixed* gtkFixed) 129 { 130 super(cast(GtkContainer*)gtkFixed); 131 this.gtkFixed = gtkFixed; 132 } 133 134 protected override void setStruct(GObject* obj) 135 { 136 super.setStruct(obj); 137 gtkFixed = cast(GtkFixed*)obj; 138 } 139 140 /** 141 */ 142 143 /** 144 * Creates a new GtkFixed. 145 * Throws: ConstructionException GTK+ fails to create the object. 146 */ 147 public this () 148 { 149 // GtkWidget * gtk_fixed_new (void); 150 auto p = gtk_fixed_new(); 151 if(p is null) 152 { 153 throw new ConstructionException("null returned by gtk_fixed_new()"); 154 } 155 this(cast(GtkFixed*) p); 156 } 157 158 /** 159 * Adds a widget to a GtkFixed container at the given position. 160 * Params: 161 * widget = the widget to add. 162 * x = the horizontal position to place the widget at. 163 * y = the vertical position to place the widget at. 164 */ 165 public void put(Widget widget, int x, int y) 166 { 167 // void gtk_fixed_put (GtkFixed *fixed, GtkWidget *widget, gint x, gint y); 168 gtk_fixed_put(gtkFixed, (widget is null) ? null : widget.getWidgetStruct(), x, y); 169 } 170 171 /** 172 * Moves a child of a GtkFixed container to the given position. 173 * Params: 174 * widget = the child widget. 175 * x = the horizontal position to move the widget to. 176 * y = the vertical position to move the widget to. 177 * Child Property Details 178 * The "x" child property 179 * "x" gint : Read / Write 180 * X position of child widget. 181 * Default value: 0 182 */ 183 public void move(Widget widget, int x, int y) 184 { 185 // void gtk_fixed_move (GtkFixed *fixed, GtkWidget *widget, gint x, gint y); 186 gtk_fixed_move(gtkFixed, (widget is null) ? null : widget.getWidgetStruct(), x, y); 187 } 188 }