Изучение графических возможностей Visual Prolog 5,2, страница 3

Event handling for Task Window

********************************************************************/

predicates

task_win_eh : EHANDLER

constants

%BEGIN Task Window, CreateParms, 20:30:28-12.10.2007, Code automatically updated!

task_win_Flags = [wsf_SizeBorder,wsf_TitleBar,wsf_Close,wsf_Maximize,wsf_Minimize,wsf_ClipSiblings]

task_win_Menu  = res_menu(idr_task_menu)

task_win_Title = "Лабораторная 1"

task_win_Help  = idh_contents

%END Task Window, CreateParms

clauses

%BEGIN Task Window, e_Create

task_win_eh(_Win,e_Create(_),0):-!,

win_tree_Create(_Win),!.

%END Task Window, e_Create

%BEGIN Task Window, id_tree

task_win_eh(_Win,e_Menu(id_tree,_ShiftCtlAlt),0):-!,

win_tree_Create(_Win),

!.

%END Task Window, id_tree

%BEGIN Task Window, id_help_about

task_win_eh(Win,e_Menu(id_help_about,_ShiftCtlAlt),0):-!,

dlg_about_dialog_Create(Win),

!.

%END Task Window, id_help_about

%BEGIN Task Window, id_file_exit

task_win_eh(Win,e_Menu(id_file_exit,_ShiftCtlAlt),0):-!,

win_Destroy(Win),

!.

%END Task Window, id_file_exit

%BEGIN Task Window, e_Size

task_win_eh(_Win,e_Size(_Width,_Height),0):-!,

ifdef use_tbar

toolbar_Resize(_Win),

enddef

ifdef use_message

msg_Resize(_Win),

enddef

!.

%END Task Window, e_Size

%END_WIN Task Window

/**********************************************************************

Invoking on-line Help

***********************************************************************/

project_ShowHelpContext(HelpTopic):vpi_ShowHelpContext("tree.hlp",HelpTopic).

/*********************************************************************

Main Goal

*********************************************************************/

goal

ifdef use_mdi

vpi_SetAttrVal(attr_win_mdi,b_true),

enddef

ifdef ws_win

ifdef use_3dctrl

vpi_SetAttrVal(attr_win_3dcontrols,b_true),

enddef

enddef 

vpi_Init(task_win_Flags,task_win_eh,task_win_Menu,"tree",task_win_Title).

%BEGIN_DLG About dialog

/************************************************************************

Creation and event handling for dialog: About dialog

************************************************************************/

constants

%BEGIN About dialog, CreateParms, 00:06:10-9.10.2007, Code automatically updated!

dlg_about_dialog_ResID = idd_dlg_about

dlg_about_dialog_DlgType = wd_Modal

dlg_about_dialog_Help = idh_contents

%END About dialog, CreateParms

predicates

dlg_about_dialog_eh : EHANDLER

clauses

dlg_about_dialog_Create(Parent):win_CreateResDialog(Parent,dlg_about_dialog_DlgType,dlg_about_dialog_ResID,dlg_about_dialog_eh,0).

%BEGIN About dialog, idc_ok _CtlInfo

dlg_about_dialog_eh(_Win,e_Control(idc_ok,_CtrlType,_CtrlWin,_CtrlInfo),0):-!,

win_Destroy(_Win),

!.

%END About dialog, idc_ok _CtlInfo

%MARK About dialog, new events

dlg_about_dialog_eh(_,_,_):-!,fail.

%END_DLG About dialog

%BEGIN_WIN tree

/**********Creation and event handling for window: "tree"***************/

constants

%BEGIN tree, CreateParms, 00:34:04-16.10.2007, Code automatically updated!

win_tree_WinType = w_TopLevel

win_tree_Flags = [wsf_SizeBorder,wsf_TitleBar,wsf_Maximize,wsf_Minimize,wsf_Close,wsf_ClipSiblings,wsf_ClipChildren]

win_tree_RCT = rct(100,80,773,347)

win_tree_Menu = res_menu(id_treemenu)

win_tree_Title = "Дерево"

win_tree_Help = idh_contents

%END tree, CreateParms

predicates

win_tree_eh : EHANDLER

clauses

/***********************Созданиедерева***************/

win_tree_Create(_Parent):ifdef use_tree

Tree = tree("0",unmarked,

[tree("3",unmarked,[],0),

tree("2",unmarked,

[tree("4",unmarked,