EditorWindow Class Reference

#include <c4d_tooldata.h>

详细描述

Helper class for the editor's window.

公共成员函数

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 (void)
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)

私有成员函数

  EditorWindow ()
  ~EditorWindow ()

构造函数 & 析构函数文档编制

◆  EditorWindow()

EditorWindow () private

◆  ~EditorWindow()

~ EditorWindow () private

成员函数文档编制

◆  DrawXORLine()

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

Deprecated . Draws an XOR line in the editor view.

参数
[in] x1 Start X coordinate of the line.
[in] y1 Start Y coordinate of the line.
[in] x2 End X coordinate of the line.
[in] y2 End Y coordinate of the line.

◆  MouseDragStart()

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

Initializes a mouse dragging loop.
例如:

BaseContainer bc; BaseContainer device; win-> MouseDragStart (button, mx, my, MOUSEDRAGFLAGS::NOMOVE ); while (win-> MouseDrag (&dx, &dy, &device)== MOUSEDRAGRESULT::CONTINUE ) { }
参数
[in] button State of the mouse buttons, passed through from ToolData::MouseInput 。见 BFM_INPUT .
[in] mx Mouse X coordinate.
[in] my Mouse Y coordinate.
[in] flag The mouse drag flags: MOUSEDRAGFLAGS

◆  MouseDrag()

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

Checks for the mouse drag status.

注意
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 ; ... }
参数
[in] mx Mouse X coordinate.
[in] my Mouse Y coordinate.
[in] channels A container to take the state of the mouse: PEN
返回
The mouse drag result: MOUSEDRAGRESULT

◆  MouseDragEnd()

MOUSEDRAGRESULT MouseDragEnd ( void  )

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

返回
The mouse drag result: MOUSEDRAGRESULT

◆  BfGetInputState()

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

Gets the status of an input device.

参数
[in] askdevice The device: BFM_INPUT_MOUSE or BFM_INPUT_KEYBOARD .
[in] askchannel The channel: BFM_INPUT
[in] res A container to take the input state results.
返回
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.

参数
[in] askdevice The device: BFM_INPUT_MOUSE or BFM_INPUT_KEYBOARD .
[in] res A container to take the input event results.
返回
true if successful, otherwise false .

◆  IsHotkeyDown()

HOTKEYFLAGS IsHotkeyDown ( Int32   id )

Checks the standard navigation hotkeys.

参数
[in] id The hotkey to check: HOTKEY
返回
A value != 0 if the hotkey is pressed.

◆  StatusSetText()

void StatusSetText ( const maxon::String str )

Sets the text in the status bar.

参数
[in] str The 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 .

参数
[in,out] x The screen X coordinate. Assigned the converted local coordinate.
[in,out] y The screen Y coordinate. Assigned the converted local coordinate.
返回
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 .

参数
[in,out] x The local X coordinate. Assigned the screen coordinate.
[in,out] y The local Y coordinate. Assigned the screen coordinate.
返回
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 .

参数
[in,out] x The global window X coordinate. Assigned the local coordinate.
[in,out] y The global window Y coordinate. Assigned the local coordinate.
返回
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 .

参数
[in,out] x The local X coordinate. Assigned the global window coordinate.
[in,out] y The local Y coordinate. Assigned the global window coordinate.
返回
true if the coordinates were converted, otherwise false .
MOUSEDRAGFLAGS::NOMOVE
@ NOMOVE
MouseDrag() returns MOUSEDRAGRESULT::CONTINUE even if mouse is not moved. Otherwise MouseDrag() only ...
QCTRL
@ QCTRL
定义: gui.h:39
BFM_INPUT_QUALIFIER
@ BFM_INPUT_QUALIFIER
Int32 A bit mask with the qualifiers at the time when the event occurred: QUALIFIER
定义: gui.h:684
EditorWindow::MouseDrag
MOUSEDRAGRESULT MouseDrag(Float *mx, Float *my, BaseContainer *channels)
QSHIFT
@ QSHIFT
Shift.
定义: gui.h:38
EditorWindow::MouseDragStart
void MouseDragStart(Int32 button, Float mx, Float my, MOUSEDRAGFLAGS flag)
MOUSEDRAGRESULT::CONTINUE
@ CONTINUE
Drag still in progress.
BaseContainer::GetInt32
Int32 GetInt32(Int32 id, Int32 preset=0) const
定义: c4d_basecontainer.h:303
BaseContainer
定义: c4d_basecontainer.h:46