GdauiFormattedEntry

GdauiFormattedEntry

Functions

Properties

char * format Read / Write
char * mask Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkEntry
                ╰── GdauiEntry
                    ╰── GdauiFormattedEntry

Implemented Interfaces

GdauiFormattedEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.

Description

Functions

gdaui_formatted_entry_new ()

GtkWidget *
gdaui_formatted_entry_new (const gchar *format,
                           const gchar *mask);

Creates a new GdauiFormattedEntry widget.

Characters in format are of two types: writeable: writeable characters which will be replaced with and underscore and where text will be entered fixed: every other characters are fixed characters, where text cant' be edited, and will be displayed AS IS

Possible values for writeable characters are:

  • '0': digits

  • '9': digits excluded 0

  • '@': alpha

  • '^': alpha converted to upper case

  • '#': alphanumeric

  • '*': any char

if mask is not NULL, then it should only contains the follogin characters, which are used side by side with format 's characters:

  • '_': the corresponding character in format is actually used as a writable character

  • '-': the corresponding character in format is actually used as a writable character, but the character will be removed from gdaui_formatted_entry_get_text()'s result if it was not filled by the user

  • ' ': the corresponding character in format will not be considered as a writable character but as a non writable character

it is then interpreted in the following way: for a character C in format , if the character at the same position in mask is the space character (' '), then C will not interpreted as a writable format character as defined above. mask does not be to have the same length as format .

Parameters

format

a format string

 

mask

a mask string, or NULL.

[nullable]

Returns

the newly created GdauiFormattedEntry widget.

[transfer full]


gdaui_formatted_entry_get_text ()

gchar *
gdaui_formatted_entry_get_text (GdauiFormattedEntry *entry);

Get entry 's contents. This function is similar to gdaui_get_text() except that it optionnally uses the information contained in mask when gdaui_formatted_entry_new() was called to format the output differently.

Parameters

entry

a GdauiFormattedEntry widget

 

Returns

a new string, or NULL.

[transfer full]


GdauiFormattedEntryInsertFunc ()

void
(*GdauiFormattedEntryInsertFunc) (GdauiFormattedEntry *entry,
                                  gunichar insert_char,
                                  gint virt_pos,
                                  gpointer data);

gdaui_formatted_entry_set_insert_func ()

void
gdaui_formatted_entry_set_insert_func (GdauiFormattedEntry *entry,
                                       GdauiFormattedEntryInsertFunc insert_func,
                                       gpointer data);

Specifies that entry should call insert_func when the user wants to insert a char which is anot allowed, to perform other actions

Parameters

entry

a GdauiFormattedEntry widget

 

insert_func

a GdauiFormattedEntryInsertFunc, or NULL.

[nullable][scope notified]

data

a pointer which will be passed to insert_func .

[nullable]

Types and Values

GDAUI_TYPE_FORMATTED_ENTRY

#define GDAUI_TYPE_FORMATTED_ENTRY                 (gdaui_formatted_entry_get_type ())

struct GdauiFormattedEntryClass

struct GdauiFormattedEntryClass {
	GdauiEntryClass             parent_class;
};

GdauiFormattedEntry

typedef struct _GdauiFormattedEntry GdauiFormattedEntry;

Property Details

The “format” property

  “format”                   char *

Owner: GdauiFormattedEntry

Flags: Read / Write

Default value: NULL


The “mask” property

  “mask”                     char *

Owner: GdauiFormattedEntry

Flags: Read / Write

Default value: NULL