Xbasic

UI_DLG_CONTROL_ANCHOR_FROM_POS Function

Syntax

C UI_DLG_CONTROL_ANCHOR_FROM_POS(C dialog_name[,N x[,N y]])

Arguments

dialog_name

The name of the dialog box.

x

Optional. The horizontal coordinate of the dialog box.

y

Optional. The vertical coordinate of the dialog box.

Description

Get a control anchor from a position - if position is ommitted, use mouse cursor position.

Discussion

The UI_DLG_CONTROL_ANCHOR_FROM_POS() function detects which anchor button receives the button click.

Example

This example shows how the command detects which button is pressed.

buttons1 = "{A=1}Sub-Button1{T=1.5}{A=2}Sub-Button2{T=3}{A=3}Sub-Button3"
ui_modeless_dlg_box("Anchor Points",<<%dlg%
{lf};
<%O={@@};B=M%=buttons1!button1>;
%dlg%,<<%code%
if a_dlg_button = "button1" then
    anchor = ui_dlg_control_anchor_from_pos("Anchor Points")
    ui_msg_box("Note","You just clicked on sub-button " + anchor + " in Button 1")
else
    ui_modeless_dlg_close("Anchor Points")
end if
%code%)

Limitations

Desktop applications only.

See Also