ITPub博客

首页 > Linux操作系统 > Linux操作系统 > SAP Control framework系列(03)转

SAP Control framework系列(03)转

原创 Linux操作系统 作者:ultraluck 时间:2019-05-23 19:18:07 0 删除 编辑

SAP Control framework系列(03)

4. 关于事件

4.1两种类型:

Application event

System event

4.2关于application event使用步骤

-定义数据类型

it_events TYPE cntl_simple_events,

wa_event TYPE cntl_simple_event.

-添加事件

wa_event-eventid = cl_gui_textedit=>event_double_click.
wa_event-appl_event = ‘X’. “Application event
append wa_event to it_events.

-dispatch

CALL METHOD cl_gui_cfw=>dispatch.

4.3 关于system event使用步骤

-定义数据类型

go_event_handler TYPE REF TO cls_event_handler,

gi_events TYPE cntl_simple_events,

g_event TYPE cntl_simple_event.

-定义并且实施event handler

CLASS cls_event_handler DEFINITION.

PUBLIC SECTION.

METHODS:

on_function_selected

FOR EVENT function_selected OF cl_gui_toolbar

IMPORTING fcode,

ENDCLASS.

CLASS cls_event_handler IMPLEMENTATION.

METHOD on_function_selected.

……

ENDMETHOD.

ENDCLASS.

-添加事件

       g_event-eventid         = .
 g_event-appl_event   = space.    "This is an system event
APPEND g_event TO gi_events.

-注册事件

         CALL METHOD go_toolbar->set_registered_events

EXPORTING events = gi_events.

-创建event handler

CREATE OBJECT go_event_handler.

-设置event handler

         SET HANDLER go_event_handler->on_function_selected
           FOR go_toolbar.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/190059/viewspace-476638/,如需转载,请注明出处,否则将追究法律责任。

上一篇: ABAP常用fuction
请登录后发表评论 登录
全部评论

注册时间:2004-12-03

  • 博文量
    145
  • 访问量
    106362