Panda3D
|
This is sent along as a parameter to most events generated for a region to indicate the mouse and button state for the event. More...
#include "mouseWatcherParameter.h"
Public Types | |
enum | Flags { F_has_button = 0x001, F_has_mouse = 0x002, F_is_outside = 0x004, F_has_keycode = 0x008, F_has_candidate = 0x010, F_is_keyrepeat = 0x020 } |
Public Member Functions | |
MouseWatcherParameter (const MouseWatcherParameter &other) | |
ButtonHandle | get_button () const |
Returns the mouse or keyboard button associated with this event. More... | |
const wstring & | get_candidate_string () const |
Returns the candidate string associated with this event. More... | |
string | get_candidate_string_encoded () const |
Returns the candidate string associated with this event. More... | |
string | get_candidate_string_encoded (TextEncoder::Encoding encoding) const |
Returns the candidate string associated with this event. More... | |
size_t | get_cursor_pos () const |
Returns the position of the user's edit cursor within the candidate string. More... | |
size_t | get_highlight_end () const |
Returns one more than the last highlighted character in the candidate string. More... | |
size_t | get_highlight_start () const |
Returns the first highlighted character in the candidate string. More... | |
int | get_keycode () const |
Returns the keycode associated with this event. More... | |
const ModifierButtons & | get_modifier_buttons () const |
Returns the set of modifier buttons that were being held down while the event was generated. More... | |
const LPoint2 & | get_mouse () const |
Returns the mouse position at the time the event was generated, in the normalized range (-1 . More... | |
bool | has_button () const |
Returns true if this parameter has an associated mouse or keyboard button, false otherwise. More... | |
bool | has_candidate () const |
Returns true if this parameter has an associated candidate string, false otherwise. More... | |
bool | has_keycode () const |
Returns true if this parameter has an associated keycode, false otherwise. More... | |
bool | has_mouse () const |
Returns true if this parameter has an associated mouse position, false otherwise. More... | |
bool | is_keyrepeat () const |
Returns true if the button-down even was generated due to keyrepeat, or false if it was an original button down. More... | |
bool | is_outside () const |
Returns true if the mouse was outside the region at the time the event was generated, false otherwise. More... | |
void | operator= (const MouseWatcherParameter &other) |
void | output (ostream &out) const |
void | set_button (const ButtonHandle &button) |
Sets the mouse or keyboard button that generated this event, if any. More... | |
void | set_candidate (const 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. More... | |
void | set_keycode (int keycode) |
Sets the keycode associated with this event, if any. More... | |
void | set_keyrepeat (bool flag) |
Sets the state of the "keyrepeat" flag. More... | |
void | set_modifier_buttons (const ModifierButtons &mods) |
Sets the modifier buttons that were being held while this event was generated. More... | |
void | set_mouse (const LPoint2 &mouse) |
Sets the mouse position that was current at the time the event was generated. More... | |
void | set_outside (bool flag) |
Sets the state of the "outside" flag. More... | |
Public Attributes | |
ButtonHandle | _button |
wstring | _candidate_string |
size_t | _cursor_pos |
int | _flags |
size_t | _highlight_end |
size_t | _highlight_start |
short | _keycode |
ModifierButtons | _mods |
LPoint2 | _mouse |
This is sent along as a parameter to most events generated for a region to indicate the mouse and button state for the event.
Definition at line 31 of file mouseWatcherParameter.h.
|
inline |
Returns the mouse or keyboard button associated with this event.
If has_button(), above, returns false, this returns ButtonHandle::none().
Definition at line 181 of file mouseWatcherParameter.I.
References is_keyrepeat().
Referenced by PGEntry::accept(), PGEntry::accept_failed(), PGButton::click(), has_button(), PGButton::press(), PGSliderBar::press(), PGEntry::press(), PGItem::press(), PGButton::release(), PGSliderBar::release(), and PGItem::release().
|
inline |
Returns the candidate string associated with this event.
If has_candidate(), above, returns false, this returns the empty string.
Definition at line 238 of file mouseWatcherParameter.I.
References get_candidate_string_encoded().
Referenced by PGEntry::candidate(), and has_candidate().
|
inline |
Returns the candidate string associated with this event.
If has_candidate(), above, returns false, this returns the empty string.
Definition at line 250 of file mouseWatcherParameter.I.
References TextEncoder::get_default_encoding().
Referenced by get_candidate_string().
|
inline |
Returns the candidate string associated with this event.
If has_candidate(), above, returns false, this returns the empty string.
Definition at line 262 of file mouseWatcherParameter.I.
References TextEncoder::encode_wtext(), and get_highlight_start().
|
inline |
Returns the position of the user's edit cursor within the candidate string.
Definition at line 295 of file mouseWatcherParameter.I.
References get_modifier_buttons().
Referenced by PGEntry::candidate(), and get_highlight_end().
|
inline |
Returns one more than the last highlighted character in the candidate string.
Definition at line 284 of file mouseWatcherParameter.I.
References get_cursor_pos().
Referenced by PGEntry::candidate(), and get_highlight_start().
|
inline |
Returns the first highlighted character in the candidate string.
Definition at line 273 of file mouseWatcherParameter.I.
References get_highlight_end().
Referenced by PGEntry::candidate(), and get_candidate_string_encoded().
|
inline |
Returns the keycode associated with this event.
If has_keycode(), above, returns false, this returns 0.
Definition at line 215 of file mouseWatcherParameter.I.
References has_candidate().
Referenced by has_keycode(), and PGEntry::keystroke().
|
inline |
Returns the set of modifier buttons that were being held down while the event was generated.
Definition at line 306 of file mouseWatcherParameter.I.
References has_mouse().
Referenced by get_cursor_pos().
|
inline |
Returns the mouse position at the time the event was generated, in the normalized range (-1 .
. 1). It is valid to call this only if has_mouse() returned true.
Definition at line 329 of file mouseWatcherParameter.I.
References has_mouse(), and is_outside().
Referenced by has_mouse(), PGSliderBar::move(), PGSliderBar::press(), and PGSliderBar::recompute().
|
inline |
Returns true if this parameter has an associated mouse or keyboard button, false otherwise.
Definition at line 169 of file mouseWatcherParameter.I.
References get_button().
Referenced by PGEntry::press(), and set_outside().
|
inline |
Returns true if this parameter has an associated candidate string, false otherwise.
Definition at line 226 of file mouseWatcherParameter.I.
References get_candidate_string().
Referenced by PGEntry::candidate(), and get_keycode().
|
inline |
Returns true if this parameter has an associated keycode, false otherwise.
Definition at line 204 of file mouseWatcherParameter.I.
References get_keycode().
Referenced by is_keyrepeat(), and PGEntry::keystroke().
|
inline |
Returns true if this parameter has an associated mouse position, false otherwise.
Definition at line 317 of file mouseWatcherParameter.I.
References get_mouse().
Referenced by get_modifier_buttons(), get_mouse(), PGSliderBar::press(), and PGSliderBar::recompute().
|
inline |
Returns true if the button-down even was generated due to keyrepeat, or false if it was an original button down.
Definition at line 193 of file mouseWatcherParameter.I.
References has_keycode().
Referenced by get_button(), and PGItem::press().
|
inline |
Returns true if the mouse was outside the region at the time the event was generated, false otherwise.
This is only valid for "release" type events.
Definition at line 342 of file mouseWatcherParameter.I.
Referenced by get_mouse(), and PGButton::release().
|
inline |
Sets the mouse or keyboard button that generated this event, if any.
Definition at line 72 of file mouseWatcherParameter.I.
References set_keyrepeat().
Referenced by MouseWatcher::note_activity().
|
inline |
Sets the candidate string associated with this event, if any.
Definition at line 112 of file mouseWatcherParameter.I.
References set_modifier_buttons().
Referenced by MouseWatcher::note_activity(), and set_keycode().
|
inline |
Sets the keycode associated with this event, if any.
Definition at line 100 of file mouseWatcherParameter.I.
References set_candidate().
Referenced by MouseWatcher::note_activity(), and set_keyrepeat().
|
inline |
Sets the state of the "keyrepeat" flag.
This is true if a button-press event was generated due to keyrepeat, or false if it is an original button press.
Definition at line 86 of file mouseWatcherParameter.I.
References set_keycode().
Referenced by set_button().
|
inline |
Sets the modifier buttons that were being held while this event was generated.
Definition at line 129 of file mouseWatcherParameter.I.
References set_mouse().
Referenced by MouseWatcher::note_activity(), and set_candidate().
|
inline |
Sets the mouse position that was current at the time the event was generated.
Definition at line 140 of file mouseWatcherParameter.I.
References set_outside().
Referenced by MouseWatcher::note_activity(), and set_modifier_buttons().
|
inline |
Sets the state of the "outside" flag.
This is true if the mouse was outside the region at the time the event was generated, false otherwise. This only has meaning for "release" events.
Definition at line 154 of file mouseWatcherParameter.I.
References has_button().
Referenced by set_mouse().