本例子附有create tabel 及insert 数据的sql 及forms的源文件, 经测试可以直接运行。
运行界面如下:
trigger;
WHEN-NEW-FORMS-INSTANCE:
set_window_property('window1', window_state, maximize);
declare
rg1 recordgroup;
t number;
uname varchar2(32);
BEGIN
:global.os := get_application_property(Operating_system);
rg1 := find_group('RG1');
if not id_null(rg1) then
delete_group(rg1);
end if;
uname := user;
:vdata := uname;
uname := lower(uname);
rg1 := create_group_from_query('RG1','select init,depth,lpad(substr(treeno,-1,2),2,''0'')||''.''||label,'''',data from menu order by treeno');
t := populate_group(rg1);
ftree.set_tree_property('TREE',Ftree.record_group, rg1);
--psize();
END;
trigger;
WHEN-TREE-NODE-ACTIVATED:
DECLARE
htree
ITEM;
node_value
VARCHAR2(100);
ftype
varchar2(8);
BEGIN
node_value
:=
Ftree.Get_Tree_Node_Property('TREE',
:SYSTEM.TRIGGER_NODE,
Ftree.NODE_VALUE);
ftype:=lower(substr(node_value,-1,3));
--ftype:='fmx';
if
node_value
<'node'
then
if
ftype
=
'fmx'
then
call_form(node_value
,no_hide);
elsif
ftype
=
'sql'
then --
execute
those
sql
need
not
parameter
--
host('plus80w
@'||:vdata,
NO_SCREEN);
end
if;
end
if;
END;