Guys
No changes to
generatedInitialize .
Let me restate the steps:
1) move the declaration of "
grid_vmove_cells_area" to vpiGrid.cl
2) Add listener "
addVScrollListener(onVScroll)]" to the constructor
new(Parent) in childDialog.pro
Code: Select all
new(Parent) :-
dialog::new(Parent),
generatedInitialize(),
This:addVScrollListener(onVScroll),
the name "onVScroll" is arbitary, and will be the name of predicate called on vscroll event.
3) modify the
onShow clause in childDialog.pro in order to add the GridWindow to database
first, add the fact section
Code: Select all
facts
activeGrid : vpiDomains::windowHandle := erroneous.
then the modified onShow
Code: Select all
onShow(Source, _Data) :-
!,
get_init_grid_conf(caller, GridStyle, RowStyle, ColumnStyle),
WinDef = [customctl(wdef(wc_Custom, rct(1, 1, 440, 249), "Custom", u_DlgBase), "grid", 40000, [wsf_Group, wsf_TabStop])],
GridWin = vpi::winCreateDynControl(WinDef, Source:getVpiWindow()),
activeGrid := GridWin,
vpiGrid::init(GridWin, GridStyle, RowStyle, ColumnStyle, grid_callback),
vpiGrid::visitorder(GridWin, 90, c_Alt, vpiGrid::grid_right).
4) and lastly the onVscroll clause
Code: Select all
predicates
onVScroll : window::scrollListener.
clauses
onVScroll(_Source, ScrollCode, _ThumbPosition) :-
if ScrollCode = 2 then
vpiGrid::grid_vmove_cells_area(activeGrid, 1)
elseif ScrollCode = 1 then
vpiGrid::grid_vmove_cells_area(activeGrid, -1)
else
succeed
end if,
!.
I hope that explains it better.
Dave