I try to scroll dynamically an acroPDFControl without succes.
The acroPDF control named acroPDFControl_ctl and it is in a form.
Here is my code :
Code: Select all
facts
pdfBrowser1 : iAcroAXDocShim_import := uncheckedConvert(iAcroAXDocShim_import,null).
si_upd:integer:=0.
clauses
onShow(_Source, _Data):-
acroPDFControl_ctl:setSubClassHandler(action_sub,false),
pdfBrowser1 := acroPDFControl_ctl :get_IAcroAXDocShim_import(),
ouvrir_nouvo_pdf()
.
clauses
ouvrir_nouvo_pdf():-
if not(pdfBrowser1=uncheckedConvert(iAcroAXDocShim_import,null)) then
pdfBrowser1 : setShowToolbar(true()),
pdfBrowser1 : setShowScrollbars(true()),
_R2 = pdfBrowser1:loadFile(taskWindow::nom_pdf()),
if not(taskWindow::nom_pdf() = "") then
pdfBrowser1:gotoNextPage(),
pdfBrowser1:gotoNextPage(),
pdfBrowser1:setView("FitB") %%Fit/FitH/FitV/FitB/FitBH/FitBV
end if
end if.
predicates
action_sub:eHandler.
clauses
action_sub(_Win,e_MouseMove(_Pnt,_ShiftCtrlAlt,_Buttons))=0:-
if si_upd = 0 then
RCT = vpi::wingetClientRect(acroPDFControl_ctl:getVpiWindow()),
OBJ = acroPDFControl_ctl : getActiveXContainer(),
if OBJ2 = OBJ : tryGetOleControlContainerSite() then
_ = OBJ : onPosRectChange(RCT,OBJ2:getIPSite())
end if,
si_upd := 1
end if,
!.
Here is a part of my code :
Code: Select all
clauses
activer_barre_vert():-
OBJ = acroPDFControl1_ctl : getActiveXContainer(),
Hdl = OBJ:getWindow(),
Lst_Hdl = vpi::winGetChildWindows(Hdl),
foreach Cpt = std::fromTo(0,list::length(Lst_Hdl)-1) do
Hdl_ss_Ctrl = list::nth(Cpt,Lst_Hdl),
Titre_Classe = string::create(255),
_ = gui_native::getClassName(Hdl_ss_Ctrl,Titre_Classe,255),
if Titre_Classe = "ScrollBar",
Lg = gui_native::getWindowLong(Hdl_ss_Ctrl,gui_native::gwl_style),
Total = gui_native::ws_child + gui_native::ws_visible + gui_native::sb_vert,
Lg = Total then
NullRct = uncheckedConvert(vpiDomains::rct, 0),
Pos = vpi::winGetScrollPos(Hdl_ss_Ctrl,sb_Ctl),
Parent = vpi::winGetParent(Hdl_ss_Ctrl),
R_scrollWindowEx = gui_native::scrollWindowEx(Parent,0,100,NullRct,NullRct,0,NullRct,gui_native::sw_invalidate) % not ok
% _ = gui_native::setScrollPos(Hdl_ss_Ctrl,sb_Ctl,Pos+100,gui_native::sw_invalidate)
% vpi::winSetScrollPos(Hdl_ss_Ctrl,sb_Ctl,Pos + 100),%vpi::winInvalidate(Hdl_ss_Ctrl)
% vpi::winSetState(Hdl_ss_Ctrl,[wsf_visible])
% _ = vpi::winSendEvent(Hdl_ss_Ctrl,e_VScroll(sc_ThumbTrack,Pos+100)),vpi::winInvalidate(Hdl_ss_Ctrl)
% Parent = vpi::winGetParent(Hdl_ss_Ctrl),
% _ = vpi::winSendEvent(Parent,e_VScroll(sc_PageDown,Pos+100))%,vpi::winInvalidate(Hdl_ss_Ctrl)
% Parent = vpi::winGetParent(Hdl_ss_Ctrl),vpi::winUpdate(Parent) %vpi::winInvalidate(Parent)
% _ = vpi::winSendEvent(Parent,e_update(vpi::winGetClientRect(Parent)))
% _ = vpi::winSendEvent(Parent,e_VScroll(sb_Vert,Pos+100))
/*
Rect = vpi::winGetClientRect(Hdl),Rect = rct(Gauch,Haut,Droit,Bas),
New_rect = rct(Gauch,Haut+100,Droit,Bas+100),
% R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,New_rect,NullRct)%,vpi::winInvalidate(Hdl) % not ok
% R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,NullRct,New_rect)%,vpi::winInvalidate(Hdl) % not ok
% R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,New_rect,New_rect)%,vpi::winInvalidate(Hdl) % not ok
% R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,New_rect,Rect)%,vpi::winInvalidate(Hdl) % not ok
% R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,Rect,New_rect)%,vpi::winInvalidate(Hdl) % not ok
% R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,Rect,Rect)%,vpi::winInvalidate(Hdl) % not ok
R_scrollWindow = gui_native::scrollWindow(Hdl,0,100,NullRct,NullRct)%,vpi::winInvalidate(Hdl) % not ok
% ScrollFlags = bit::bitOr(gui_native::sw_erase,gui_native::sw_invalidate,gui_native::sw_scrollchildren),
% ScrollFlags = bit::bitOr(gui_native::sw_invalidate,gui_native::sw_scrollchildren),
% R_scrollWindowEx = gui_native::scrollWindowEx(Hdl,0,100,NullRct,NullRct,0,NullRct,gui_native::sw_invalidate)
*/
end if
end foreach,
!.
