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

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

tree("6",unmarked,

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

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

],0),

TreeDir = 0,

Font = font_Create(ff_Helvetica    ,[fs_Bold,fs_Italic],13),

TreeWinInfo = tree_WinInfo(Font,TreeDir,[]),

tree_Create(win_tree_WinType,win_tree_RCT,win_tree_Title,

win_tree_Menu,_Parent,win_tree_Flags,win_tree_eh,0,Tree,TreeWinInfo,[]),

enddef

true.

%BEGIN tree, e_Create

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

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

win_CreateControl(wc_Edit,rct(4,237,30,256),"0",_Win,[wsf_AlignLeft,wsf_Group,wsf_TabStop,wsf_AutoHScroll,wsf_Invisible],idc_wtree_edit1),

win_CreateControl(wc_LBox,rct(511,2,657,175),"",_Win,[wsf_Group,wsf_TabStop,wsf_VScroll,wsf_Sort,wsf_NoIntegralHeight],idtc_lbox),

win_CreateControl(wc_Edit,rct(512,181,546,203),"0",_Win,[wsf_Group,wsf_TabStop,wsf_AutoHScroll,wsf_AlignLeft],idc_wtree_edit2),

win_CreateControl(wc_PushButton,rct(555,180,641,200),"Найти",_Win,[wsf_Group,wsf_TabStop],idc_wtree_find),

win_CreateControl(wc_PushButton,rct(555,205,640,223),"Дальше",_Win,[wsf_Group,wsf_TabStop],idc_wtree_next),

%END tree, InitControls

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

%END tree, ToolbarCreate

!.

%END tree, e_Create

%MARK tree, new events

%BEGIN tree, idc_wtree_next _CtlInfo

%*****Нахдит (выделяет) следующий узел с искомым значением**********

win_tree_eh(_Win,e_Control(idc_wtree_next,_CtrlType,_CtrlWin,_CtlInfo),0):tree_SearchNodeAgain(_Win),

!.

%END tree, idc_wtree_next _CtlInfo

%*****Выделениевыбранногоузла (предикатнаходитпервыйоткорняузел***  win_tree_eh(_Win,e_Control(idc_wtree_find,_CtrlType,_CtrlWin,_CtlInfo),0):HC=Win_GetCtlHandle(_Win,idc_wtree_edit2),

Node=Win_GetText(HC),

tree_SearchFirstNode(_Win,Node),

!.

win_tree_eh(_Win,e_Control(idc_wtree_find,_CtrlType,_CtrlWin,_CtlInfo),0):dlg_note("Нет такого узла"),!.

%END tree, idc_wtree_find _CtlInfo

%BEGIN tree, idt_tree_sel

%BEGIN tree, e_MouseDbl

%************Скрыть/Показатьдерево****************************

win_tree_eh(_Win,e_MouseDbl(_PNT,_ShiftCtlAlt,_Button),0):-!,

tree_OpenCloseNode(_Win),

!.

%END tree, e_MouseDbl

%BEGIN tree, idt_tree_curNode

%*************Вывод информации о текущем узле*************

win_tree_eh(_Win,e_Menu(idt_tree_curNode,_ShiftCtlAlt),0):-!,

Str=tree_GetSelectedNode(_Win),

dlg_note("Выбранный узел",Str),

!.

%END tree, idt_tree_curNode

%BEGIN tree, idt_tree_parent

%********Вывод информации родительском узле и его выделение************

win_tree_eh(_Win,e_Menu(idt_tree_parent,_ShiftCtlAlt),0):-!,

Str=tree_GetParentNode(_Win),

dlg_note("Родительский узел",Str),

tree_MoveToParentNode(_Win),

!.

%END tree, idt_tree_parent

%BEGIN tree, idt_tree_allnodes

%*********Выводвсехузловдерева (в ListBox)*********

win_tree_eh(_Win,e_Menu(idt_tree_allnodes,_ShiftCtlAlt),0):-!,

ListALL=tree_GetAllNodes(_Win),

HDC=Win_GetCtlHandle(_Win,idtc_lbox),

lbox_Clear(HDC),

lbox_Add(HDC,ListALL),

!.

%END tree, idt_tree_allnodes

%BEGIN tree, idt_tree_round

% ***************Поворотдерева******************************

win_tree_eh(_Win,e_Menu(idt_tree_round,_ShiftCtlAlt),0):HDC=Win_GetCtlHandle(_Win,idc_wtree_edit1),

Nums=Win_GetText(HDC),

str_int(Nums,Num),

Num=0,

tree_SetDirection(_Win,3),

Win_SetText(HDC,"3"),

!.

win_tree_eh(_Win,e_Menu(idt_tree_round,_ShiftCtlAlt),0):HDC=Win_GetCtlHandle(_Win,idc_wtree_edit1),

Nums=Win_GetText(HDC),

str_int(Nums,Num),

Num=3,

tree_SetDirection(_Win,1),