14#ifndef MOUSEWATCHERPARAMETER_H
15#define MOUSEWATCHERPARAMETER_H
28class EXPCL_PANDA_TFORM MouseWatcherParameter {
30 INLINE MouseWatcherParameter();
31 INLINE MouseWatcherParameter(
const MouseWatcherParameter &other);
32 INLINE
void operator = (
const MouseWatcherParameter &other);
33 INLINE ~MouseWatcherParameter();
38 INLINE
void set_candidate(
const std::wstring &candidate_string,
39 size_t highlight_start,
43 INLINE
void set_mouse(
const LPoint2 &mouse);
73 void output(std::ostream &out)
const;
78 std::wstring _candidate_string;
79 size_t _highlight_start;
80 size_t _highlight_end;
89 F_has_keycode = 0x008,
90 F_has_candidate = 0x010,
91 F_is_keyrepeat = 0x020,
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
void set_keyrepeat(bool flag)
Sets the state of the "keyrepeat" flag.
const ModifierButtons & get_modifier_buttons() const
Returns the set of modifier buttons that were being held down while the event was generated.
bool has_candidate() const
Returns true if this parameter has an associated candidate string, false otherwise.
std::string get_candidate_string_encoded() const
Returns the candidate string associated with this event.
const std::wstring & get_candidate_string() const
Returns the candidate string associated with this event.
ButtonHandle get_button() const
Returns the mouse or keyboard button associated with this event.
void set_mouse(const LPoint2 &mouse)
Sets the mouse position that was current at the time the event was generated.
void set_keycode(int keycode)
Sets the keycode associated with this event, if any.
size_t get_highlight_end() const
Returns one more than the last highlighted character in the candidate string.
bool has_mouse() const
Returns true if this parameter has an associated mouse position, false otherwise.
void set_modifier_buttons(const ModifierButtons &mods)
Sets the modifier buttons that were being held while this event was generated.
const LPoint2 & get_mouse() const
Returns the mouse position at the time the event was generated, in the normalized range (-1 .
bool has_keycode() const
Returns true if this parameter has an associated keycode, false otherwise.
bool is_keyrepeat() const
Returns true if the button-down even was generated due to keyrepeat, or false if it was an original b...
size_t get_highlight_start() const
Returns the first highlighted character in the candidate string.
size_t get_cursor_pos() const
Returns the position of the user's edit cursor within the candidate string.
void set_candidate(const std::wstring &candidate_string, size_t highlight_start, size_t higlight_end, size_t cursor_pos)
Sets the candidate string associated with this event, if any.
void set_outside(bool flag)
Sets the state of the "outside" flag.
bool has_button() const
Returns true if this parameter has an associated mouse or keyboard button, false otherwise.
int get_keycode() const
Returns the keycode associated with this event.
bool is_outside() const
Returns true if the mouse was outside the region at the time the event was generated,...
void set_button(const ButtonHandle &button)
Sets the mouse or keyboard button that generated this event, if any.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.