A5_OWNER_DRAW_LIST_FMT()

Syntax

Formatted_List as C = A5_OWNER_DRAW_LIST_FMT( List as C, Formatting as P )

Argument

Description

List

The list to format.

Formatting

A ‘dot’ variable that sets various advanced formatting options.

Description

The A5_OWNER_DRAW_LIST_FMT() function takes a CR-LF delimited list, and adds ‘owner-draw’ formatting command to the list. (See the Learning Xdialog book for information on ‘owner-draw’ formatting options).

Supported By

Alpha Five Version 5 and Above

Limitations

Desktop applications only.

Example

? temp_list

= paul|smith|boston

john|king|denver

harry|jones|johannesburg

gretta|henry|new york

Dim format as P

‘set tab stops at 1 inch and 2 inches.

Format.tab_stops="1,2"

Format.odd_row_color="White"

Format.even_row_color="Blue White"

Format.odd_selected_color="Dark Blue"

Format.even_selected_color="Dark Blue"

Format.font="Arial,8"

Format.font_color_unselected="Black"

Format.font_color_selected="White"

Format.group_size=1

Format.number_rows=.f.

Format.alternating_bands=.t.

temp_list = a5_owner_draw_list_fmt(temp_list, Format)

? temp_list

= {F=Arial,8}{C=Black,White}{B=White,Dark Blue}paul{T=1}smith{T=2}boston

{F=Arial,8}{C=Black,White}{B=Blue White,Dark Blue}john{T=1}king{T=2}denver

{F=Arial,8}{C=Black,White}{B=White,Dark Blue}harry{T=1}jones{T=2}johannesburg

{F=Arial,8}{C=Black,White}{B=Blue White,Dark Blue}gretta{T=1}henry{T=2}new york

The following is an example that uses A5_OWNER_DRAW_LIST_FMT() when resizing the columns of a list box.

DIM SHARED v as C

DIM SHARED varC_result as C

DELETE a_v

DIM a_v[2] as C

dim temp_list as C

temp_list = <<%list%

Mike | Jones

Bill | Doe

%list%

col1 = .4 ' percent of total in column 1

col2 = .6 ' percent of total in column 2

Dim format as P

Format.tab_stops="1"

Format.odd_row_color="White"

Format.even_row_color="White"

Format.odd_selected_color="Dark Blue"

Format.even_selected_color="Dark Blue"

Format.font="Arial,8"

Format.font_color_unselected="Black"

Format.font_color_selected="White"

Format.lastbutton="OK"

Format.group_size=1

Format.number_rows=.f.

Format.alternating_bands=.f.

temp_list2 = a5_owner_draw_list_fmt(temp_list,Format)

a_v.initialize(temp_list2)

ok_button_label = "&Change"

cancel_button_label = "&Exit"

ui_modeless_dlg_box("Manage Accounts",<<%dlg%

{watch=manage_accounts.Size_Get() !size_changed}

{mdichild=manage_accounts}

{region}

{stretch=width,height}

Type prompt here:| [%d;O={@@}%.40,5v^#a_v];

{endregion};

{stretch=}

{stickto=left,bottom}

{region}

<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>

{endregion};

%dlg%,<<%code%

if a_dlg_button = "size_Changed"

    a_dlg_button = ""

    Format.tab_stops=".5"

    sz = SYS_ID_SIZE_GET("manage Accounts")

    width = val(substr(sz,1,at("x",sz)-1))

    Format.tab_stops = alltrim(str((width-.5)*col1,6,4))

    temp_list2 = a5_owner_draw_list_fmt(temp_list,Format)

    a_v.initialize(temp_list2)

end if

if a_dlg_button = "cancel"

    ui_modeless_dlg_close("Manage Accounts")

end if

%code%)

See Also

Xdialog Function Reference, Learning XdialogA5_EXPORT_PROPS_TO_CMDS()