Xbasic
UI_INFO_DLG_DEF_CLIENT_WIDTH Function
Syntax
Width as C = UI_INFO_DLG_DEF_CLIENT_WIDTH(C dialog_format)
Arguments
- dialog_format
Xdialog code that produces a visible control
Description
Get the width of the client area of a of the dialog in inches based on a dialog definition.
Discussion
The UI_INFO_DLG_DEF_CLIENT_WIDTH() function tells you how wide the specified embedded Xdialog will be.
Example
This script demonstrates how the size of a parent dialog box can be automatically calculated 'so that the embedded dialog box that it contains can be displayed correctly, without clipping 'any portion of the embedded dialog box.
list = a5.Color_Enum() str = <<%dlg% {nocaption} [.100,5^#list]; %dlg% w = ui_info_dlg_def_client_width(str) h = ui_info_dlg_def_client_height(str) ui_msg_box("Size of embedded dialog: ","width: " + w + crlf()+ "height : " + h) dlg_body = <<%dlg% {startup=init} {embedded=w",h":window} %dlg% dlg_body = stritran(dlg_body,"h","" + h) dlg_body = stritran(dlg_body,"w","" + w) ui_msg_box("Parent Dialog Body - with placeholders for Height and Width replaced",dlg_body) ui_dlg_box("Dialog Box with Embedded Dialog - Parent Dialog is correctly sized",dlg_body,<<%code% if a_dlg_button = "init" then ui_modeless_dlg_box("window",str,"1=1") end if %code%)
In this example, the lastname prompt and the field are on separate lines (because of the semi-colon after lastname: ). The Xdialog will be 2.40625 inches wide.
? ui_info_dlg_def_width("lastname:; [.40name]") = 2.40625
See Also