-
首页
-
C4D R23.110 C++ SDK
函数
|
Int32
|
SizePixChr
(
Int32
pixels,
Int32
chars)
|
Int32
|
SizePix
(
Int32
pixels)
|
Int32
|
SizeChr
(
Int32
chars)
|
void
|
MessageDialog
(const
maxon::String
&str)
|
void
|
MessageDialog
(
Int32
id)
|
void
|
MessageDialog
(
Int32
id, const
maxon::String
&p1)
|
void
|
MessageDialog
(
Int32
id, const
maxon::String
&p1, const
maxon::String
&p2)
|
Bool
|
QuestionDialog
(const
maxon::String
&str)
|
Bool
|
QuestionDialog
(
Int32
id)
|
Bool
|
QuestionDialog
(
Int32
id, const
maxon::String
&p1)
|
Bool
|
QuestionDialog
(
Int32
id, const
maxon::String
&p1, const
maxon::String
&p2)
|
Bool
|
GetInputEvent
(
Int32
askdevice,
BaseContainer
&res)
|
Bool
|
GetInputState
(
Int32
askdevice,
Int32
askchannel,
BaseContainer
&res)
|
Int32
|
ShowPopupMenu
(CDialog *cd,
Int32
screenx,
Int32
screeny, const
BaseContainer
&bc,
Int32
flags=
POPUP_RIGHT
|
POPUP_EXECUTECOMMANDS
,
Int32
*res_mainid=nullptr)
|
Bool
|
RemoveLastCursorInfo
(
LASTCURSORINFOFUNC
func)
|
String
|
Shortcut2String
(
Int32
shortqual,
Int32
shortkey)
|
String
|
Shortcut2String
(const
BaseContainer
&sc)
|
向量
|
GetGuiWorldColor
(
Int32
cid)
|
Bool
|
GetIconCoordInfo
(
Int32
&id, const
Char
*ident)
|
Bool
|
GetInterfaceIcon
(
Int32
type,
Int32
id_x,
Int32
id_y,
Int32
id_w,
Int32
id_h,
IconData
&d)
|
Bool
|
GeIsTabletMode
()
|
Float
|
GetMouseMoveDelta
()
|
void
|
SetBakeStatus
(
Bool
state)
|
Bool
|
GetBakeStatus
()
|
Macro Definition Documentation
◆
IDC_OK
◆
IDC_CANCEL
◆
FIRST_POPUP_ID
The first valid sub-menu item ID.
-
另请参阅
-
ShowPopupMenu
◆
MENU_ALLOWSUBMENUCOMMAND
#define MENU_ALLOWSUBMENUCOMMAND
|
◆
IDM_CM_CLOSEWINDOW
#define IDM_CM_CLOSEWINDOW
|
The menu ID for a close menu item. Can be used in dialog menus.
◆
MAXTIME
The default maximum time value. Equal to
1.0
hours at
30
fps i.e. about
2.77
hours.
◆
C4DGUIPTR
ID used for
GadgetPtr
when initialized with a gadget pointer.
◆
C4DGUINOPTR
ID used for
GadgetPtr
when not initialized with a gadget pointer.
◆
C4DGUISCROLLPARENT
#define C4DGUISCROLLPARENT
|
ID used for parent
GadgetPtr
when retrieving the dimensions of the Dialog within a scrollgroup.
◆
MOUSEPOS
Mouse position constant for
ShowPopupMenu()
.
Typedef Documentation
◆
OBSOLETE
Function Documentation
◆
SizePixChr()
Combines
SizePix()
and
SizeChr()
functions. The returned value is interpreted as a number of characters/lines plus a number of pixels.
-
注意
-
The number of characters for
chars
has to be multiplied by
10
.
For example if a size of
3
characters is needed, pass
3
*
10
,或
30
for
chars
.
-
参数
-
[in]
|
pixels
|
The pixel dimension.
|
[in]
|
chars
|
The number of characters.
|
-
返回
-
The size.
◆
SizePix()
Bakes a pixel size so that it can be used to specify dialog control dimension.
-
参数
-
[in]
|
pixels
|
The pixel dimension.
|
-
返回
-
The size.
◆
SizeChr()
Bakes a character count so that it can be used to specify dialog control dimension.
Calculates how many characters will fit in a control for widths, and how many standard lines will fit for heights.
-
注意
-
The number of characters for
chars
has to be multiplied by
10
.
For example if a size of
3
characters is needed, pass
3
*
10
,或
30
for
chars
.
-
参数
-
[in]
|
chars
|
The number of characters.
|
-
返回
-
The size.
◆
MessageDialog()
[1/4]
Opens a standard message dialog with an exclamation point icon and an
OK
button.
-
参数
-
[in]
|
str
|
The message to show.
|
◆
MessageDialog()
[2/4]
void MessageDialog
|
(
|
Int32
|
id
|
)
|
|
Opens a standard dialog with an exclamation point icon and an
OK
button.
-
参数
-
[in]
|
id
|
The message to show, specified as a string ID in the global ::resource object.
|
◆
MessageDialog()
[3/4]
Opens a standard dialog with an exclamation point icon and an
OK
button.
-
参数
-
[in]
|
id
|
The message to show, specified as a string ID in the global ::resource object, including one phrase that is inserted at #'s in the string.
|
[in]
|
p1
|
The phrase to insert.
|
◆
MessageDialog()
[4/4]
Opens a standard dialog with an exclamation point icon and an
OK
button.
-
参数
-
[in]
|
id
|
The message to show, specified as a string ID in the global ::resource object, including two phrases that are inserted at #'s in the string.
|
[in]
|
p1
|
The first phrase to insert.
|
[in]
|
p2
|
The second phrase to insert.
|
◆
QuestionDialog()
[1/4]
Opens a standard question dialog with a question mark icon and
Yes/
No
buttons
.
-
参数
-
[in]
|
str
|
The message to show.
|
-
返回
-
true
if the user answered
Yes
, otherwise
false
.
◆
QuestionDialog()
[2/4]
Opens a standard question dialog with a question mark icon and
Yes/
No
buttons
.
-
参数
-
[in]
|
id
|
The message to show, specified as a string ID in the global ::resource object.
|
-
返回
-
true
if the user answered
Yes
, otherwise
false
.
◆
QuestionDialog()
[3/4]
Opens a standard question dialog with a question mark icon and
Yes/
No
buttons
.
-
参数
-
[in]
|
id
|
The message to show, specified as a string ID in the global ::resource object, including one phrase that is inserted at #'s in the string.
|
[in]
|
p1
|
The phrase to insert.
|
-
返回
-
true
if the user answered
Yes
, otherwise
false
.
◆
QuestionDialog()
[4/4]
Opens a standard question dialog with a question mark icon and
Yes/
No
buttons
.
-
参数
-
[in]
|
id
|
The message to show, specified as a string ID in the global ::resource object, including two phrases that are inserted at #'s in the string.
|
[in]
|
p1
|
The first phrase to insert.
|
[in]
|
p2
|
The second phrase to insert.
|
-
返回
-
true
if the user answered
Yes
, otherwise
false
.
◆
GetInputEvent()
Gets the next input event for a certain device from the event queue.
If the return value is
true
, the container stored in
res
is like an input event message, otherwise no state was available.
For a list of valid devices and channels, see
Input Events
.
-
参数
-
[in]
|
askdevice
|
The device to poll.
|
[in]
|
res
|
The result container.
|
-
返回
-
true
if an input event could be retrieved, otherwise
false
.
◆
GetInputState()
Polls a certain channel of a device for the current input state.
If the return value is
true
, the container stored in
res
is like an input event message, otherwise no state was available.
For a list of valid devices and channels, see
Input Events
.
-
参数
-
[in]
|
askdevice
|
The device to poll.
|
[in]
|
askchannel
|
The channel of the device.
|
[in]
|
res
|
The result container.
|
-
返回
-
true
if an input state could be retrieved, otherwise
false
.
◆
ShowPopupMenu()
Displays a popup menu.
The menu is defined by adding string items sequentially to a base container. (The order the items are set in the container determines their order in the menu.)
The ID of the string item determines its function:
-
A string with ID=
0
gives a separator
bc.
InsData
(0,
String
(
""
));
-
A string with ID=
1
sets the name of the menu (used for sub-menus)
bc.
SetString
(1,
"Menu name"
);
-
IDs in the range
1000
to
899999
inserts a
Cinema 4D
命令
bc.
SetString
(
id
,
"CMD"
);
For a list of IDs, see the
c4d_symbols.coh
file. A special case is the
IDM_CM_CLOSEWINDOW
ID that will close the current dialog.
-
The same applies to plugin IDs of plugins that have a menu entry (everything above
1000000
)
bc.
SetString
(pluginid,
"CMD"
);
-
The IDs that are left, between
900000
(
FIRST_POPUP_ID
) 和
999999
, can be used for custom menu items
enum
{
FIRST_ITEM =
FIRST_POPUP_ID
,
SECOND_ITEM,
THIRD_ITEM
};
bc.
SetString
(FIRST_ITEM,
"First item"
);
bc.
SetString
(SECOND_ITEM,
"Second item"
);
bc.
SetString
(THIRD_ITEM,
"Third item"
);
Sub-menus are simply inserted as sub-containers
enum
{
NEW_ENTRY =
FIRST_POPUP_ID
,
INSERT_NEW,
INSERT_DOC,
INSERT_OBJ
};
BaseContainer
mainmenu;
mainmenu.
SetString
(NEW_ENTRY,
"New"
);
BaseContainer
submenu;
submenu.
SetString
(1,
"Insert new"
);
submenu.
SetString
(INSERT_DOC,
"Document"
);
submenu.
SetString
(INSERT_OBJ,
"Object"
);
mainmenu.
SetContainer
(INSERT_NEW, submenu);
-
Disabled and checked items are marked with flags at the end of the name
bc.
SetString
(...,
"Disabled&d&"
);
bc.
SetString
(...,
"Checked&c&"
);
-
参数
-
[in]
|
cd
|
The internal parent dialog, or
nullptr
.
|
[in]
|
screenx
|
The popup X position in screen pixels, or
MOUSEPOS
to popup where the cursor is.
|
[in]
|
screeny
|
The popup Y position in screen pixels, or
MOUSEPOS
to popup where the cursor is.
|
[in]
|
bc
|
The base container with the menu items.
|
[in]
|
flags
|
The popup menu flags:
POPUP
|
[in,out]
|
res_mainid
|
The main id or
nullptr
if the id is returned normally by the function.
|
-
返回
-
The ID of the selected item, or
0
if nothing was selected.
Sometimes this is a a sub-id of a command, for instance if a command plugin returns a container with sub-items. In this case the main id is passed to
res_mainid
.
◆
RemoveLastCursorInfo()
Sets the callback invoked when mouse cursor leaves a user area.
-
注意
-
Useful to remove any highlighted element on mouse over.
-
参数
-
[in]
|
func
|
The last mouse cursor info callback. It should simply send
BFM_CURSORINFO_REMOVE
to the user area for the mouse leave event.
|
◆
Shortcut2String()
[1/2]
Converts a shortcut to a readable string.
-
参数
-
[in]
|
shortqual
|
The shortcut qualifier.
|
[in]
|
shortkey
|
The shortcut key.
|
-
返回
-
The shortcut string.
◆
Shortcut2String()
[2/2]
Converts a shortcut to a readable string.
-
参数
-
[in]
|
sc
|
The shortcut container.
|
-
返回
-
The shortcut string.
◆
GetGuiWorldColor()
Gets a GUI color from its constant ID.
-
参数
-
[in]
|
cid
|
The color ID. See COLOR constants.
|
-
返回
-
The GUI color.
◆
GetIconCoordInfo()
Converts an icon resource identity string into an ID.
-
参数
-
[in]
|
id
|
The ID of the icon resource string.
|
[in]
|
ident
|
The icon resource identity string. Look them up in the resource file for schemes.
|
-
返回
-
true
if the icon resource identity string was found, otherwise
false
.
◆
GetInterfaceIcon()
Retrieves the icon for an interface element.
-
参数
-
[in]
|
type
|
The icon type:
INTERFACE_ICON_TYPE
|
[in]
|
id_x
|
The X position ID of the icon.
|
[in]
|
id_y
|
The Y position ID of the icon.
|
[in]
|
id_w
|
The width ID of the icon.
|
[in]
|
id_h
|
The height ID of the icon.
|
[out]
|
d
|
Assigned the retrieved icon resource data.
|
-
返回
-
The icon could be retrieved.
◆
GeIsTabletMode()
Returns true when the current/preferred input device is a graphic tablet.
-
由于
-
R20
-
返回
-
True for tablet input.
◆
GetMouseMoveDelta()
Float
GetMouseMoveDelta
|
(
|
|
)
|
|
Retrieves the mouse move delta (threshold) depending on the input device.
-
由于
-
R19
-
返回
-
The mouse move delta.
◆
SetBakeStatus()
void SetBakeStatus
|
(
|
Bool
|
state
|
)
|
|
Private
.
-
由于
-
R16
◆
GetBakeStatus()
Private
.
-
由于
-
R16
void SetString(Int32 id, const maxon::String &s)
定义:
c4d_basecontainer.h:569
GeData * InsData(Int32 id, const GeData &n)
定义:
c4d_basecontainer.h:238
void SetContainer(Int32 id, const BaseContainer &s)
定义:
c4d_basecontainer.h:597
#define FIRST_POPUP_ID
定义:
c4d_gui.h:62
定义:
c4d_basecontainer.h:46