2003-02-12 02:00:12 +00:00
<Type Name= "ToggleButton" FullName= "Gtk.ToggleButton" >
2005-05-23 20:41:51 +00:00
<TypeSignature Language= "C#" Maintainer= "John Luke" Value= "public class ToggleButton : Gtk.Button" />
2011-11-09 16:01:51 +00:00
<TypeSignature Language= "ILAsm" Value= ".class public auto ansi beforefieldinit ToggleButton extends Gtk.Button" />
2003-02-12 02:00:12 +00:00
<AssemblyInfo >
<AssemblyName > gtk-sharp</AssemblyName>
2003-12-24 01:35:30 +00:00
<AssemblyPublicKey >
</AssemblyPublicKey>
2003-02-12 02:00:12 +00:00
</AssemblyInfo>
2003-02-23 07:26:30 +00:00
<ThreadSafetyStatement > Gtk# is thread aware, but not thread safe; See the <link location= "node:gtk-sharp/programming/threads" > Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
2011-11-09 16:01:51 +00:00
<Base >
<BaseTypeName > Gtk.Button</BaseTypeName>
</Base>
<Interfaces >
</Interfaces>
2003-02-12 02:00:12 +00:00
<Docs >
2003-04-24 18:38:39 +00:00
<summary > A button that can be toggled on and off.</summary>
<remarks >
2003-05-08 20:26:02 +00:00
<para > A <see cref= "T:Gtk.ToggleButton" /> is a <see cref= "T:Gtk.Button" /> which will remain 'pressed-in' when clicked.
2003-07-08 18:44:29 +00:00
Clicking again will cause the toggle button to return to its normal state. This is useful if you need to maintain the state of a button.</para>
2003-05-08 20:26:02 +00:00
<example >
<code lang= "C#" source= "ToggleButton.cs" >
2003-05-01 23:30:59 +00:00
using Gtk;
using System;
2003-04-24 18:38:39 +00:00
2003-05-01 23:30:59 +00:00
public class ToggleButtonApp {
2003-04-24 18:38:39 +00:00
2003-05-01 23:30:59 +00:00
ToggleButton btn;
2003-04-24 18:38:39 +00:00
2003-05-01 23:30:59 +00:00
public static int Main (string[] args)
{
new ToggleButtonApp();
return 0;
}
2003-04-24 18:38:39 +00:00
2003-05-01 23:30:59 +00:00
public ToggleButtonApp()
{
Application.Init ();
Window win = new Window ("ToggleButton Tester");
win.SetDefaultSize (200, 150);
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
btn = new ToggleButton ("Unselected");
btn.Active = false;
btn.Toggled += new EventHandler (btn_toggled);
win.Add (btn);
win.ShowAll ();
Application.Run ();
}
2003-04-24 18:38:39 +00:00
2003-05-01 23:30:59 +00:00
void btn_toggled (object obj, EventArgs args)
{
Console.WriteLine ("Button Toggled");
if (btn.Active)
2003-04-24 18:38:39 +00:00
{
2003-05-01 23:30:59 +00:00
btn.Label = "Unselected";
2003-04-24 18:38:39 +00:00
}
2003-05-01 23:30:59 +00:00
else
2003-04-24 18:38:39 +00:00
{
2003-05-01 23:30:59 +00:00
btn.Label = "Selected";
2003-04-24 18:38:39 +00:00
}
2003-05-01 23:30:59 +00:00
}
2003-04-24 18:38:39 +00:00
2003-05-01 23:30:59 +00:00
static void Window_Delete (object obj, DeleteEventArgs args)
{
Application.Quit ();
args.RetVal = true;
2003-04-24 18:38:39 +00:00
}
2003-05-01 23:30:59 +00:00
2003-04-24 18:38:39 +00:00
}
</code>
2003-05-08 20:26:02 +00:00
</example>
</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
<Members >
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public ToggleButton ();" />
2011-11-09 16:01:51 +00:00
<MemberSignature Language= "ILAsm" Value= ".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
2003-02-12 02:00:12 +00:00
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs >
2003-05-08 20:26:02 +00:00
<summary > Creates a new <see cref= "T:Gtk.ToggleButton" /> object</summary>
2003-04-24 18:41:14 +00:00
<remarks >
<para >
2003-05-08 20:26:02 +00:00
Creates a new <see cref= "T:Gtk.ToggleButton" /> , which is a
<see cref= "T:Gtk.Container" /> . A widget should be packed
inside the toggle button using <see cref= "M:Gtk.Container.Add (Gtk.Widget)" /> .
2003-04-24 18:41:14 +00:00
</para>
2003-05-08 20:26:02 +00:00
<para >
<example >
<code lang= "C#" >
2003-05-01 23:30:59 +00:00
Label label = new Label();
ToggleButton btn = new ToggleButton ();
btn.Add(label);
</code>
2003-05-08 20:26:02 +00:00
</example>
</para>
2003-04-24 18:41:14 +00:00
</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
2011-11-09 16:01:51 +00:00
<MemberSignature Language= "C#" Value= "public ToggleButton (IntPtr raw);" />
<MemberSignature Language= "ILAsm" Value= ".method public hidebysig specialname rtspecialname instance void .ctor(native int raw) cil managed" />
2003-02-12 02:00:12 +00:00
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
2011-11-09 16:01:51 +00:00
<Parameter Name= "raw" Type= "System.IntPtr" />
2003-12-24 01:35:30 +00:00
</Parameters>
2003-02-12 02:00:12 +00:00
<Docs >
2011-11-09 16:01:51 +00:00
<param name= "raw" > Pointer to the C object.</param>
<summary > Internal constructor</summary>
2003-04-24 18:38:39 +00:00
<remarks >
2011-11-09 16:01:51 +00:00
<para > This is an internal constructor, and should not be used by user code.</para>
2003-05-08 20:26:02 +00:00
</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
</Member>
2011-11-09 16:01:51 +00:00
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public ToggleButton (string label);" />
<MemberSignature Language= "ILAsm" Value= ".method public hidebysig specialname rtspecialname instance void .ctor(string label) cil managed" />
<MemberType > Constructor</MemberType>
<ReturnValue />
2003-12-24 01:35:30 +00:00
<Parameters >
2011-11-09 16:01:51 +00:00
<Parameter Name= "label" Type= "System.String" />
2003-12-24 01:35:30 +00:00
</Parameters>
2003-02-12 02:00:12 +00:00
<Docs >
2011-11-09 16:01:51 +00:00
<param name= "label" > a <see cref= "T:System.String" /> containing the message to be placed in the toggle button.</param>
<summary > Creates a new <see cref= "T:Gtk.ToggleButton" /> with a text label.</summary>
<remarks > Creates a new <see cref= "T:Gtk.ToggleButton" /> with a text label.
<example > <code lang= "C#" > ToggleButton btn = new ToggleButton ("ToggleButton");</code> </example> </remarks>
2003-02-12 02:00:12 +00:00
</Docs>
2011-11-09 16:01:51 +00:00
</Member>
<Member MemberName= "Active" >
<MemberSignature Language= "C#" Value= "public bool Active { get; set; }" />
<MemberSignature Language= "ILAsm" Value= ".property instance bool Active" />
<MemberType > Property</MemberType>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
2011-11-09 16:01:51 +00:00
<AttributeName > GLib.Property("active")</AttributeName>
2005-05-23 20:41:51 +00:00
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
2003-02-12 02:00:12 +00:00
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
2003-12-24 01:35:30 +00:00
<Parameters >
</Parameters>
2003-02-12 02:00:12 +00:00
<Docs >
2003-05-08 20:26:02 +00:00
<summary > Get or set the <see cref= "T:Gtk.ToggleButton" /> active</summary>
2005-05-23 20:41:51 +00:00
<value > an object of type <see cref= "T:System.Boolean" /> </value>
2003-04-24 18:38:39 +00:00
<remarks >
2003-05-08 20:26:02 +00:00
<para > Get or set the <see cref= "T:Gtk.ToggleButton" /> active.</para>
2003-07-08 18:44:29 +00:00
<para > Get: Queries a <see cref= "T:Gtk.ToggleButton" /> and returns its current state.
2003-05-08 20:26:02 +00:00
Returns <see langword= "true" /> if the toggle button is pressed in and <see langword= "false" /> if it is raised.
2003-04-24 18:38:39 +00:00
</para>
2003-05-08 20:26:02 +00:00
<example >
<code lang= "C#" >
2003-05-01 23:30:59 +00:00
if (btn.Active) {
Console.WriteLine("The ToggleButton is pressed in");
}
else {
Console.WriteLine("The ToggleButton is raised");
}
</code>
2003-05-08 20:26:02 +00:00
</example>
<para > Set: Sets the status of the toggle button. Set to <see langword= "true" /> if you want the GtkToggleButton to be 'pressed in', and <see langword= "false" /> to raise it.
2003-04-24 18:38:39 +00:00
This action causes the toggled signal to be emitted.
</para>
2003-05-08 20:26:02 +00:00
<example >
<code lang= "C#" >
2003-05-01 23:30:59 +00:00
// set the togglebutton active
// and appear "pressed in"
btn.Active = true;
</code>
2003-05-08 20:26:02 +00:00
</example>
</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
2011-11-09 16:01:51 +00:00
</Member>
<Member MemberName= "DrawIndicator" >
<MemberSignature Language= "C#" Value= "public bool DrawIndicator { get; set; }" />
<MemberSignature Language= "ILAsm" Value= ".property instance bool DrawIndicator" />
<MemberType > Property</MemberType>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
2011-11-09 16:01:51 +00:00
<AttributeName > GLib.Property("draw-indicator")</AttributeName>
2005-05-23 20:41:51 +00:00
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
2003-02-12 02:00:12 +00:00
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
2003-12-24 01:35:30 +00:00
<Parameters >
</Parameters>
2003-02-12 02:00:12 +00:00
<Docs >
2003-05-08 20:26:02 +00:00
<summary > Determines the drawing style of a <see cref= "T:Gtk.RadioButton" /> or <see cref= "T:Gtk.CheckButton" /> </summary>
2005-05-23 20:41:51 +00:00
<value > an object of type <see cref= "T:System.Boolean" /> </value>
2003-05-08 20:26:02 +00:00
<remarks > The DrawIndicator property can be set to <see langword= "false" /> to make
<see cref= "T:Gtk.CheckButton" /> or <see cref= "T:Gtk.RadioButton" /> look like a normal <see cref= "T:Gtk.Button" /> .
2003-04-24 18:38:39 +00:00
</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
2005-08-23 17:02:47 +00:00
</Member>
2011-11-09 16:01:51 +00:00
<Member MemberName= "GType" >
<MemberSignature Language= "C#" Value= "public static GLib.GType GType { get; }" />
<MemberSignature Language= "ILAsm" Value= ".property valuetype GLib.GType GType" />
<MemberType > Property</MemberType>
2003-09-17 21:56:59 +00:00
<ReturnValue >
2011-11-09 16:01:51 +00:00
<ReturnType > GLib.GType</ReturnType>
2003-09-17 21:56:59 +00:00
</ReturnValue>
2003-02-12 02:00:12 +00:00
<Parameters />
<Docs >
2011-11-09 16:01:51 +00:00
<summary > GType Property.</summary>
<value > a <see cref= "T:GLib.GType" /> </value>
<remarks > Returns the native <see cref= "T:GLib.GType" /> value for <see cref= "T:Gtk.ToggleButton" /> .</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
2011-11-09 16:01:51 +00:00
</Member>
<Member MemberName= "Inconsistent" >
<MemberSignature Language= "C#" Value= "public bool Inconsistent { get; set; }" />
<MemberSignature Language= "ILAsm" Value= ".property instance bool Inconsistent" />
<MemberType > Property</MemberType>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
2011-11-09 16:01:51 +00:00
<AttributeName > GLib.Property("inconsistent")</AttributeName>
2005-05-23 20:41:51 +00:00
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
2011-11-09 16:01:51 +00:00
<ReturnValue >
<ReturnType > System.Boolean</ReturnType>
</ReturnValue>
<Parameters >
</Parameters>
<Docs >
<summary > Determines if the <see cref= "T:Gtk.ToggleButton" /> has an intermediate state.</summary>
<value > an object of type <see cref= "T:System.Boolean" /> </value>
<remarks >
<para >
If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a <see cref= "T:Gtk.ToggleButton" /> ,
and the current values in that range are inconsistent, you may want to display the toggle in an "in between" state.
This function turns on "in between" display. Normally you would turn off the inconsistent state again if the user toggles the <see cref= "T:Gtk.ToggleButton" /> .
This has to be done manually, <see cref= "P:Gtk.ToggleButton.Inconsistent" /> only affects visual appearance, it does not affect the semantics of the <see cref= "T:Gtk.Button" /> .
</para>
</remarks>
</Docs>
2005-08-23 17:02:47 +00:00
</Member>
2011-11-09 16:01:51 +00:00
<Member MemberName= "Mode" >
<MemberSignature Language= "C#" Value= "public bool Mode { get; set; }" />
<MemberSignature Language= "ILAsm" Value= ".property instance bool Mode" />
2003-12-24 01:35:30 +00:00
<MemberType > Property</MemberType>
<ReturnValue >
2011-11-09 16:01:51 +00:00
<ReturnType > System.Boolean</ReturnType>
2003-12-24 01:35:30 +00:00
</ReturnValue>
2011-11-09 16:01:51 +00:00
<Parameters >
</Parameters>
2003-12-24 01:35:30 +00:00
<Docs >
2011-11-09 16:01:51 +00:00
<summary > The Mode of the <see cref= "T:Gtk.ToggleButton" /> </summary>
<value > an object of type <see cref= "T:System.Boolean" /> </value>
<remarks >
<para > The Mode of the <see cref= "T:Gtk.ToggleButton" /> </para>
<para > Sets whether the button is displayed as a separate indicator and label.
You can call this function on a <see cref= "T:Gtk.CheckButton" /> or a <see cref= "T:Gtk.RadioButton" /> with <see cref= "P:Gtk.ToggleButton.DrawIndicator" /> = <see langword= "false" /> to make the button look like a normal button
</para>
<para > This function only effects instances of classes like <see cref= "T:Gtk.CheckButton" /> and <see cref= "T:Gtk.RadioButton" />
that derive from <see cref= "T:Gtk.ToggleButton" /> , not instances of <see cref= "T:Gtk.ToggleButton" /> itself.
</para>
</remarks>
</Docs>
</Member>
<Member MemberName= "NewWithLabel" >
<MemberSignature Language= "C#" Value= "public static Gtk.ToggleButton NewWithLabel (string label);" />
<MemberSignature Language= "ILAsm" Value= ".method public static hidebysig class Gtk.ToggleButton NewWithLabel(string label) cil managed" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > Gtk.ToggleButton</ReturnType>
</ReturnValue>
<Parameters >
<Parameter Name= "label" Type= "System.String" />
</Parameters>
<Docs >
<param name= "label" > a <see cref= "T:System.String" /> containing the message to be placed in the toggle button.</param>
<summary > Creates a new <see cref= "T:Gtk.ToggleButton" /> with a text label.</summary>
<returns > a new <see cref= "T:Gtk.ToggleButton" /> .</returns>
<remarks > Creates a new <see cref= "T:Gtk.ToggleButton" /> with a text label.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= "OnToggled" >
<MemberSignature Language= "C#" Value= "protected virtual void OnToggled ();" />
2011-11-09 16:01:51 +00:00
<MemberSignature Language= "ILAsm" Value= ".method familyhidebysig newslot virtual instance void OnToggled() cil managed" />
2003-12-24 01:35:30 +00:00
<MemberType > Method</MemberType>
2011-11-09 16:01:51 +00:00
<Attributes >
<Attribute >
<AttributeName > GLib.DefaultSignalHandler(ConnectionMethod="OverrideToggled", Type=typeof(Gtk.ToggleButton))</AttributeName>
</Attribute>
</Attributes>
2003-12-24 01:35:30 +00:00
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-06-15 15:41:25 +00:00
<summary > Default handler for the <see cref= "M:Gtk.ToggleButton.Toggled" /> event.</summary>
<remarks > Override this method in a subclass to provide a default handler for the <see cref= "M:Gtk.ToggleButton.Toggled" /> event.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
2011-11-09 16:01:51 +00:00
<Member MemberName= "Toggle" >
<MemberSignature Language= "C#" Value= "public void Toggle ();" />
<MemberSignature Language= "ILAsm" Value= ".method public hidebysig instance void Toggle() cil managed" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
2003-03-07 01:30:00 +00:00
<Docs >
2011-11-09 16:01:51 +00:00
<summary > Emits the <see cref= "E:Gtk.ToggleButton.Toggled" /> event</summary>
<remarks > Emits the <see cref= "E:Gtk.ToggleButton.Toggled" /> event on the <see cref= "T:Gtk.ToggleButton" /> . There is no good reason for an application ever to call this function.</remarks>
2003-03-07 01:30:00 +00:00
</Docs>
2011-11-09 16:01:51 +00:00
</Member>
<Member MemberName= "Toggled" >
<MemberSignature Language= "C#" Value= "public event EventHandler Toggled;" />
<MemberSignature Language= "ILAsm" Value= ".event class System.EventHandler Toggled" />
<MemberType > Event</MemberType>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
2011-11-09 16:01:51 +00:00
<AttributeName > GLib.Signal("toggled")</AttributeName>
2005-05-23 20:41:51 +00:00
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
2011-11-09 16:01:51 +00:00
<ReturnValue >
<ReturnType > System.EventHandler</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
<summary > Triggered when the <see cref= "T:Gtk.ToggleButton" /> is clicked.</summary>
<remarks > Should be connected if you wish to perform an action whenever the <see cref= "T:Gtk.ToggleButton" /> state changes.
<example > <code lang= "C#" >
ToggleButton btn = new ToggleButton("ToggleButton");
btn.Toggled += new EventHandler (btn_toggled);
void btn_toggled (object obj, EventArgs args)
{
// code for toggled event here
}
</code> </example> </remarks>
</Docs>
2005-08-23 17:02:47 +00:00
</Member>
2003-02-12 02:00:12 +00:00
</Members>
2005-05-23 20:41:51 +00:00
</Type>