32 nassertr(text_node != (
TextNode *)NULL,
false);
50 nassertr(text_node != (
TextNode *)NULL,
string());
66 nassertr(text_node != (
TextNode *)NULL,
string());
140 if (_cursor_position != position) {
141 _cursor_position = position;
142 _cursor_stale =
true;
155 return _cursor_position;
167 return _cursor_def.get_x();
179 return _cursor_def.get_y();
196 _max_chars = max_chars;
230 _max_width = max_width;
231 _text_geom_stale =
true;
257 nassertv(num_lines >= 1);
258 _num_lines = num_lines;
259 _text_geom_stale =
true;
286 _blink_rate = blink_rate;
337 _cursor_keys_active = flag;
350 return _cursor_keys_active;
370 if (_obscure_mode != flag) {
371 _obscure_mode = flag;
372 _text_geom_stale =
true;
385 return _obscure_mode;
401 if (_overflow_mode != flag) {
402 _overflow_mode = flag;
403 _text_geom_stale =
true;
404 _cursor_stale =
true;
417 return _overflow_mode;
440 _candidate_active = candidate_active;
451 return _candidate_active;
474 _candidate_inactive = candidate_inactive;
485 return _candidate_inactive;
509 return "acceptfailed-";
557 return "cursormove-";
645 _text_geom_stale =
true;
683 _accept_enabled = enabled;
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.
PN_stdfloat get_cursor_Y() const
Returns the node position y of the cursor.
void set_max_width(PN_stdfloat max_width)
Sets the maximum width of all characters that may be typed into the entry.
const TextGraphic * get_graphic(int n) const
Returns the graphic object at the indicated position in the pre-wordwrapped string.
int get_num_characters() const
Returns the number of characters of text, before wordwrapping.
string get_overflow_event() const
Returns the event name that will be thrown when too much text is attempted to be entered into the PGE...
static string get_type_prefix()
Returns the prefix that is used to define the type event for all PGEntries.
PN_stdfloat get_cursor_X() const
Returns the node position x of the cursor.
void clear_cursor_def()
Removes all the children from the cursor_def node, in preparation for adding a new definition...
void set_candidate_active(const string &candidate_active)
Specifies the name of the TextProperties structure added to the TextPropertiesManager that will be us...
const string & get_id() const
Returns the unique ID assigned to this PGItem.
int get_max_chars() const
Returns the current maximum number of characters that may be typed into the entry, or 0 if there is no limit.
static string get_cursormove_prefix()
Returns the prefix that is used to define the cursor event for all PGEntries.
const string & get_candidate_active() const
See set_candidate_active().
wchar_t get_character(int n) const
Returns the character at the indicated position in the pre-wordwrapped string.
wstring decode_text(const string &text) const
Returns the given wstring decoded to a single-byte string, via the current encoding system...
string get_erase_event() const
Returns the event name that will be thrown whenever the user erases characters in the text...
void set_cursor_keys_active(bool flag)
Sets whether the arrow keys (and home/end) control movement of the cursor.
void set_accept_enabled(bool enabled)
Sets whether the input may be accepted–use to disable submission by the user.
bool get_obscure_mode() const
Specifies whether obscure mode is enabled.
int get_cursor_position() const
Returns the current position of the cursor.
double get_frame_time(Thread *current_thread=Thread::get_current_thread()) const
Returns the time in seconds as of the last time tick() was called (typically, this will be as of the ...
string get_accept_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the entry is accepted normally.
wstring get_plain_wtext() const
Returns the text currently displayed within the entry, without any embedded properties characters...
const string & get_candidate_inactive() const
See set_candidate_inactive().
bool get_overflow_mode() const
Specifies whether overflow mode is enabled.
int get_num_characters() const
Returns the number of characters of text in the entry.
PN_stdfloat get_max_width() const
Returns the current maximum width of the characters that may be typed into the entry, or 0 if there is no limit.
static string get_accept_failed_prefix()
Returns the prefix that is used to define the accept failed event for all PGEntries.
bool get_cursor_keys_active() const
Returns whether the arrow keys are currently set to control movement of the cursor; see set_cursor_ke...
string get_text() const
Returns the text currently displayed within the entry.
bool set_wtext(const wstring &wtext)
Accepts a new text string and associated properties structure, and precomputes the wordwrapping layou...
string get_cursormove_event() const
Returns the event name that will be thrown whenever the cursor moves.
NodePath attach_new_node(PandaNode *node, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Attaches a new node, with or without existing parents, to the scene graph below the referenced node o...
string encode_wtext(const wstring &wtext) const
Encodes a wide-text string into a single-char string, according to the current encoding.
void set_num_lines(int num_lines)
Sets the number of lines of text the PGEntry will use.
void set_candidate_inactive(const string &candidate_inactive)
Specifies the name of the TextProperties structure added to the TextPropertiesManager that will be us...
string get_plain_text() const
Returns the text currently displayed within the entry, without any embedded properties characters...
string get_type_event() const
Returns the event name that will be thrown whenever the user extends the text by typing.
void set_blink_rate(PN_stdfloat blink_rate)
Sets the number of times per second the cursor will blink while the entry has keyboard focus...
int get_num_lines() const
Returns the number of lines of text the PGEntry will use, if _max_width is not 0. ...
bool set_text(const string &text)
Changes the text currently displayed within the entry.
Similar to MutexHolder, but for a light reentrant mutex.
static string get_overflow_prefix()
Returns the prefix that is used to define the overflow event for all PGEntries.
static string get_accept_prefix()
Returns the prefix that is used to define the accept event for all PGEntries.
wstring get_wtext() const
Returns the text currently displayed within the entry.
NodePath get_cursor_def()
Returns the Node that will be rendered to represent the cursor.
bool set_wtext(const wstring &wtext)
Changes the text currently displayed within the entry.
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
const TextProperties & get_properties() const
Returns the default TextProperties that are applied to the text in the absence of any nested property...
The primary interface to this module.
This defines the set of visual properties that may be assigned to the individual characters of the te...
void set_cursor_position(int position)
Sets the current position of the cursor.
wstring get_wtext() const
Returns a wstring that represents the contents of the text.
string get_accept_failed_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the entry cannot accept an input. ...
const TextGraphic * get_graphic(int n) const
Returns the graphic object at the indicated position in the pre-wordwrapped string.
void set_overflow_mode(bool flag)
Specifies whether overflow mode should be enabled.
static string get_erase_prefix()
Returns the prefix that is used to define the erase event for all PGEntries.
TextNode * get_text_def(int state) const
Returns the TextNode that will be used to render the text within the entry when the entry is in the i...
wstring get_plain_wtext() const
Returns a wstring that represents the contents of the text, without any embedded properties character...
void set_max_chars(int max_chars)
Sets the maximum number of characters that may be typed into the entry.
const TextProperties & get_properties(int n) const
Returns the TextProperties in effect for the object at the indicated position in the pre-wordwrapped ...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void set_obscure_mode(bool flag)
Specifies whether obscure mode should be enabled.
This defines a special model that has been constructed for the purposes of embedding an arbitrary gra...
PN_stdfloat get_blink_rate() const
Returns the number of times per second the cursor will blink, or 0 if the cursor is not to blink...
wchar_t get_character(int n) const
Returns the character at the indicated position in the entry.