14#ifndef MOUSEWATCHERREGION_H
15#define MOUSEWATCHERREGION_H
31class EXPCL_PANDA_TFORM MouseWatcherRegion :
public TypedWritableReferenceCount,
public Namable {
33 INLINE
explicit MouseWatcherRegion(
const std::string &name, PN_stdfloat left, PN_stdfloat right,
34 PN_stdfloat bottom, PN_stdfloat top);
35 INLINE
explicit MouseWatcherRegion(
const std::string &name,
const LVecBase4 &frame);
37 INLINE
void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
38 INLINE
void set_frame(
const LVecBase4 &frame);
39 INLINE
const LVecBase4 &get_frame()
const;
52 SF_mouse_button = 0x001,
53 SF_other_button = 0x002,
54 SF_any_button = 0x003,
55 SF_mouse_position = 0x004,
61 void output(std::ostream &out)
const;
62 void write(std::ostream &out,
int indent_level = 0)
const;
65 MAKE_PROPERTY(frame, get_frame, set_frame);
74 INLINE
bool operator < (
const MouseWatcherRegion &other)
const;
94 F_suppress_flags = 0x0ff,
104 static void init_type() {
105 TypedWritableReferenceCount::init_type();
106 Namable::init_type();
108 TypedWritableReferenceCount::get_class_type(),
109 Namable::get_class_type());
111 virtual TypeHandle get_type()
const {
112 return get_class_type();
114 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
117 static TypeHandle _type_handle;
120INLINE std::ostream &operator << (std::ostream &out,
const MouseWatcherRegion ®ion) {
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
This is the class that defines a rectangular region on the screen for the MouseWatcher.
get_area
Returns the area of the rectangular region.
virtual void move(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever a mouse is moved within the region.
virtual void release(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever a mouse or keyboard button previously depressed wit...
set_suppress_flags
Sets which events are suppressed when the mouse is over the region.
get_sort
Returns the current sorting order of this region.
virtual void keystroke(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever a keystroke is generated by the user.
virtual void exit_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse exits the region.
virtual void press(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever a mouse or keyboard button is depressed while the m...
get_active
Returns whether the region is active or not.
set_keyboard
Sets whether the region is interested in global keyboard events.
get_suppress_flags
Returns the current suppress_flags.
virtual void enter_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse enters the region.
virtual void candidate(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever an IME candidate is highlighted by the user.
virtual void within_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse moves within the boundaries of the region...
set_active
Sets whether the region is active or not.
virtual void without_region(const MouseWatcherParameter ¶m)
This is a callback hook function, called whenever the mouse moves completely outside the boundaries o...
get_keyboard
Returns whether the region is interested in global keyboard events; see set_keyboard().
set_sort
Changes the sorting order of this particular region.
void output(std::ostream &out) const
Outputs the Namable.
TypeHandle is the identifier used to differentiate C++ class types.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.