Smart Field Controls

Syntax

[%P= Function [ ;I= Bitmap ] %. Width Varname ]

Arguments

Function

Type: C. Any valid Xbasic function with appropriate arguments.

Bitmap

Type: C. Optional. The name of a bitmap to put at the right edge of the control.

Width

Type: N. The width of the control.

Varname

Type: A. The variable that receives the return value from the function.

Description

Alpha Anywhere allows you to define your own smart fields, which look at drop-down edit combo boxes.

  • Color 

    [%P=ui_select_color( Color_Variable )]
    [%P=ui_select_color2( Color_Variable )]
  • Date 

    [%P=popup.calendar( dtoc( Date_Variable ) );I=popup.calendar%.30 Date_Variable ]
  • Field 

    [%P=ui_get_fieldname( Table_Name ) )%.30 Field_Variable ]
  • File 

    [%f File_Type_Filter %.50 Filename_Variable ]
  • Filter 

    [%P=ui_get_filter( Title, Prompt, Default_Filter, Table )%.50 Filter_Variable ]
  • Font 

    [%P=ui_get_font( Title, Font_Variable )%.30 Font_Variable ]
  • Number 

    [%P=popup.calculator( Number_Variable );I=popup.calculator%.30 Number_Variable ]
    [%s Low_Value, High_Value %.30 Number_Variable ]
  • Order 

    [%P=ui_get_order( Title, Prompt, Default_Order, Table )%.50 Order_Variable ]
  • Path 

    [%p=ui_get_path( Title, Default_Drive, Default_Path );I=$a5_folder%.50 Path_Variable ]

Example 

The following examples show how to create font picker and color picker smart controls.

Font |%P=ui_get_font()%.30font;
Color: |%P=ui_select_color(color)%.30color; 
Color: |%P=ui_select_color2(color)%.30color;

'Note that a color picker can also be created using the 'C' directive.
Color: |%C%.30color3;


The complete Xdialog syntax is:

ui_dlg_box("Smart Fields",<<%dlg%
Font |%P=ui_get_font()%.30font;
Color: |%P=ui_select_color(color)%.30color; 
Color: |%P=ui_select_color2(color2)%.30color2;
Color: |%C%.30color3;
%dlg%)

If you are using array variables with square bracket notation, you must escape the trailing "]" bracket with a backslash "\" when the variable is referenced by a control. However, it must not be modified when used inside a function call. For example:

Font: |[%P=ui_get_font("",dat.font[textindex].font)%.30dat.fonttextindex\.font!fontevent_*];
I=$a5_palette%.24dat.rowrow\.color!colorevent_*];

See Also