18 #include "pandabase.h"
23 #include "pointerTo.h"
25 #include "clockObject.h"
26 #include "textAssembler.h"
64 virtual void cursormove();
73 void setup(PN_stdfloat width,
int num_lines);
74 void setup_minimal(PN_stdfloat width,
int num_lines);
76 INLINE
bool set_text(
const string &text);
77 INLINE
string get_plain_text()
const;
78 INLINE
string get_text()
const;
80 INLINE
int get_num_characters()
const;
81 INLINE
wchar_t get_character(
int n)
const;
85 INLINE
void set_cursor_position(
int position);
86 INLINE
int get_cursor_position()
const;
88 INLINE PN_stdfloat get_cursor_X()
const;
89 INLINE PN_stdfloat get_cursor_Y()
const;
91 INLINE
void set_max_chars(
int max_chars);
92 INLINE
int get_max_chars()
const;
93 INLINE
void set_max_width(PN_stdfloat max_width);
94 INLINE PN_stdfloat get_max_width()
const;
95 INLINE
void set_num_lines(
int num_lines);
96 INLINE
int get_num_lines()
const;
98 INLINE
void set_blink_rate(PN_stdfloat blink_rate);
99 INLINE PN_stdfloat get_blink_rate()
const;
102 INLINE
void clear_cursor_def();
104 INLINE
void set_cursor_keys_active(
bool flag);
105 INLINE
bool get_cursor_keys_active()
const;
107 INLINE
void set_obscure_mode(
bool flag);
108 INLINE
bool get_obscure_mode()
const;
110 INLINE
void set_overflow_mode(
bool flag);
111 INLINE
bool get_overflow_mode()
const;
113 INLINE
void set_candidate_active(
const string &candidate_active);
114 INLINE
const string &get_candidate_active()
const;
116 INLINE
void set_candidate_inactive(
const string &candidate_inactive);
117 INLINE
const string &get_candidate_inactive()
const;
119 void set_text_def(
int state,
TextNode *node);
120 TextNode *get_text_def(
int state)
const;
125 INLINE
static string get_accept_prefix();
126 INLINE
static string get_accept_failed_prefix();
127 INLINE
static string get_overflow_prefix();
128 INLINE
static string get_type_prefix();
129 INLINE
static string get_erase_prefix();
130 INLINE
static string get_cursormove_prefix();
132 INLINE
string get_accept_event(
const ButtonHandle &button)
const;
133 INLINE
string get_accept_failed_event(
const ButtonHandle &button)
const;
134 INLINE
string get_overflow_event()
const;
135 INLINE
string get_type_event()
const;
136 INLINE
string get_erase_event()
const;
137 INLINE
string get_cursormove_event()
const;
140 INLINE
bool set_wtext(
const wstring &wtext);
141 INLINE wstring get_plain_wtext()
const;
142 INLINE wstring get_wtext()
const;
143 INLINE
void set_accept_enabled(
bool enabled);
144 bool is_wtext()
const;
148 void slot_text_def(
int state);
150 void update_cursor();
151 void show_hide_cursor(
bool visible);
156 int _cursor_position;
158 bool _cursor_visible;
160 wstring _candidate_wtext;
161 size_t _candidate_highlight_start;
162 size_t _candidate_highlight_end;
163 size_t _candidate_cursor_pos;
166 PN_stdfloat _max_width;
169 bool _accept_enabled;
171 string _candidate_active;
172 string _candidate_inactive;
184 bool _text_geom_stale;
185 bool _text_geom_flattened;
196 bool _cursor_keys_active;
200 PN_stdfloat _current_padding;
206 static void init_type() {
208 register_type(_type_handle,
"PGEntry",
209 PGItem::get_class_type());
212 return get_class_type();
214 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A basic node of the scene graph or data graph.
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this node by the indicated matrix, if it means anything to do so...
This is the base class for all the various kinds of gui widget objects.
This is a particular kind of PGItem that handles simple one-line or short multi-line text entries...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
virtual void set_focus(bool focus)
Sets whether the PGItem currently has keyboard focus.
This is a 4-by-4 transform matrix.
This class is not normally used directly by user code, but is used by the TextNode to lay out a block...
The primary interface to this module.
This defines the set of visual properties that may be assigned to the individual characters of the te...
virtual void candidate(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever the user highlights an option in the IME window...
virtual void keystroke(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever the user presses a key.
TypeHandle is the identifier used to differentiate C++ class types.
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
This defines a special model that has been constructed for the purposes of embedding an arbitrary gra...
virtual void set_active(bool active)
Sets whether the PGItem is active for mouse watching.
virtual void press(const MouseWatcherParameter ¶m, bool background)
This is a callback hook function, called whenever a mouse or keyboard button is depressed while the m...