// Gtk.Window.cs - GTK Window class implementation // // Author: Mike Kestner // // (c) 2001 Mike Kestner namespace Gtk { using GLib; using System; using System.Drawing; using System.Runtime.InteropServices; public class Window : Widget { /// /// Window Object Constructor /// /// /// /// Constructs a Window Wrapper. /// public Window (IntPtr o) { RawObject = o; } /// /// Window Constructor /// /// /// /// Constructs a new Window of type TopLevel. /// [DllImport("gtk-1.3.dll")] static extern IntPtr gtk_window_new (WindowType type); public Window () { RawObject = gtk_window_new (WindowType.Toplevel); } /// /// Window Constructor /// /// /// /// Constructs a new Window of type TopLevel with the /// specified Title. /// public Window (String title) : this () { this.Title = title; } /// /// AllowGrow Property /// /// /// /// Indicates if the Window can be resized to larger than /// the default size. /// public bool AllowGrow { get { bool val; GetProperty ("allow-grow", out val); return (val); } set { SetProperty ("allow-grow", value); } } /// /// AllowShrink Property /// /// /// /// Indicates if the Window can be resized to smaller than /// the default size. /// public bool AllowShrink { get { bool val; GetProperty ("allow-shrink", out val); return (val); } set { SetProperty ("allow-shrink", value); } } /// /// DefaultHeight Property /// /// /// /// The default Height of the Window in Pixels. /// public int DefaultHeight { get { int val; GetProperty ("default-height", out val); return (val); } set { SetProperty ("default-height", value); } } /// /// DefaultSize Property /// /// /// /// The default Size of the Window in Screen Coordinates. /// public Size DefaultSize { get { return new Size (DefaultWidth, DefaultHeight); } set { DefaultWidth = value.Width; DefaultHeight = value.Height; } } /// /// DefaultWidth Property /// /// /// /// The default Width of the Window in Pixels. /// public int DefaultWidth { get { int val; GetProperty ("default-width", out val); return (val); } set { SetProperty ("default-width", value); } } /// /// DestroyWithParent Property /// /// /// /// Indicates if the Window should be destroyed when any /// associated parent Windows are destroyed. /// public bool DestroyWithParent { get { bool val; GetProperty ("destroy-with-parent", out val); return (val); } set { SetProperty ("destroy-with-parent", value); } } /// /// Modal Property /// /// /// /// Indicates if the Window is Modal. If true, the input /// focus is grabbed by the Window and other Windows in /// the application will not accept input until the Window /// is closed. /// public bool Modal { get { bool val; GetProperty ("modal", out val); return (val); } set { SetProperty ("modal", value); } } /// /// Position Property /// /// /// /// The Position of the Window in Screen Coordinates. /// [DllImport("gtk-1.3.dll")] static extern void gtk_window_set_position (IntPtr hnd, int x, int y); public Point Position { set { gtk_window_set_position ( RawObject, value.X, value.Y); } } /// /// Resizable Property /// /// /// /// Indicates if the Height and Width of the Window can be /// altered by the user. /// public bool Resizable { get { bool val; GetProperty ("resizable", out val); return (val); } set { SetProperty ("resizable", value); } } /// /// Title Property /// /// /// /// The Title displayed in the Window's Title Bar. /// public String Title { get { String val; GetProperty ("title", out val); return val; } set { SetProperty ("title", value); } } } }