2001-09-18 03:57:16 +00:00
|
|
|
// GTK.Label.cs - GTK Label class implementation
|
|
|
|
//
|
|
|
|
// Author: Bob Smith <bob@thestuff.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Bob Smith
|
|
|
|
|
2001-09-19 02:04:57 +00:00
|
|
|
namespace Gtk {
|
2001-09-18 03:57:16 +00:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
public class Label : Widget {
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Label Object Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Constructs a Label Wrapper.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
public Label (IntPtr o)
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
RawObject = o;
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Label Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Constructs a new Label with the specified content.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern IntPtr gtk_label_new (String str);
|
|
|
|
|
|
|
|
public Label (String str)
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
RawObject = gtk_label_new (str);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Text Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// The raw text of the label.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
2001-09-19 11:37:15 +00:00
|
|
|
static extern void gtk_label_set_text (IntPtr hnd, String str);
|
2001-09-18 03:57:16 +00:00
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern String gtk_label_get_text (IntPtr hnd);
|
|
|
|
|
|
|
|
public String Text {
|
|
|
|
get
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
return gtk_label_get_text (RawObject);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_text (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Markup Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Text to parse.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
2001-09-19 11:37:15 +00:00
|
|
|
static extern void gtk_label_set_markup (IntPtr hnd, String str);
|
2001-09-18 03:57:16 +00:00
|
|
|
|
|
|
|
public String Markup {
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_markup (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Label Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Parsed content.
|
|
|
|
/// </remarks>
|
2001-09-19 11:37:15 +00:00
|
|
|
/*
|
2001-09-18 03:57:16 +00:00
|
|
|
[DllImport("gtk-1.3")]
|
2001-09-19 11:37:15 +00:00
|
|
|
static extern void gtk_label_set_label (IntPtr hnd, String str);
|
2001-09-18 03:57:16 +00:00
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern String gtk_label_get_label (IntPtr hnd);
|
|
|
|
|
|
|
|
public String Label {
|
|
|
|
get
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
return gtk_label_get_label (RawObject);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_label (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
2001-09-19 11:37:15 +00:00
|
|
|
*/
|
2001-09-18 03:57:16 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Selectable Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Is the user able to select text from the label.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern void gtk_label_set_selectable (IntPtr hnd, bool setting);
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern bool gtk_label_get_selectable (IntPtr hnd);
|
|
|
|
|
|
|
|
public bool Selectable {
|
|
|
|
get
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
return gtk_label_get_selectable (RawObject);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_selectable (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// UseUnderline Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Indicates that the next character after an underline should be the accelerator key.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern void gtk_label_set_use_underline (IntPtr hnd, bool setting);
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern bool gtk_label_get_use_underline (IntPtr hnd);
|
|
|
|
|
|
|
|
public bool UseUnderline {
|
|
|
|
get
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
return gtk_label_get_use_underline (RawObject);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_use_underline (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// UseMarkup Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Indicates that the text contains markup.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern void gtk_label_set_use_markup (IntPtr hnd, bool setting);
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern bool gtk_label_get_use_markup (IntPtr hnd);
|
|
|
|
|
|
|
|
public bool UseMarkup {
|
|
|
|
get
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
return gtk_label_get_use_markup (RawObject);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_use_markup (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// LineWrap Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Indicates that the text is automatically wrapped if to long.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern void gtk_label_set_line_wrap (IntPtr hnd, bool setting);
|
|
|
|
[DllImport("gtk-1.3")]
|
|
|
|
static extern bool gtk_label_get_line_wrap (IntPtr hnd);
|
|
|
|
|
|
|
|
public bool LineWrap {
|
|
|
|
get
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
return gtk_label_get_line_wrap (RawObject);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2001-09-19 11:37:15 +00:00
|
|
|
gtk_label_set_line_wrap (RawObject, value);
|
2001-09-18 03:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
TODO:
|
|
|
|
|
|
|
|
void gtk_label_set_attributes(GtkLabel *label, PangoAttrList *attrs);
|
|
|
|
void gtk_label_set_markup_with_mnemonic(GtkLabel *label, const gchar *str);
|
|
|
|
void gtk_label_set_pattern(GtkLabel *label, const gchar *pattern);
|
|
|
|
void gtk_label_set_justify(GtkLabel *label, GtkJustification jtype);
|
|
|
|
guint gtk_label_parse_uline(GtkLabel *label, const gchar *string);
|
|
|
|
void gtk_label_get_layout_offsets (GtkLabel *label,
|
|
|
|
gint *x,
|
|
|
|
gint *y);
|
|
|
|
guint gtk_label_get_mnemonic_keyval (GtkLabel *label);
|
|
|
|
GtkWidget* gtk_label_new_with_mnemonic (const char *str);
|
|
|
|
void gtk_label_select_region (GtkLabel *label,
|
|
|
|
gint start_offset,
|
|
|
|
gint end_offset);
|
|
|
|
void gtk_label_set_mnemonic_widget (GtkLabel *label,
|
|
|
|
GtkWidget *widget);
|
|
|
|
void gtk_label_set_text_with_mnemonic
|
|
|
|
(GtkLabel *label,
|
|
|
|
const gchar *str);
|
|
|
|
PangoAttrList* gtk_label_get_attributes (GtkLabel *label);
|
|
|
|
GtkJustification gtk_label_get_justify (GtkLabel *label);
|
|
|
|
PangoLayout* gtk_label_get_layout (GtkLabel *label);
|
|
|
|
|
|
|
|
GtkWidget* gtk_label_get_mnemonic_widget (GtkLabel *label);
|
|
|
|
gboolean gtk_label_get_selection_bounds (GtkLabel *label,
|
|
|
|
gint *start,
|
|
|
|
gint *end);
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|