cvs: php-gtk-doc /examples/reference/gtk/gtkalignment constructor.phpw /manual/en/reference/gtk gtkalignment.xml
| From: | Christian Weiske | Date: | Thu, 03 Nov 2005 07:22:19 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtkalignment constructor.phpw /manual/en/reference/gtk gtkalignment.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1607@lists.php.net to get a copy of this message | ||
cweiske Thu Nov 3 02:22:19 2005 EDT
Added files:
/php-gtk-doc/examples/reference/gtk/gtkalignment constructor.phpw
Modified files:
/php-gtk-doc/manual/en/reference/gtk gtkalignment.xml
Log:
Added Jp's GtkAlignment patch and example
http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml?r1=1.2&r2=1.3&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.2 php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.3 --- php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.2 Tue Aug 2 07:01:44 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml Thu Nov 3 02:22:19 2005 @@ -4,10 +4,26 @@ <classtitle>GtkAlignment</classtitle> <classparent>GtkBin</classparent> <shortdesc> - + A container that controls the alignment and size of it's child. </shortdesc> <desc> - + <para> + The <classname>GtkAlignment</classname> container controls the alignment + and size of it's child, relative to it's own dimensions. However, if the + child has a size request from it's own child/children, it will take + precedence. For example, a <classname>GtkButton</classname> with a label + will never be scaled down to a size smaller than that of the label. + </para> + <para> + It can be used to define the relative alignment of the child within the + container (<parameter>xalign</parameter>/<parameter>yalign</parameter>), + and the relative ammount of free space assigned to the container that the + child is allowed to extend (<parameter>xscale</parameter>/<parameter>yscale</parameter>). + </para> + <para> + <classname>GtkAlignment</classname> also provides methods to specifically + set (and retrieve the current) top, bottom, right and left padding of the widget. + </para> </desc> </classmeta> @@ -16,7 +32,7 @@ <constructor id="gtk.gtkalignment.constructor"> <funcsynopsis> <funcprototype> - <funcdef> <function>GtkAlignment</function></funcdef> + <funcdef><function>GtkAlignment</function></funcdef> <paramdef>double <parameter><optional>xalign = 0.5</optional></parameter></paramdef> <paramdef>double <parameter><optional>yalign = 0.5</optional></parameter></paramdef> <paramdef>double <parameter><optional>xscale = 1.0</optional></parameter></paramdef> @@ -24,10 +40,46 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates a container that controls the alignment and size of it's child. </shortdesc> <desc> - + <para> + <classname>GtkAlignment</classname> is a container widget that controls + the alignment and size of it's child. + </para> + <para> + A <classname>GtkAlignment</classname> widget has four settings: + <itemizedlist> + <listitem><parameter>xalign</parameter>: This parameter is used to + horizontally place the child. It's value can be anything between 0 (left) + and 1 (right). The default is 0.5, which centers the child widget + <emphasis>relative to the <classname>GtkAlignment</classname> + container</emphasis>. + </listitem> + <listitem><parameter>yalign</parameter>: This parameter is used to + vertically place the child. It's value can be anything between 0 (top) and + 1 (bottom). It defaults to 0.5. + </listitem> + <listitem><parameter>xscale</parameter>: It defines the ammount of + horizontal free space in the <classname>GtkAlignment</classname> container + that the child will be extended to occupy. 0 means the child won't extend, + 1 means it'll extend over all the available free space. + </listitem> + <listitem><parameter>yscale</parameter>: It defines the ammount of vertical + free space that the child will be extended to occupy. Ranges from 0 (the + child won't extend) to 1 (extend over all the available free space). + </listitem> + </itemizedlist> + <example> + <title>GtkAlignment usage demonstration</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkalignment/constructor.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + </para> </desc> </constructor> @@ -43,14 +95,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the padding on the different sides of the widget. </shortdesc> <desc> <para> + This method retrieves the current padding on the different sides of the + <classname>GtkAlignment</classname> container. + </para> + <para> See also: <function class="GtkAlignment">set_padding</function> </para> - </desc> </method> @@ -65,10 +120,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets new values for <classname>GtkAlignment</classname>. </shortdesc> <desc> - + <para> + This method is used to define new values for a + <classname>GtkAlignment</classname> container. + </para> </desc> </method> @@ -83,10 +141,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the padding on the different sides of the widget. </shortdesc> <desc> <para> + This method sets the padding on the different sides of the + <classname>GtkAlignment</classname> container. + </para> + <para> See also: <function class="GtkAlignment">get_padding</function> </para> http://cvs.php.net/co.php/php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw?r=1.1&p=1 Index: php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw +++ php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw <?php //Checking for php-gtk if( !class_exists('gtk')) { die('Please load the php-gtk2 module in your php.ini' . "\r\n"); } //A GtkVBox that will hold the GtkAlignment widgets and GtkHSeparators $vbox = new GtkVBox(); //Let's create three GtkAlignment containers with different settings, each holding a button //First GtkAlignment container. //Positioning the button at the top-left of the window, not allowing it to extend: $align1 = new GtkAlignment(0, 0, 0, 0); //Let's push the button down and right, with padding on the top and left: $align1->set_padding(200, 0, 200, 0); //Creating a button. $button1 = new GtkButton('This GtkButton is here because of a padding_top and padding_left of 200 pixels.', false); //Adding button1 to the first GtkAlignment container $align1->add($button1); //Packing the GtkAlignment container into the GtkVBox $vbox->pack_start($align1, true, true); //Adding a GtkHSeparator, to see the different GtkAlignment containers better $vbox->pack_start(new GtkHSeparator(), false, false, 3); //Second GtkAlignment container. //This container will center it's child, while not allowing it to extend to occupy all free space $align2 = new GtkAlignment(0.5, 0.5, 0, 0); //Creating a new button $button2 = new GtkButton('This GtkButton is centered using GtkAlignment'); //Adding button2 to the second GtkAlignment container $align2->add($button2); //Packing the GtkAlignment container into the GtkVBox $vbox->pack_start($align2, true, true); //Adding a GtkHSeparator, to see the different GtkAlignment containers better $vbox->pack_start(new GtkHSeparator(), false, false, 3); //Third GtkAlignment container. //This container will center it's child, allowing it extend into 75% (0.75) of the free space $align3 = new GtkAlignment(0.5, 0.5, 0.75, 0.75); //Creating a new button $button3 = new GtkButton('This one is centered and extends to occupy 75% of the empty space. Try resizing the window!'); //Adding button3 to the third GtkAlignment container $align3->add($button3); //Packing the GtkAlignment container into the GtkVBox $vbox->pack_start($align3, true, true); //Preparing the window $win = new gtkwindow(); $win->set_position(Gtk::WIN_POS_CENTER); $win->set_title('GtkAlignment demo'); //Adding the GtkVBox to the window $win->add($vbox); //Connecting the destroy signal $win->connect_simple('destroy',array('gtk','main_quit')); //Showing the window's content $win->Show_All(); //Main loop Gtk::main(); ?>
http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml?r1=1.2&r2=1.3&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.2 php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.3 --- php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.2 Tue Aug 2 07:01:44 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml Thu Nov 3 02:22:19 2005 @@ -4,10 +4,26 @@ <classtitle>GtkAlignment</classtitle> <classparent>GtkBin</classparent> <shortdesc> - + A container that controls the alignment and size of it's child. </shortdesc> <desc> - + <para> + The <classname>GtkAlignment</classname> container controls the alignment + and size of it's child, relative to it's own dimensions. However, if the + child has a size request from it's own child/children, it will take + precedence. For example, a <classname>GtkButton</classname> with a label + will never be scaled down to a size smaller than that of the label. + </para> + <para> + It can be used to define the relative alignment of the child within the + container (<parameter>xalign</parameter>/<parameter>yalign</parameter>), + and the relative ammount of free space assigned to the container that the + child is allowed to extend (<parameter>xscale</parameter>/<parameter>yscale</parameter>). + </para> + <para> + <classname>GtkAlignment</classname> also provides methods to specifically + set (and retrieve the current) top, bottom, right and left padding of the widget. + </para> </desc> </classmeta> @@ -16,7 +32,7 @@ <constructor id="gtk.gtkalignment.constructor"> <funcsynopsis> <funcprototype> - <funcdef> <function>GtkAlignment</function></funcdef> + <funcdef><function>GtkAlignment</function></funcdef> <paramdef>double <parameter><optional>xalign = 0.5</optional></parameter></paramdef> <paramdef>double <parameter><optional>yalign = 0.5</optional></parameter></paramdef> <paramdef>double <parameter><optional>xscale = 1.0</optional></parameter></paramdef> @@ -24,10 +40,46 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates a container that controls the alignment and size of it's child. </shortdesc> <desc> - + <para> + <classname>GtkAlignment</classname> is a container widget that controls + the alignment and size of it's child. + </para> + <para> + A <classname>GtkAlignment</classname> widget has four settings: + <itemizedlist> + <listitem><parameter>xalign</parameter>: This parameter is used to + horizontally place the child. It's value can be anything between 0 (left) + and 1 (right). The default is 0.5, which centers the child widget + <emphasis>relative to the <classname>GtkAlignment</classname> + container</emphasis>. + </listitem> + <listitem><parameter>yalign</parameter>: This parameter is used to + vertically place the child. It's value can be anything between 0 (top) and + 1 (bottom). It defaults to 0.5. + </listitem> + <listitem><parameter>xscale</parameter>: It defines the ammount of + horizontal free space in the <classname>GtkAlignment</classname> container + that the child will be extended to occupy. 0 means the child won't extend, + 1 means it'll extend over all the available free space. + </listitem> + <listitem><parameter>yscale</parameter>: It defines the ammount of vertical + free space that the child will be extended to occupy. Ranges from 0 (the + child won't extend) to 1 (extend over all the available free space). + </listitem> + </itemizedlist> + <example> + <title>GtkAlignment usage demonstration</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkalignment/constructor.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + </para> </desc> </constructor> @@ -43,14 +95,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the padding on the different sides of the widget. </shortdesc> <desc> <para> + This method retrieves the current padding on the different sides of the + <classname>GtkAlignment</classname> container. + </para> + <para> See also: <function class="GtkAlignment">set_padding</function> </para> - </desc> </method> @@ -65,10 +120,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets new values for <classname>GtkAlignment</classname>. </shortdesc> <desc> - + <para> + This method is used to define new values for a + <classname>GtkAlignment</classname> container. + </para> </desc> </method> @@ -83,10 +141,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the padding on the different sides of the widget. </shortdesc> <desc> <para> + This method sets the padding on the different sides of the + <classname>GtkAlignment</classname> container. + </para> + <para> See also: <function class="GtkAlignment">get_padding</function> </para> http://cvs.php.net/co.php/php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw?r=1.1&p=1 Index: php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw +++ php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw <?php //Checking for php-gtk if( !class_exists('gtk')) { die('Please load the php-gtk2 module in your php.ini' . "\r\n"); } //A GtkVBox that will hold the GtkAlignment widgets and GtkHSeparators $vbox = new GtkVBox(); //Let's create three GtkAlignment containers with different settings, each holding a button //First GtkAlignment container. //Positioning the button at the top-left of the window, not allowing it to extend: $align1 = new GtkAlignment(0, 0, 0, 0); //Let's push the button down and right, with padding on the top and left: $align1->set_padding(200, 0, 200, 0); //Creating a button. $button1 = new GtkButton('This GtkButton is here because of a padding_top and padding_left of 200 pixels.', false); //Adding button1 to the first GtkAlignment container $align1->add($button1); //Packing the GtkAlignment container into the GtkVBox $vbox->pack_start($align1, true, true); //Adding a GtkHSeparator, to see the different GtkAlignment containers better $vbox->pack_start(new GtkHSeparator(), false, false, 3); //Second GtkAlignment container. //This container will center it's child, while not allowing it to extend to occupy all free space $align2 = new GtkAlignment(0.5, 0.5, 0, 0); //Creating a new button $button2 = new GtkButton('This GtkButton is centered using GtkAlignment'); //Adding button2 to the second GtkAlignment container $align2->add($button2); //Packing the GtkAlignment container into the GtkVBox $vbox->pack_start($align2, true, true); //Adding a GtkHSeparator, to see the different GtkAlignment containers better $vbox->pack_start(new GtkHSeparator(), false, false, 3); //Third GtkAlignment container. //This container will center it's child, allowing it extend into 75% (0.75) of the free space $align3 = new GtkAlignment(0.5, 0.5, 0.75, 0.75); //Creating a new button $button3 = new GtkButton('This one is centered and extends to occupy 75% of the empty space. Try resizing the window!'); //Adding button3 to the third GtkAlignment container $align3->add($button3); //Packing the GtkAlignment container into the GtkVBox $vbox->pack_start($align3, true, true); //Preparing the window $win = new gtkwindow(); $win->set_position(Gtk::WIN_POS_CENTER); $win->set_title('GtkAlignment demo'); //Adding the GtkVBox to the window $win->add($vbox); //Connecting the destroy signal $win->connect_simple('destroy',array('gtk','main_quit')); //Showing the window's content $win->Show_All(); //Main loop Gtk::main(); ?>