Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Types | Public Member Functions | Static Public Member Functions
MouseWatcherRegion Class Reference

This is the class that defines a rectangular region on the screen for the MouseWatcher. More...

Inheritance diagram for MouseWatcherRegion:
TypedWritableReferenceCount Namable TypedWritable ReferenceCount TypedObject PGMouseWatcherBackground

List of all members.

Public Types

enum  SuppressFlags { SFMouseButton = 1, SFOtherButton = 2, SFAnyButton = 3, SFMousePosition = 4 }

Public Member Functions

 MouseWatcherRegion (string name, VBase4 const frame)
 MouseWatcherRegion (string name, float left, float right, float bottom, float top)
bool getActive ()
 Returns whether the region is active or not.
float getArea ()
 Returns the area of the rectangular region.
VBase4 const getFrame ()
bool getKeyboard ()
 Returns whether the region is interested in global keyboard events; see set_keyboard().
int getSort ()
 Returns the current sorting order of this region.
int getSuppressFlags ()
 Returns the current suppress_flags.
 output (ostream out)
 Outputs the Namable.
 setActive (bool active)
 Sets whether the region is active or not.
 setFrame (VBase4 const frame)
 setFrame (float left, float right, float bottom, float top)
 setKeyboard (bool keyboard)
 Sets whether the region is interested in global keyboard events.
 setSort (int sort)
 Changes the sorting order of this particular region.
 setSuppressFlags (int suppress_flags)
 Sets which events are suppressed when the mouse is over the region.
 write (ostream out, int indent_level)
 write (ostream out)

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This is the class that defines a rectangular region on the screen for the MouseWatcher.


Member Enumeration Documentation

Enumerator:
SFMouseButton 
SFOtherButton 
SFAnyButton 
SFMousePosition 

Constructor & Destructor Documentation

MouseWatcherRegion ( string  name,
VBase4 const  frame 
)
MouseWatcherRegion ( string  name,
float  left,
float  right,
float  bottom,
float  top 
)

Member Function Documentation

bool getActive ( )

Returns whether the region is active or not.

See set_active().

float getArea ( )

Returns the area of the rectangular region.

static TypeHandle getClassType ( ) [static]

Reimplemented from Namable.

Reimplemented in PGMouseWatcherBackground.

VBase4 const getFrame ( )
bool getKeyboard ( )

Returns whether the region is interested in global keyboard events; see set_keyboard().

int getSort ( )

Returns the current sorting order of this region.

See set_sort().

Returns the current suppress_flags.

See set_suppress_flags().

output ( ostream  out)

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented from Namable.

setActive ( bool  active)

Sets whether the region is active or not.

If it is not active, the MouseWatcher will never consider the mouse to be over the region. The region might still receive keypress events if its set_keyboard() flag is true.

setFrame ( VBase4 const  frame)
setFrame ( float  left,
float  right,
float  bottom,
float  top 
)
setKeyboard ( bool  keyboard)

Sets whether the region is interested in global keyboard events.

If this is true, then any keyboard button events will be passed to press() and release() regardless of the position of the mouse onscreen; otherwise, these events will only be passed if the mouse is over the region.

setSort ( int  sort)

Changes the sorting order of this particular region.

The sorting order is used to resolve conflicts in the case of overlapping region; the region with the highest sort value will be preferred, and between regions of the same sort value, the smallest region will be preferred. The default sorting order, if none is explicitly specified, is 0.

setSuppressFlags ( int  suppress_flags)

Sets which events are suppressed when the mouse is over the region.

This is the union of zero or more various SF_* values. Normally, this is 0, indicating that no events are suppressed.

If you set this to a non-zero value, for instance SF_mouse_position, then the mouse position will not be sent along the data graph when the mouse is over this particular region.

write ( ostream  out,
int  indent_level 
)
write ( ostream  out)
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties