1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="gtkextra-GtkDataFormat">
<refmeta>
<refentrytitle role="top_of_page" id="gtkextra-GtkDataFormat.top_of_page">GtkDataFormat</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTKEXTRA Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkDataFormat</refname>
<refpurpose>a data formatting library</refpurpose>
</refnamediv>
<refsect1 id="gtkextra-GtkDataFormat.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
</entry><entry role="function_name"><link linkend="gtk-data-format">gtk_data_format</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
</entry><entry role="function_name"><link linkend="gtk-data-format-remove">gtk_data_format_remove</link> <phrase role="c_punctuation">()</phrase></entry></row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gtkextra-GtkDataFormat.includes"><title>Includes</title><synopsis>#include <gtkextra.h>
</synopsis></refsect1>
<refsect1 id="gtkextra-GtkDataFormat.description" role="desc">
<title role="desc.title">Description</title>
<para>the widget property 'dataformat' may contain formatting
instructions for the field contents. Any unrecognized
formatting instruction is silently skipped.</para>
<para>The formatting process should always be reversible. Thus
formatting can be applied when input focus leaves a field and
removed again when the focus enters a field, without the need
of an additional content buffer.</para>
<para>the library can be easily extended by adding more
instructions to the list above.</para>
</refsect1>
<refsect1 id="gtkextra-GtkDataFormat.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-data-format" role="function">
<title>gtk_data_format ()</title>
<indexterm zone="gtk-data-format"><primary>gtk_data_format</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gtk_data_format (<parameter>const <link linkend="gchar"><type>gchar</type></link> *str</parameter>,
<parameter>const <link linkend="gchar"><type>gchar</type></link> *dataformat</parameter>);</programlisting>
<para>format <parameter>str</parameter>
according to <parameter>dataformat</parameter>
.</para>
<para>formatting instructions:</para>
<para>'' (the empty string) does no formatting at all.</para>
<para>'int8' is formatted as a singed 8-bit integer value with
optional '-' sign.</para>
<para>'int16' is formatted as a signed 16-bit integer with optional
'-' sign.</para>
<para>'int32' is formatted as a signed 32-bit integer with optional
'-' sign.</para>
<para>'money' is formatted as a double float value with 2 decimal
digits and 1000s-separators</para>
<para>'float,N' is formatted as a double float value with N decimal
digits and 1000s-separators</para>
<para>'bit' is formatted as a boolean value [0,1].</para>
<refsect3 id="gtk-data-format.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>the string to be formatted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dataformat</para></entry>
<entry role="parameter_description"><para>formatting instructions</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-data-format.returns" role="returns">
<title>Returns</title>
<para> a pointer to an internal static buffer, with the
formatted data</para>
</refsect3></refsect2>
<refsect2 id="gtk-data-format-remove" role="function">
<title>gtk_data_format_remove ()</title>
<indexterm zone="gtk-data-format-remove"><primary>gtk_data_format_remove</primary></indexterm>
<programlisting language="C"><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *
gtk_data_format_remove (<parameter>const <link linkend="gchar"><type>gchar</type></link> *str</parameter>,
<parameter>const <link linkend="gchar"><type>gchar</type></link> *dataformat</parameter>);</programlisting>
<para>reverse the effect of <link linkend="gtk-data-format"><type>gtk_data_format</type></link>, i.e. remove all
formatting characters, apply trailing dash</para>
<refsect3 id="gtk-data-format-remove.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>the string to be unformatted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dataformat</para></entry>
<entry role="parameter_description"><para>formatting instructions</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-data-format-remove.returns" role="returns">
<title>Returns</title>
<para> a pointer to an internal static buffer, with the
unformatted data</para>
</refsect3></refsect2>
</refsect1>
<refsect1 id="gtkextra-GtkDataFormat.other_details" role="details">
<title role="details.title">Types and Values</title>
</refsect1>
</refentry>
|