Sublist Selector

back to main page

What is the Sublist selection Object?

First, it is a Visual Prolog custom control. Sublist selector is a simple object which allows to select some elements from the list. We use this object across various projects and found it very handy, when user need to make selection of different options.

This object is built into VP Studio Shell. Click here to download VP Studio Shell samples.

Steps to include object into your project:

 

VP Studio Shell

Description

Create custom control with the name:

 

cl_select_sublist

 

Edit Object properties using VP Studio Shell property editor.

You can define:

  • Font

  • Background color

  • Alignment

  • Left List items

  • Right List Items

  • Title

Preview object and compile application.

The parameters entered will be passed to the object in final application.

The same data will appear in your compiled application

 

Note: Grid object classes are not compatible with previous version of Sublist Selector Object.
If you are user of VP Studio Setup utility - please use follow instruction below.

To include Grid Object - open your project.inc file with VP Studio Setup utility and checkout necessary options. Please save your changes and open Visual Prolog project.

(download VIP 5.2 project source)

To include Sublist selection - open your project.inc file with VP Studio Setup utility and checkout Sublist selection options:

 

 Include system object and sublist selection support file

Include the following code into window e_create event:

win_test_eh(_Win,e_Create(_),0):-!,
    select_sublist_register,
     % code for controls creation
......% after all controls have been created

    ObjectWin = win_GetCtlHandle(_Win, idc_select_sublist),
    get_select_sublist_object(ObjectWin,OBJECT),
    SublistParams = sublist("Select Sublist",
                 ["1","2","3","6","7"],["4","5"]),
    PEN = pen(2,ps_Solid,color_blue),
    BRUSH = brush(pat_Solid,color_red),
    DRAWMODE = dm_CopyPen,
    Foreground = color_green,
    Background = color_ltgray,
    BK_MODE = bk_Transparent,
    DrawTools = draw_tools(PEN,BRUSH,DRAWMODE,
                 Font,Foreground,Background,BK_MODE),
    win_SetDrawTools(_Win,Drawtools),
    Object:sublist_set_params(SublistParams),

If Sublist object has been used in dialog - include the following code in dialog e_create event:

dlg_select_sublist_eh(_Win,e_Create(_CreationData),0):-!,
    ObjectWin = win_GetCtlHandle(_Win, idc_select_sublist),
    get_select_sublist_object(ObjectWin,Object),
    SublistParams = sublist("Select Sublist",
               ["1","2","3","6","7"],["4","5"]),
    Object:sublist_set_params(SublistParams),
    !.


Copyright 1998-2002 EDMGROUP (Australia)

Last Updated: April 17, 2002