MKI_DialogSelectLayer (Dialogs)

www.CAD6.com

C++ Syntax

__int32

MKI_DialogSelectLayer(

 HWND f_hWindow,

 MKI_CONST_INTRECT_PTR f_pButtonRect,

 __int32 f_nCurrent,

 __int32 f_nBasicID,

 __int32 f_nExtraID,

 __int32 f_nEditID );

 

Depending on the user settings, displays either a popup menu or a list dialog offering all available layers for user selection.

 

Parameters

Window

[HWND] Handle of the window or dialog window that is the parent of the selection, i.e. that will receive the selection messages.

ButtonRect

[MKI_CONST_INTRECT_PTR] Address of a rectangle structure that contains the bounding rectangle of a button that is used to open the selection. The appearing popup menu will be aligned to that button. If ButtonRect is nullptr, the popup menu will be center to the current mouse cursor position.

Current

[__int32] Index of the currently active layer. This index will be used to set a checkmark in front of the corresponding menu entry. Set this value to -1 in order to set the checkmark in front of the entry "Current" (if ExtraID is non-zero) or to any value below -1 in order to set no checkmark at all.

BasicID

[__int32] Basic command ID of the popup menu's entries. If the user selects the layer with the index zero, the resulting command ID will be BasicID. If the layer's index is 5, the resulting command ID will be BasicID+5 and so on.

ExtraID

[__int32] Command ID of the popup menu's "Current" entry. If this value is non-zero, the popup menu will contain the entry "Current". If the user selects that entry, the resulting command ID will be ExtraID. If ExtraID is zero, the popup menu will not contain the entry "Current".

EditID

[__int32] Command ID of the popup menu's "Edit..." entry. If this value is non-zero, the popup menu will contain the entry "Edit...". If the user selects that entry, the resulting command ID will be EditID. If EditID is zero, the popup menu will not contain the entry "Edit...".

 

Return Value

Command ID of the command the user selected, 0 if no item was selected, or -1 if an error occurred.

 

The user does not necessarily have to select any entry of the popup menu / list dialog and can close it by pressing the ESC key or by clicking outside the popup menu. Make sure that no "active" menu entry has an ID of 0, because its selection would be reported as "user cancellation".

 

CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH