2001-09-29 Mike Kestner <mkestner@speakeasy.net>
* glib/Value.cs (int ctor): New constructor for int-based values. (int exp cast): New explicit cast operator for Val to int conversion. * gtk/Window.cs (DefaultHeight): New prop. (DefaultWidth): New prop. svn path=/trunk/gtk-sharp/; revision=1034
This commit is contained in:
parent
e6979f31de
commit
14cf53f336
3 changed files with 86 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2001-09-29 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
|
* glib/Value.cs (int ctor): New constructor for int-based values.
|
||||||
|
(int exp cast): New explicit cast operator for Val to int conversion.
|
||||||
|
* gtk/Window.cs (DefaultHeight): New prop.
|
||||||
|
(DefaultWidth): New prop.
|
||||||
|
|
||||||
2001-09-28 Mike Kestner <mkestner@speakeasy.net>
|
2001-09-28 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
* glib/Object.cs (GetProperty): New, gets props from the raw obj.
|
* glib/Object.cs (GetProperty): New, gets props from the raw obj.
|
||||||
|
|
|
@ -82,6 +82,23 @@ namespace GLib {
|
||||||
g_value_set_boolean (_val, val);
|
g_value_set_boolean (_val, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Value Constructor
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Constructs a Value from a specified integer.
|
||||||
|
/// </remarks>
|
||||||
|
|
||||||
|
[DllImport("gobject-1.3.dll")]
|
||||||
|
static extern void g_value_set_int (IntPtr val, int data);
|
||||||
|
|
||||||
|
public Value (int val) : this ()
|
||||||
|
{
|
||||||
|
g_value_init (_val, TypeFundamentals.TypeInt);
|
||||||
|
g_value_set_int (_val, val);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value Constructor
|
/// Value Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -136,6 +153,26 @@ namespace GLib {
|
||||||
return g_value_get_boolean (val._val);
|
return g_value_get_boolean (val._val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Value to Integer Conversion
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Extracts an int from a Value. Note, this method
|
||||||
|
/// will produce an exception if the Value does not hold a
|
||||||
|
/// integer value.
|
||||||
|
/// </remarks>
|
||||||
|
|
||||||
|
[DllImport("gobject-1.3.dll")]
|
||||||
|
static extern int g_value_get_int (IntPtr val);
|
||||||
|
|
||||||
|
public static explicit operator int (Value val)
|
||||||
|
{
|
||||||
|
// FIXME: Insert an appropriate exception here if
|
||||||
|
// _val.type indicates an error.
|
||||||
|
return g_value_get_int (val._val);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value to String Conversion
|
/// Value to String Conversion
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -105,6 +105,27 @@ namespace Gtk {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DefaultHeight Property
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// The default Height of the Window in Pixels.
|
||||||
|
/// </remarks>
|
||||||
|
|
||||||
|
public int DefaultHeight {
|
||||||
|
get {
|
||||||
|
Value val = new Value (
|
||||||
|
TypeFundamentals.TypeInt);
|
||||||
|
GetProperty ("default-height", val);
|
||||||
|
return ((int) val);
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
Value val = new Value (value);
|
||||||
|
SetProperty ("default-height", val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DefaultSize Property
|
/// DefaultSize Property
|
||||||
|
@ -124,6 +145,27 @@ namespace Gtk {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
/// <summary>
|
||||||
|
/// DefaultWidth Property
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// The default Width of the Window in Pixels.
|
||||||
|
/// </remarks>
|
||||||
|
|
||||||
|
public int DefaultWidth {
|
||||||
|
get {
|
||||||
|
Value val = new Value (
|
||||||
|
TypeFundamentals.TypeInt);
|
||||||
|
GetProperty ("default-width", val);
|
||||||
|
return ((int) val);
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
Value val = new Value (value);
|
||||||
|
SetProperty ("default-width", val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DestroyWithParent Property
|
/// DestroyWithParent Property
|
||||||
|
|
Loading…
Reference in a new issue