EditorWindow Class Reference

#include <c4d_tooldata.h>

Detailed Description

Helper class for the editor's window.

Public Member Functions

void DrawXORLine (Int32 x1, Int32 y1, Int32 x2, Int32 y2)
 
void MouseDragStart (Int32 button, Float mx, Float my, MOUSEDRAGFLAGS flag)
 
MOUSEDRAGRESULT MouseDrag (Float *mx, Float *my, BaseContainer *channels)
 
MOUSEDRAGRESULT MouseDragEnd ()
 
Bool BfGetInputState (Int32 askdevice, Int32 askchannel, BaseContainer *res)
 
Bool BfGetInputEvent (Int32 askdevice, BaseContainer *res)
 
HOTKEYFLAGS IsHotkeyDown (Int32 id)
 
void StatusSetText (const maxon::String &str)
 
Bool Screen2Local (Int32 *x, Int32 *y)
 
Bool Local2Screen (Int32 *x, Int32 *y)
 
Bool Global2Local (Int32 *x, Int32 *y)
 
Bool Local2Global (Int32 *x, Int32 *y)
 

Private Member Functions

 EditorWindow ()
 
 ~EditorWindow ()
 

Constructor & Destructor Documentation

◆ EditorWindow()

EditorWindow ( )
private

◆ ~EditorWindow()

~EditorWindow ( )
private

Member Function Documentation

◆ DrawXORLine()

void DrawXORLine ( Int32  x1,
Int32  y1,
Int32  x2,
Int32  y2 
)

Deprecated. Draws an XOR line in the editor view.

Parameters
[in]x1Start X coordinate of the line.
[in]y1Start Y coordinate of the line.
[in]x2End X coordinate of the line.
[in]y2End Y coordinate of the line.

◆ MouseDragStart()

void MouseDragStart ( Int32  button,
Float  mx,
Float  my,
MOUSEDRAGFLAGS  flag 
)

Initializes a mouse dragging loop.
For example:

win->MouseDragStart(button, mx, my, MOUSEDRAGFLAGS::NOMOVE);
while (win->MouseDrag(&dx, &dy, &device)==MOUSEDRAGRESULT::CONTINUE)
{
}
Definition: c4d_basecontainer.h:47
@ NOMOVE
MouseDrag() returns MOUSEDRAGRESULT::CONTINUE even if mouse is not moved. Otherwise MouseDrag() only ...
@ CONTINUE
Drag still in progress.
Parameters
[in]buttonState of the mouse buttons, passed through from ToolData::MouseInput. See BFM_INPUT.
[in]mxMouse X coordinate.
[in]myMouse Y coordinate.
[in]flagThe mouse drag flags: MOUSEDRAGFLAGS

◆ MouseDrag()

MOUSEDRAGRESULT MouseDrag ( Float mx,
Float my,
BaseContainer channels 
)

Checks for the mouse drag status.

Note
To check for qualifiers, see the channels container:
while (win->MouseDrag(&dx, &dy, &channels)==MOUSEDRAGRESULT::CONTINUE)
{
if (channels.GetInt32(BFM_INPUT_QUALIFIER) & QSHIFT) shift = true;
if (channels.GetInt32(BFM_INPUT_QUALIFIER) & QCTRL) ctrl = true;
...
}
@ BFM_INPUT_QUALIFIER
Int32 A bit mask with the qualifiers at the time when the event occurred: QUALIFIER
Definition: gui.h:699
@ QCTRL
Definition: gui.h:41
@ QSHIFT
Shift.
Definition: gui.h:40
Parameters
[in]mxMouse X coordinate.
[in]myMouse Y coordinate.
[in]channelsA container to take the state of the mouse: PEN
Returns
The mouse drag result: MOUSEDRAGRESULT

◆ MouseDragEnd()

MOUSEDRAGRESULT MouseDragEnd ( )

Checks why the mouse drag ended. Allows to perform any undo operations needed if the user canceled the drag.

Returns
The mouse drag result: MOUSEDRAGRESULT

◆ BfGetInputState()

Bool BfGetInputState ( Int32  askdevice,
Int32  askchannel,
BaseContainer res 
)

Gets the status of an input device.

Parameters
[in]askdeviceThe device: BFM_INPUT_MOUSE or BFM_INPUT_KEYBOARD.
[in]askchannelThe channel: BFM_INPUT
[in]resA container to take the input state results.
Returns
true if successful, otherwise false.

◆ BfGetInputEvent()

Bool BfGetInputEvent ( Int32  askdevice,
BaseContainer res 
)

Gets the status of an input device from the event queue if present.

Parameters
[in]askdeviceThe device: BFM_INPUT_MOUSE or BFM_INPUT_KEYBOARD.
[in]resA container to take the input event results.
Returns
true if successful, otherwise false.

◆ IsHotkeyDown()

HOTKEYFLAGS IsHotkeyDown ( Int32  id)

Checks the standard navigation hotkeys.

Parameters
[in]idThe hotkey to check: HOTKEY
Returns
A value != 0 if the hotkey is pressed.

◆ StatusSetText()

void StatusSetText ( const maxon::String str)

Sets the text in the status bar.

Parameters
[in]strThe text for the status bar.

◆ Screen2Local()

Bool Screen2Local ( Int32 x,
Int32 y 
)

Transforms screen coordinates (relative to the top left corner of the system screen) to local coordinates (relative to the top left corner of a user area). Stores the result in *x and *y.

Parameters
[in,out]xThe screen X coordinate. Assigned the converted local coordinate.
[in,out]yThe screen Y coordinate. Assigned the converted local coordinate.
Returns
true if the coordinates were converted, otherwise false.

◆ Local2Screen()

Bool Local2Screen ( Int32 x,
Int32 y 
)

Transforms local coordinates (relative to the top left corner of a user area) to screen coordinates (relative to the top left corner of the system screen). Stores the result in *x and *y.

Parameters
[in,out]xThe local X coordinate. Assigned the screen coordinate.
[in,out]yThe local Y coordinate. Assigned the screen coordinate.
Returns
true if the coordinates were converted, otherwise false.

◆ Global2Local()

Bool Global2Local ( Int32 x,
Int32 y 
)

Transforms global window coordinates (relative to the top left corner of the application window) to local coordinates (relative to the top left corner of a user area). Stores the result in *x and *y.

Parameters
[in,out]xThe global window X coordinate. Assigned the local coordinate.
[in,out]yThe global window Y coordinate. Assigned the local coordinate.
Returns
true if the coordinates were converted, otherwise false.

◆ Local2Global()

Bool Local2Global ( Int32 x,
Int32 y 
)

Transforms local coordinates (relative to the top left corner of the user area) to global window coordinates (relative to the top left corner of the application window). Stores the result in *x and *y.

Parameters
[in,out]xThe local X coordinate. Assigned the global window coordinate.
[in,out]yThe local Y coordinate. Assigned the global window coordinate.
Returns
true if the coordinates were converted, otherwise false.