The following Visual Prolog code defines layout of this application:
|
Desciption |
Visual Prolog Code |
|
Define Checkbox. Note: check box has automatic horizontal alignment. Control handler defined. More about automated alignment here |
/*************** CHECKBOX *************/ VPS_CTRL_DATA_CHECK = vps_checkbox("CheckBox Centered Horizontally", color_yellow,color_blue), CHECK_RCT = rct(2,2,250,50), CHECKBOX_ALIGN = "Center Horizontally", CHECK_CONTROLID = 9999, VPSTUDIO_CHK_HANDLER = vps_hand(vps_control_handler), VPSTUDIO_CONTROL_CHK = vps_ctl(vps_ctrl(wc_custom, VPSTUDIO_CHK_HANDLER,VPS_CTRL_DATA_CHECK,[]), [], vps_border(16776960,4,4,0xFFBBBB,0xBB0000,[]), CHECKBOX_ALIGN,FONT), vps_win_ctrl(VPSTUDIO_CONTROL_CHK, CHECK_RCT,CHECK_CONTROLID,[],[]), |
|
Define Tree View. Note: automatically aligned to the bottom of the parent. |
VPS_CTRL_DATA_TREE = system_support::default_control("cl_tree_view"), VPSTUDIO_CONTROL_TREE = vps_ctl( vps_ctrl(wc_custom,vps_hand(vps_control_handler), VPS_CTRL_DATA_TREE,[]), [], vps_border(16776960,4,4,0xFFBBBB,0xBB0000,[]), ), CONTROLID = 555, vps_win_ctrl(VPSTUDIO_CONTROL_TREE, rct(5,50,VERTICAL_BAR,300),CONTROLID,[],[]), |
|
Define Grid. Note: Automatically aligned to the Right of the parent. |
VPS_CTRL_DATA_GRID = system_support::default_control("cl_grid"), VPSTUDIO_CONTROL_GRID = vps_ctl( vps_ctrl(wc_custom,vps_hand(vps_control_handler), VPS_CTRL_DATA_GRID,[]), [], vps_border(16776960,4,4,0xFFBBBB,0xBB0000,[]), ), GRIDID = 444, vps_win_ctrl(VPSTUDIO_CONTROL_GRID, rct(VERTICAL_BAR,50,400,150),GRIDID,[],[]), |
|
Define hyperlink aligned to the right of the parent |
VPS_CTRL_DATA_HREF = system_support::default_control("hyper_link"), VPSTUDIO_CONTROL_HREF = vps_ctl( vps_ctrl(wc_custom,vps_hand(vps_control_handler), VPS_CTRL_DATA_HREF,[]), [], vps_border(color_red,4,4,0xFFBBBB,0xBB0000,[]), ), vps_win_ctrl(VPSTUDIO_CONTROL_HREF, rct(VERTICAL_BAR,150,400,180),333,[],[]), |
|
Define Properties control aligned to the right bottom of the parent |
VPS_CTRL_DATA_PROP = system_support::default_control("cl_properties"), VPSTUDIO_CONTROL_PROP = vps_ctl( vps_ctrl(wc_custom,vps_hand(vps_control_handler), VPS_CTRL_DATA_PROP,[]), [], vps_border(16776960,4,4,0xFFBBBB,0xBB0000,[]), "Align to parent RightBottom",FONT ), PROPCTRLID = 333, vps_win_ctrl(VPSTUDIO_CONTROL_PROP, rct(VERTICAL_BAR,180,400,300),PROPCTRLID,[],[]), |
|
Define Application as a nested tree of objects. Note: VPS_MAIN_DATA is VPS label with list of child objects, defined BEFORE creation of the control.
Complex trees can be defined and implemented this way. |
TEXTFLAGS = [], ALIGNMENT = "Center Inside Parent", CONTROLID = vps_control_id, VPS_TEXT = vps_text("", TEXTFLAGS), VPS_LABEL = vp_label(VPS_TEXT, color_yellow,color_blue), VPS_MAIN_DATA = vps_caption(VPS_LABEL), VPSTUDIO_WIN_CONTROL_LIST = [ ], VPSTUDIO_CONTROL = vps_ctl( vps_ctrl(wc_custom,vps_hand(vps_control_handler), VPS_MAIN_DATA,[]), VPSTUDIO_WIN_CONTROL_LIST, vps_border(color_yellow,4,4,0xFFBBBB,0xBB0000,[]), ALIGNMENT,FONT ), |
|
Create application as control |
WSFLAGS = [], PANELCONTROLID=1000, RCT = rct(0,0,400,300), _CONTROL_WINDOW = system_support::create_class( _Win,"cl_win_controls", VPSTUDIO_CONTROL,RCT,PANELCONTROLID,WSFLAGS ), |
Copyright 1998-2002 EDMGROUP (Australia)
Last Updated: June 28, 2002