Xbasic

UI_DLG_CONTROL_FROM_POS Function

Syntax

Control_Definition as C = UI_DLG_CONTROL_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 the control from a position - if position is ommitted, use mouse cursor position.

Discussion

The UI_DLG_CONTROL_FROM_POS() function returns the definition of the control that the mouse is over.

Example 

This example tells you where the mouse is by reporting the definition of the control it is over.

dim dlg_title as C
dlg_title = "Where is the Mouse"
ui_dlg_box(dlg_title,<<%dlg%
{wrap=100}
Move the mouse around the dialog. Notice that as you move the mouse, the current control's definition is shown.;
{timer=timer}
{interval=.05}
{line=1,0};
{lf};
{region}
First name: |.20fname;
Last name: |.20lname;
City: |.20city State: .4state Zip: .6zip;
{endregion};
{line=1,0};
{region};
Current control:;
{frame=1,1}
{region}
{text=80,2:current_control};
{endregion};
;
{endregion};
{lf};
<10&OK!ok> <10&Cancel!cancel>;
%dlg%,<<%code%
if a_dlg_button = "timer" then
    a_dlg_button = ""
    current_control = ui_dlg_control_from_pos(dlg_title)
    current_control = remove_blank_lines(current_control)
end if
%code%)

Limitations

Desktop applications only.

See Also