Panel Object

back to main page

What is the Panel Object?

Panel Object is a Visual Prolog custom control. It allows easy creation of various controls and group of controls and use Visual Prolog VDE to define control groups.

Why use panel object? With introduction of this type of objects, programmer can use VPI GUI strategy to program dialog event handlers and organize later these dialogs inside a screen form (Dialog or Window). This approach significaly reduces development time and especially simplifies change management.

To include Catalog Object - open your project.inc file with VP Studio Setup utility and checkout Panel Object option.


Download VIP 5.2 Project
(59 KB)

How to use panel object -

- create custom control with the name "panel_class"

 

call object register first:
    panel_register,

.... % before creating panel objects - create system_object for the parent window
.....% and store there reference to the user-definable panel_controller
    PanelCallbackRef = cast(long, panel_controller),
    SystemObject = system_object::new(_Win),
    SystemObject:save_object_ref("panel_callback",PanelCallbackRef),
Panel controller:

if you would like Visual Prolog Dialog to be displayed inside panel window - write e_create event for the panel control ID, which should contain your dialog.

panel_controller(_Win,e_create(RefToPanelObject),0):-
    ControlId = win_GetCtlId( _Win ),ControlId =sample_dialog_panel,
    CtlList = win_GetResDialog(idd_sample_dialog),
    CtlList = [_Dlg|ControlList],
    win_CreateDynControl(ControlList,_Win),
    % Now pass control to the dialog handler
    win_SetHandler(_Win,dlg_sample_dialog_eh),
    win_SendEvent(_Win,e_create(RefToPanelObject)),
    PanelObject = cast(panel_object, RefToPanelObject),
    PanelObject:set_callback(dlg_sample_dialog_eh),
    get_window_object(_Win,SystemObject),
    SystemObject:system_color("normal_background",0x808040),
    Font = font_Create(ff_Helvetica, [fs_Italic], 10),
    SystemObject:object_font(Font),
 


Copyright 1998-2000 EDMGROUP (Australia)

Last Updated: 03/20/02