program sap_picture_demo.

set screen 200.

TYPE-POOLS cndp.

************************************************************************
* CLASS c_event_receiver
* DEFINITION
************************************************************************
class c_event_receiver definition.
* The class is used to test the events raised by the cl_gui_picture
* class
public section.
methods event_handler_picture_dblclick
for event picture_dblclick of cl_gui_picture
importing mouse_pos_x mouse_pos_y sender.
methods event_handler_context_menu
for event context_menu of cl_gui_picture
importing sender.
methods event_handler_context_menu_sel
for event context_menu_selected of cl_gui_picture
importing fcode sender.
endclass. ************************************************************************
* DATA
************************************************************************
data function like sy-ucomm. " OK-Code field in screen 200
data url type cndp_url. " URL-field in screen 200
data url2 type cndp_url. " URL-field in screen 200
data picture_control_1 type ref to cl_gui_picture.
data picture_control_2 type ref to cl_gui_picture.
data container_1 type ref to cl_gui_custom_container.
data container_2 type ref to cl_gui_custom_container.
data event_receiver type ref to c_event_receiver.
data event_tab type cntl_simple_events.
data event_tab_line type cntl_simple_event.
data return type i. ************************************************************************
* PBO
* before_output
************************************************************************
module before_output output.
set pf-status 'MAIN0001'.
IF PICTURE_CONTROL_1 IS INITIAL. * Create controls
create object container_1
exporting container_name = 'PICTURE_CONTROL_1'.
create object container_2
exporting container_name = 'PICTURE_CONTROL_2'. CREATE OBJECT PICTURE_CONTROL_1 exporting parent = container_1.
CREATE OBJECT PICTURE_CONTROL_2 exporting parent = container_2. * Register the events
EVENT_TAB_LINE-EVENTID = CL_GUI_PICTURE=>EVENTID_PICTURE_DBLCLICK.
append EVENT_TAB_LINE to EVENT_TAB.
EVENT_TAB_LINE-EVENTID = CL_GUI_PICTURE=>EVENTID_CONTEXT_MENU.
append EVENT_TAB_LINE to EVENT_TAB.
EVENT_TAB_LINE-EVENTID = CL_GUI_PICTURE=>EVENTID_CONTEXT_MENU_SELECTED.
append EVENT_TAB_LINE to EVENT_TAB. CALL METHOD PICTURE_CONTROL_1->SET_REGISTERED_EVENTS
exporting
EVENTS = event_tab. CALL METHOD PICTURE_CONTROL_2->SET_REGISTERED_EVENTS
exporting
EVENTS = event_tab. * Create the event_receiver object and set the handlers for the events
* of the picture controls
create object event_receiver.
set handler event_receiver->event_handler_picture_dblclick
FOR PICTURE_CONTROL_1.
set handler event_receiver->event_handler_context_menu
FOR PICTURE_CONTROL_1.
set handler event_receiver->event_handler_context_menu_sel
FOR PICTURE_CONTROL_1.
set handler event_receiver->event_handler_picture_dblclick
FOR PICTURE_CONTROL_2.
set handler event_receiver->event_handler_context_menu
FOR PICTURE_CONTROL_2.
set handler event_receiver->event_handler_context_menu_sel
FOR PICTURE_CONTROL_2. * Set the display mode to 'normal' (0)
CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL. * Set 3D Border
CALL METHOD PICTURE_CONTROL_1->SET_3D_BORDER
exporting border = 1.
CALL METHOD PICTURE_CONTROL_2->SET_3D_BORDER
exporting border = 1. * new async implementation since 4.6C
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
OBJID = 'HTMLCNTL_TESTHTM2_SAP_AG'
LIFETIME = cndp_lifetime_transaction
IMPORTING
URL = url
EXCEPTIONS
OTHERS = 1. * Load the picture by using the url generated by the data provider.
if sy-subrc = 0.
CALL METHOD PICTURE_CONTROL_1->LOAD_PICTURE_FROM_URL_ASYNC
exporting url = url.
endif. CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
OBJID = 'DEMOWORD97SAPLOGO'
LIFETIME = cndp_lifetime_transaction
IMPORTING
URL = url2
EXCEPTIONS
OTHERS = 1. * load image
if sy-subrc = 0.
CALL METHOD PICTURE_CONTROL_2->LOAD_PICTURE_FROM_URL_async
exporting url = url2.
endif. endif.
endmodule. ************************************************************************
* PAI
* after_input
************************************************************************
module after_input input.
case function.
* At the end of the program destroy the control
when 'BACK'.
CALL METHOD container_1->FREE.
CALL METHOD container_2->FREE.
leave to screen 0. * Change the display mode
when 'NORMAL'.
CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
when 'STRETCH'.
CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
when 'FIT'.
CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
when 'NORMAL_CTR'.
CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
when 'FIT_CTR'.
CALL METHOD PICTURE_CONTROL_1->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER.
CALL METHOD PICTURE_CONTROL_2->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER. * Clear the picture
when 'CLEAR'.
CALL METHOD PICTURE_CONTROL_1->CLEAR_PICTURE. * Load a new picture
when space.
CALL METHOD PICTURE_CONTROL_1->LOAD_PICTURE_FROM_URL
exporting url = url
importing result = return.
call method cl_gui_cfw=>flush.
if return = 0.
url = text-000.
endif. endcase. clear function.
endmodule. ************************************************************************
* CLASS c_event_receiver
* IMPLEMENTATION
************************************************************************
CLASS C_event_receiver implementation. ************************************************************************
* CLASS c_event_receiver
* METHOD event_handler_picture_dblclick
************************************************************************
METHOD EVENT_HANDLER_PICTURE_DBLCLICK.
* for event picture_dblclick of c_picture_control
* importing mouse_pos_x mouse_pos_y.
DATA pos_x(5) type c.
DATA pos_y(5) type c.
pos_x = mouse_pos_x.
pos_y = mouse_pos_y. IF SENDER = PICTURE_CONTROL_1.
MESSAGE I000(0K) WITH
'DoubleClick' 'Upper Picture' POS_X POS_Y. "#EC NOTEXT
else.
MESSAGE I000(0K) WITH
'DoubleClick' 'Lower Picture' POS_X POS_Y. "#EC NOTEXT
endif.
endmethod. ************************************************************************
* CLASS c_event_receiver
* METHOD event_handler_context_menu
************************************************************************
METHOD EVENT_HANDLER_CONTEXT_MENU.
data menu type ref to cl_ctmenu.
create object menu.
call method menu->ADD_FUNCTION exporting
fcode = text-001
TEXT = TEXT-001.
call method menu->ADD_FUNCTION exporting
FCODE = TEXT-002
TEXT = TEXT-002.
call method menu->ADD_FUNCTION exporting
FCODE = TEXT-003
TEXT = TEXT-003.
call method menu->ADD_FUNCTION exporting
FCODE = TEXT-004
TEXT = TEXT-004.
call method menu->ADD_FUNCTION exporting
FCODE = TEXT-005
TEXT = TEXT-005. CALL METHOD SENDER->DISPLAY_CONTEXT_MENU
EXPORTING CONTEXT_MENU = MENU.
endmethod. ************************************************************************
* CLASS c_event_receiver
* METHOD event_handler_context_menu_sel
************************************************************************
METHOD EVENT_HANDLER_CONTEXT_MENU_sel.
DATA DISPLAY_MODE TYPE I.
IF FCODE = TEXT-001.
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
ENDIF.
IF FCODE = TEXT-002.
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
ENDIF.
IF FCODE = TEXT-003.
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
ENDIF.
IF FCODE = TEXT-004.
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
ENDIF.
IF FCODE = TEXT-005.
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER.
ENDIF.
CALL METHOD SENDER->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = DISPLAY_MODE. endmethod. endclass.

SAP Display picture的更多相关文章

  1. 在Livemedia的基础上开发自己的流媒体客户端

    一.背景 二.Livemedia框架介绍 1.总体框架 2.客户端框架 2.1 客户端openRTSP流程 2.2增加一种新的媒体 2.2.1增加媒体的format 2.2.2 新媒体需要考虑的问题 ...

  2. 设备管理 USB ID

    发现个USB ID站点,对于做设备管理识别的小伙伴特别实用 http://www.linux-usb.org/usb.ids 附录: # # List of USB ID's # # Maintain ...

  3. Windows Phone 8 - 建立App专属联络人资讯(ContactStore)

    原文:Windows Phone 8 - 建立App专属联络人资讯(ContactStore) 在WP7的时候介绍了如何操作联络人的功能,例如:<Windows Phone 7 - 存取联络人与 ...

  4. ffplay源码分析4-音视频同步

    本文为作者原创,转载请注明出处:https://www.cnblogs.com/leisure_chn/p/10307089.html ffplay是FFmpeg工程自带的简单播放器,使用FFmpeg ...

  5. 第11月第8天 ffmpeg ffplay

    static int ffplay_video_thread(void *arg) { FFPlayer *ffp = arg; VideoState *is = ffp->is; AVFram ...

  6. 零基础读懂视频播放器控制原理——ffplay播放器源代码分析

    版权声明:本文由张坤原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/535574001486630869 来源:腾云阁 ht ...

  7. ffmpeg 2.3版本号, 关于ffplay音视频同步的分析

    近期学习播放器的一些东西.所以接触了ffmpeg,看源代码的过程中.就想了解一下ffplay是怎么处理音视频同步的,之前仅仅大概知道通过pts来进行同步,但对于怎样实现却不甚了解,所以想借助这个机会, ...

  8. ffplay(2.0.1)中的音视频同步

    最近在看ffmpeg相关的一些东西,以及一些播放器相关资料和代码. 然后对于ffmpeg-2.0.1版本下的ffplay进行了大概的代码阅读,其中这里把里面的音视频同步,按个人的理解,暂时在这里作个笔 ...

  9. 视频播放器控制原理:ffmpeg之ffplay播放器源代码分析

    版权声明:本文由张坤原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/535574001486630869 来源:腾云阁 ht ...

随机推荐

  1. Go xmas2020 学习笔记 10、Slices in Detail

    10-Slices in Detail. Slice. Empty vs nil slice

  2. 数据库基础知识详解四:存储过程、视图、游标、SQL语句优化以及索引

    写在文章前:本系列文章用于博主自己归纳复习一些基础知识,同时也分享给可能需要的人,因为水平有限,肯定存在诸多不足以及技术性错误,请大佬们及时指正. 11.存储过程 ​ 存储过程是事先经过编译并存储在数 ...

  3. Linux中信号量的实现

    如果一个任务获取信号量失败,该任务就必须等待,直到其他任务释放信号量.本文的重点是,在Linux中,当有任务释放信号量之后,如何唤醒正在等待该信号量的任务. 信号量定义如下: struct semap ...

  4. 如何设计一个良好的API接口?

    沟通创造价值,分享带来快乐.这里是程序员阅读时间,每天和你分享读书心得,欢迎您每天和我一起精进.今天和大家一起讨论的话题是如何设计一个良好的API接口? 作者:梁桂钊 解读:张飞洪 挑战 API是软件 ...

  5. Bugku练习题---MISC---FileStoragedat

    Bugku练习题---MISC---FileStoragedat flag:bugku{WeChatwithSteg0} 解题步骤: 1.观察题目,下载附件 2.下载后发现是一个后缀名为.dat的文件 ...

  6. 【图解】面试题:ConcurrentHashMap是如何保证线程安全的

    注意:JDK1.7与JDK1.8中的ConcurrentHashMap主要延续HashMap的设计与思想,是在其基础上进行的相应优化 1.JDK1.7中的底层实现原理 (1)JDK1.7Concurr ...

  7. Ubuntu环境Docker+K8s+Dashboard的安装配置(无坑亲测)

    安装之前的准备: 安装docker 使用国内 daocloud 一键安装命令: curl -sSL https://get.daocloud.io/docker | sh 直接从dockerhub下载 ...

  8. 用 Docker 构建 MySQL 主从环境

    开源Linux 一个执着于技术的公众号 前言 本篇文章记录使用 docker-compose 以及 dockerfile 来构建基于 binlog 的 MySQL 主从环境.如果你严格按照文中的步骤进 ...

  9. 面渣逆袭:Redis连环五十二问,图文详解,这下面试稳了!

    大家好,我是老三,面渣逆袭系列继续,这节我们来搞定Redis--不会有人假期玩去了吧?不会吧? 基础 1.说说什么是Redis? Redis是一种基于键值对(key-value)的NoSQL数据库. ...

  10. python appium server代码启动和关闭遇到的坑

    第一次使用博客,小白级,互相交流,有说的不对的地方欢迎来喷!!! 自动化的目的就是减少人工成本,如果每次跑自动化用例时都要手动起appium客户端,太费事了~~故,将appium server的调起和 ...