Code: Alles auswählen.
l_event-eventid = if_graphic_proxy=>CO_EVT_SCROLLED.
l_event-appl_event = 'X'.
append l_event to lt_events.
...
create object gp_inst.
call method gp_inst->if_graphic_proxy~init
EXPORTING
parent = custom_container
dc = dc_inst
prod_id = cl_gui_gp_pres=>co_prod_chart
force_prod = gfw_true
EVTCODE_LIST = lt_events
IMPORTING
retval = retval.
Code: Alles auswählen.
CALL METHOD CL_GUI_CFW=>DISPATCH.
Code: Alles auswählen.
*
DATA: paramChangePosi TYPE I.
DATA: paramCurCursorPosi(80).
main class needed to catch gui events
CLASS event_handler DEFINITION.
PUBLIC SECTION.
METHODS: ON_SCROLLED FOR EVENT IF_GRAPHIC_PROXY~GRAPHIC_SCROLLED
OF CL_GUI_GP_PRES IMPORTING EVENT.
ENDCLASS. "event_handler DEFINITION
*----------------------------------------------------------------------*
* CLASS event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS event_handler IMPLEMENTATION.
* SCROLL-Position auslesen
METHOD ON_SCROLLED.
DATA: EVT_PARAMETER TYPE GFW_EVTPARAM.
READ TABLE EVENT-EVTPARAM_LIST INTO EVT_PARAMETER
WITH KEY NAME = IF_GRAPHIC_PROXY=>CO_EVTPARAM_OFFSET.
IF SY-SUBRC = 0 OR SY-SUBRC = 2.
paramChangePosi = 1.
paramCurCursorPosi = EVT_PARAMETER-VALUE.
ENDIF.
endMethod. "ON_SCROLLED
ENDCLASS. "event_handler IMPLEMENTATION
data: lt_events type cntl_simple_events,
l_event type cntl_simple_event.
DATA handle TYPE REF TO event_handler.
Code: Alles auswählen.
...
l_event-eventid = if_graphic_proxy=>CO_EVT_VALUE_CHANGED.
l_event-appl_event = 'X'.
append l_event to lt_events.
* create, initialize and activate graphics proxy
create object gp_inst.
create object handle.
SET HANDLER handle->ON_SCROLLED FOR gp_inst.
...
Code: Alles auswählen.
...
CALL METHOD CL_GUI_CFW=>DISPATCH
IMPORTING
RETURN_CODE = return.
...
Folgende Benutzer bedankten sich beim Autor Mondhund76 für den Beitrag:
ewx