nGuiDragBox Class Reference
[Graphical User Interface]
#include <nguidragbox.h>
Inheritance diagram for nGuiDragBox:

Detailed Description
Implements a drag box as 2d screen space rectangle.While the dragbox widget is enabled, left-clicking and moving the mouse will open the drag box. The following events will be generated:
DragBoxStarted- a drag box operation has startedDragBoxFinished- a drag box operation has been successfully finishedDragBoxCancelled- drag box operation has been cancelledDragBoxUpdated- the drag box has been updated
If the drag box is smaller then the size threshold, no drag box will be rendered.
(C) 2004 RadonLabs GmbH
Definition at line 26 of file nguidragbox.h.
Public Member Functions | |
| nGuiDragBox () | |
| constructor | |
| virtual | ~nGuiDragBox () |
| destructor | |
| void | SetDragThreshold (float s) |
| set the drag size threshold in screen space units | |
| float | GetDragThreshold () const |
| get the drag size threshold in screen space units | |
| virtual void | OnShow () |
| called when widget is becoming visible | |
| virtual void | OnHide () |
| called when widget is becoming invisible | |
| virtual bool | OnButtonDown (const vector2 &mousePos) |
| handle button down | |
| virtual bool | OnButtonUp (const vector2 &mousePos) |
| handle button up | |
| virtual bool | OnRButtonDown (const vector2 &mousePos) |
| handle right button down | |
| virtual bool | OnMouseMoved (const vector2 &mousePos) |
| handle mouse move | |
| virtual bool | Render () |
| rendering | |
| bool | IsDragging () const |
| return true if currently dragging | |
| bool | IsDragBoxValid () const |
| return true if the drag box data is valid | |
| const rectangle & | GetDragBox2D () const |
| return the current drag box in screen space | |
| bool | IsWorldCoordInDragBox (const vector3 &pos) const |
| return true if world space position is inside current drag box | |
| void | CancelDragging () |
| manually cancel the current dragging operation | |
Constructor & Destructor Documentation
|
|
constructor
Definition at line 14 of file nguidragbox_main.cc. |
|
|
destructor
Definition at line 26 of file nguidragbox_main.cc. |
Member Function Documentation
|
|
set the drag size threshold in screen space units Set the mouse-move distance from the start point until a drag operation is valid in screen space. To set the threshold in pixels, compute numPixels / displayResolution. Definition at line 82 of file nguidragbox.h. |
|
|
get the drag size threshold in screen space units Returns the drag threshold distance. Definition at line 94 of file nguidragbox.h. |
|
|
called when widget is becoming visible Registers the drag box as event listener. Reimplemented from nGuiWidget. Definition at line 36 of file nguidragbox_main.cc. |
|
|
called when widget is becoming invisible Unregisters the drag box as event listener. Reimplemented from nGuiWidget. Definition at line 47 of file nguidragbox_main.cc. |
|
|
handle button down Called when left mouse button is pressed down. This initializes a new drag operation and emits a DragBoxStarted event Reimplemented from nGuiWidget. Definition at line 59 of file nguidragbox_main.cc. |
|
|
handle button up Called when left mouse button is released. If the drag box is valid (if the release pos is farther away from the start pos then the drag threshold), a DragBoxSelection event will be generated. Reimplemented from nGuiWidget. Definition at line 78 of file nguidragbox_main.cc. |
|
|
handle right button down Called when right mouse button is pressed. If a drag operation is in progress, a DragBoxCancelled event will be generated. Reimplemented from nGuiWidget. Definition at line 99 of file nguidragbox_main.cc. |
|
|
handle mouse move Called when mouse is moved. If a valid drag operation is in progress, a DragBoxUpdated event will be generated. Reimplemented from nGuiWidget. Definition at line 129 of file nguidragbox_main.cc. |
|
|
rendering Render the drag box. We assume that our widget rectangle has been updated by UpdateDragBox(). Reimplemented from nGuiWidget. Definition at line 155 of file nguidragbox_main.cc. |
|
|
return true if currently dragging
Definition at line 104 of file nguidragbox.h. |
|
|
return true if the drag box data is valid
Definition at line 114 of file nguidragbox.h. |
|
|
return the current drag box in screen space
Definition at line 124 of file nguidragbox.h. |
|
|
return true if world space position is inside current drag box Return true if a world space position is inside the current drag box. Definition at line 213 of file nguidragbox_main.cc. |
|
|
manually cancel the current dragging operation Manually cancel the drag box. Definition at line 115 of file nguidragbox_main.cc. |
The documentation for this class was generated from the following files: