Explorer Style Dialog Box

Description

A description and example on how to use the explorer style dialog box.

images/XD_Explorer_Style_Dialog_Box.gif

Example

Note the special syntax for the tab. {T=1.5:0-20} indicates a moveable tab stop whose initial position is at 1.5 inches. The tab stop can be moved in the range 0 to 20 inches. A tab definition of {T=1.5:.5-20}, for example, would indicate that when the column is resized, it cannot be moved left of the .5 inch tab position. Note the special syntax for the tab: {T=$1} means that the actual tab position will be obtained from the first tab in the referenced format string. In the case of the list box control the directive F=fmt tells the list box that the reference format string is called fmt.

dim fmt as C
fmt = "{A=1C}First{T=1.5:0-20}{A=2C}Second{T=3.5:0-20}{A=3C}Third"
data = <<%a%
Row 1 Column 1{T=$1}Row 1 Column 2{T=$2}Row 1 Column 3
Row 2 Column 1{T=$1}Row 2 Column 2{T=$2}Row 2 Column 3
Row 3 Column 1{T=$1}Row 3 Column 2{T=$2}Row 3 Column 3
Row 4 Column 1{T=$1}Row 4 Column 2{T=$2}Row 4 Column 3
Row 5 Column 1{T=$1}Row 5 Column 2{T=$2}Row 5 Column 3
Row 6 Column 1{T=$1}Row 6 Column 2{T=$2}Row 6 Column 3
%a%
tree_data = <<%a%
+3Users and Groups.1+2Users
+3Users and Groups.1+2Groups
%a%
tree_images = <<%a%
$a5_folder
$a5_folder_open
user_object16x16_0
%a%
dim item as N
item = 1
dim dlg_title as C
dlg_title = "Resizeable List Box Columns"
ui_dlg_box(dlg_title,<<%dlg%
{font=tahoma,8}
{wrap=100}
This script demonstrates how to create an 'Explorer' style dialog box.;
{lf};
{font=}
{stretch=height,width}
[%S=LX;I=@tree_images%.30,20^<tree_data]
{hslider}
{beginembedded}
{stickto=left}
{stretch=width,height}
{watch=ui_dlg_control_anchor_from_pos(dlg_title)!resize}
<%O={@@};B=ILG;F=fmt%100=fmt!click>;
[%O={@@};F=fmt;R;%.100,18item^#data]
{endembedded}
;
{stretch=top}
<10&Close!close>;
%dlg%,<<%code%
if a_dlg_button = "resize" then
    'This event is fired whenever the mouse is over the column headings.
    'The event fires whether or not the columns are actually resized.
    a_dlg_button = ""
end if
if a_dlg_button = "click" then
    a_dlg_button = ""
    control = ui_dlg_control_anchor_from_pos(dlg_title)
    ui_msg_box("","User pressed: " + control)
end if
%code%)

Limitations

Desktop applications only.

See Also