Ardour
9.0-pre0-582-g084a23a80d
|
#include <entrybuffer.h>
Public Member Functions | |
virtual | ~EntryBuffer () |
GtkEntryBuffer * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkEntryBuffer * | gobj () const |
Provides access to the underlying C GObject. More... | |
GtkEntryBuffer * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
gsize | get_bytes () const |
guint | get_length () const |
Glib::ustring | get_text () const |
void | set_text (const Glib::ustring &text) |
void | set_max_length (int max_length) |
int | get_max_length () const |
guint | insert_text (guint position, const Glib::ustring &text) |
guint | delete_text (guint position, int n_chars) |
void | emit_inserted_text (guint position, const Glib::ustring &text) |
void | emit_deleted_text (guint position, guint n_chars) |
Glib::SignalProxy3< void, guint, const gchar *, guint > | signal_inserted_text () |
Glib::SignalProxy2< void, guint, guint > | signal_deleted_text () |
Glib::PropertyProxy< Glib::ustring > | property_text () |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_text () const |
Glib::PropertyProxy_ReadOnly< guint > | property_length () const |
Glib::PropertyProxy< int > | property_max_length () |
Glib::PropertyProxy_ReadOnly< int > | property_max_length () const |
Static Public Member Functions | |
static GType | get_type () G_GNUC_CONST |
static Glib::RefPtr< EntryBuffer > | create () |
static Glib::RefPtr< EntryBuffer > | create (const Glib::ustring &text) |
Protected Member Functions | |
EntryBuffer () | |
EntryBuffer (const Glib::ustring &text) | |
virtual void | on_inserted_text (guint position, const gchar *chars, guint n_chars) |
This is a default handler for the signal signal_inserted_text(). More... | |
virtual void | on_deleted_text (guint position, guint n_chars) |
This is a default handler for the signal signal_deleted_text(). More... | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gtk::EntryBuffer > | wrap (GtkEntryBuffer *object, bool take_copy=false) |
A Text buffer for the Entry widget.
The EntryBuffer class contains the actual text displayed in an Entry widget.
A single EntryBuffer object can be shared by multiple Entry widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc.
EntryBuffer may be derived from. Such a derived class might allow text to be stored in an alternate location, such as non-pageable memory, useful in the case of important passwords. Or a derived class could integrate with an application's concept of undo/redo.
Definition at line 68 of file entrybuffer.h.
|
virtual |
|
protected |
Create a new EntryBuffer object with no text.
|
explicitprotected |
Create a new EntryBuffer object.
text | Initial buffer text. |
|
static |
Create a new EntryBuffer object with no text.
|
static |
Create a new EntryBuffer object.
text | Initial buffer text. |
guint Gtk::EntryBuffer::delete_text | ( | guint | position, |
int | n_chars | ||
) |
Deletes a sequence of characters from the buffer. n_chars characters are deleted starting at position. If n_chars is negative, then all characters until the end of the text are deleted.
If position or n_chars are out of bounds, then they are coerced to sane values.
Note that the positions are specified in characters, not bytes.
position | Position at which to delete text. |
n_chars | Number of characters to delete. |
void Gtk::EntryBuffer::emit_deleted_text | ( | guint | position, |
guint | n_chars | ||
) |
Used when subclassing Gtk::EntryBuffer
position | Position at which text was deleted. |
n_chars | Number of characters deleted. |
void Gtk::EntryBuffer::emit_inserted_text | ( | guint | position, |
const Glib::ustring & | text | ||
) |
Used when deriving from EntryBuffer.
position | Position at which text was inserted. |
text | Text that was inserted. |
gsize Gtk::EntryBuffer::get_bytes | ( | ) | const |
Retrieves the length in bytes of the buffer. See get_length().
guint Gtk::EntryBuffer::get_length | ( | ) | const |
Retrieves the length in characters of the buffer.
int Gtk::EntryBuffer::get_max_length | ( | ) | const |
Retrieves the maximum allowed length of the text in buffer. See set_max_length().
Glib::ustring Gtk::EntryBuffer::get_text | ( | ) | const |
Retrieves the contents of the buffer.
The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
Definition at line 107 of file entrybuffer.h.
|
inline |
Provides access to the underlying C GObject.
Definition at line 110 of file entrybuffer.h.
GtkEntryBuffer* Gtk::EntryBuffer::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
guint Gtk::EntryBuffer::insert_text | ( | guint | position, |
const Glib::ustring & | text | ||
) |
Inserts text into the contents of the buffer, at position position.
position | The position at which to insert text. |
text | The text to insert into the buffer. |
|
protectedvirtual |
This is a default handler for the signal signal_deleted_text().
|
protectedvirtual |
This is a default handler for the signal signal_inserted_text().
Glib::PropertyProxy_ReadOnly< guint > Gtk::EntryBuffer::property_length | ( | ) | const |
Length of the text currently in the buffer.
Glib::PropertyProxy< int > Gtk::EntryBuffer::property_max_length | ( | ) |
Maximum number of characters for this entry. Zero if no maximum.
Glib::PropertyProxy_ReadOnly< int > Gtk::EntryBuffer::property_max_length | ( | ) | const |
Maximum number of characters for this entry. Zero if no maximum.
Glib::PropertyProxy< Glib::ustring > Gtk::EntryBuffer::property_text | ( | ) |
The contents of the buffer.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::EntryBuffer::property_text | ( | ) | const |
The contents of the buffer.
void Gtk::EntryBuffer::set_max_length | ( | int | max_length | ) |
Sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit.
max_length | The maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536. |
void Gtk::EntryBuffer::set_text | ( | const Glib::ustring & | text | ) |
Sets the text in the buffer. This is roughly equivalent to calling delete_text() and insert_text().
text | The text to set in the buffer. |
Glib::SignalProxy2< void,guint,guint > Gtk::EntryBuffer::signal_deleted_text | ( | ) |
void on_my_deleted_text(guint position, guint n_chars)
Glib::SignalProxy3< void,guint,const gchar*,guint > Gtk::EntryBuffer::signal_inserted_text | ( | ) |
void on_my_inserted_text(guint position, const gchar* chars, guint n_chars)
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |