26 nassertr(text_node !=
nullptr,
false);
41 nassertr(text_node !=
nullptr, std::string());
54 nassertr(text_node !=
nullptr, std::string());
112 if (_cursor_position != position) {
113 _cursor_position = position;
114 _cursor_stale =
true;
125 return _cursor_position;
135 return _cursor_def.get_x();
145 return _cursor_def.get_y();
159 _max_chars = max_chars;
186 _max_width = max_width;
187 _text_geom_stale =
true;
208 nassertv(num_lines >= 1);
209 _num_lines = num_lines;
210 _text_geom_stale =
true;
233 _blink_rate = blink_rate;
274 _cursor_keys_active = flag;
284 return _cursor_keys_active;
300 if (_obscure_mode != flag) {
301 _obscure_mode = flag;
302 _text_geom_stale =
true;
312 return _obscure_mode;
324 if (_overflow_mode != flag) {
325 _overflow_mode = flag;
326 _text_geom_stale =
true;
327 _cursor_stale =
true;
337 return _overflow_mode;
355 _candidate_active = candidate_active;
364 return _candidate_active;
382 _candidate_inactive = candidate_inactive;
391 return _candidate_inactive;
411 return "acceptfailed-";
450 return "cursormove-";
520 _text_geom_stale =
true;
551 _accept_enabled = enabled;
std::string get_plain_text() const
Returns the text currently displayed within the entry, without any embedded properties characters.
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.
static std::string get_accept_prefix()
Returns the prefix that is used to define the accept event for all PGEntries.
void set_max_width(PN_stdfloat max_width)
Sets the maximum width of all characters that may be typed into the entry.
std::string get_cursormove_event() const
Returns the event name that will be thrown whenever the cursor moves.
const TextGraphic * get_graphic(int n) const
Returns the graphic object at the indicated position in the pre-wordwrapped string.
void set_candidate_inactive(const std::string &candidate_inactive)
Specifies the name of the TextProperties structure added to the TextPropertiesManager that will be us...
int get_num_characters() const
Returns the number of characters of text, before wordwrapping.
std::string get_accept_failed_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the entry cannot accept an input.
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.
int get_max_chars() const
Returns the current maximum number of characters that may be typed into the entry,...
static std::string get_type_prefix()
Returns the prefix that is used to define the type event for all PGEntries.
void set_candidate_active(const std::string &candidate_active)
Specifies the name of the TextProperties structure added to the TextPropertiesManager that will be us...
wchar_t get_character(int n) const
Returns the character at the indicated position in the pre-wordwrapped string.
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.
bool set_wtext(const std::wstring &wtext)
Accepts a new text string and associated properties structure, and precomputes the wordwrapping layou...
int get_cursor_position() const
Returns the current position of the cursor.
std::wstring get_plain_wtext() const
Returns the text currently displayed within the entry, without any embedded properties characters.
const std::string & get_id() const
Returns the unique ID assigned to this PGItem.
get_properties
Returns the default TextProperties that are applied to the text in the absence of any nested property...
const std::string & get_candidate_active() const
See set_candidate_active().
static std::string get_cursormove_prefix()
Returns the prefix that is used to define the cursor event for all PGEntries.
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,...
bool get_cursor_keys_active() const
Returns whether the arrow keys are currently set to control movement of the cursor; see set_cursor_ke...
get_frame_time
Returns the time in seconds as of the last time tick() was called (typically, this will be as of the ...
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...
std::string get_accept_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the entry is accepted normally.
void set_num_lines(int num_lines)
Sets the number of lines of text the PGEntry will use.
static std::string get_overflow_prefix()
Returns the prefix that is used to define the overflow event for all PGEntries.
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.
Similar to MutexHolder, but for a light reentrant mutex.
std::string encode_wtext(const std::wstring &wtext) const
Encodes a wide-text string into a single-char string, according to the current encoding.
std::wstring get_wtext() const
Returns the text currently displayed within the entry.
static std::string get_accept_failed_prefix()
Returns the prefix that is used to define the accept failed event for all PGEntries.
NodePath get_cursor_def()
Returns the Node that will be rendered to represent the cursor.
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
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.
bool set_wtext(const std::wstring &wtext)
Changes the text currently displayed within the entry.
std::string get_erase_event() const
Returns the event name that will be thrown whenever the user erases characters in the text.
std::wstring get_wtext() const
Returns a wstring that represents the contents of the text.
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.
const std::string & get_candidate_inactive() const
See set_candidate_inactive().
std::wstring decode_text(const std::string &text) const
Returns the given wstring decoded to a single-byte string, via the current encoding system.
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...
std::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.
bool set_text(const std::string &text)
Changes the text currently displayed within 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...
std::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...
std::string get_type_event() const
Returns the event name that will be thrown whenever the user extends the text by typing.
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.
std::string get_text() const
Returns the text currently displayed within the entry.
static std::string get_erase_prefix()
Returns the prefix that is used to define the erase event for all PGEntries.
wchar_t get_character(int n) const
Returns the character at the indicated position in the entry.