WDA学习(24):Context Menu使用
1.17 UI Element:Context Menu使用
本实例测试创建Context Menu.
1.创建Component,View: V_CONTEXT_MENU;
2.创建Context节点;
创建Node:NODE_TV,Cardinality:1..1;
创建Attribute:TV1,类型String;
创建Node:NODE_ATTR,Cardinality:1..1;
创建Attribute:MENU_CHK, 类型WDY_BOOLEAN;
创建Attribute:MENU_RADIOBTN,类型WDR_DEMO_FRUIT;
创建Attribute:MENU_CHK1,类型WDY_BOOLEAN;

3.创建Layout页签;
创建UI Element:MenuBar,ID:MENUBAR;
创建UI Element:Menu,ID:MENU;
创建UI Element:Menu,ID:MENU_SUB1;
创建UI Element:MenuActionItem,ID: MENU_CHG,绑定Action: MENU_CHG;
创建UI Element:MenuActionItem,ID: MENU_ADD,绑定Action:MENU_ADD;
创建UI Element:MenuSeparator,ID:MENU_SEP1;
创建UI Element:Menu,ID:MENU_SUB2;
创建UI Element:MenuRadioButton,ID:MENU_BTN,绑定Action: MENU_SEL,selectedKey绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_RADIOBTN;
创建UI Element:MenuRadioButton,ID:MENU_BTN1,绑定Action:MENU_SEL,selectedKey绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_RADIOBTN;
创建UI Element:MenuSeparator,ID:MENU_SEP2;
创建UI Element:Menu,ID:MENU_SUB3;
创建UI Element:MenuCheckBox,ID:MENU_CHK,绑定Action:MENU_TOG,checked绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_CHK;
创建UI Element:MenuCheckBox,ID:MENU_CHK1,绑定Action:MENU_TOG,checked绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_CHK1;
创建UI Element:TextView,text绑定Context的Attributes: V_CONTEXT_MENU.NODE_TV.TV1;

4.创建Method页签,实现Action方法;
实现Action: MENU_ADD,Menu选择Add;
代码实例:
DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element. lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = 'Menu:add'
).
实现Action:MENU_CHG,Menu选择change;
DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element. lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = 'Menu:change'
).
实现Action:MENU_SEL,Menu选择Radio Button;
代码实例:
DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element.
DATA:lo_event TYPE REF TO cl_wd_custom_event.
DATA:lv_string TYPE string.
lo_event = wdevent.
lv_string = lo_event->get_string( name = 'KEY' ).
lv_string = 'Menu:radio button,' && lv_string.
lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = lv_string
).
实现Action:MENU_TOG,CheckBox选择事件;
代码实例:
DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element.
DATA:lo_event TYPE REF TO cl_wd_custom_event.
DATA:lv_id TYPE string.
lo_event = wdevent.
lv_id = lo_event->get_string( name = 'ID' ).
lv_id = 'Menu:checkbox' && lv_id.
lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = lv_id
).
WDA学习(24):Context Menu使用的更多相关文章
- Android -- Options Menu,Context Menu,Popup Menu
Options Menu 创建选项菜单的步骤: 1. ...
- Android Contextual Menus之一:floating context menu
Android Contextual Menus之一:floating context menu 上下文菜单 上下文相关的菜单(contextual menu)用来提供影响UI中特定item或者con ...
- Tree Context Menu
Right click on a node to display context menu. My Documents Photos Program Files Intel Java Micros ...
- android学习笔记37——Menu资源
Menu菜单资源 android应用推荐使用XML来定义菜单,其可提供更好的解耦方式. 菜单资源通常位于res/menu文件夹下,其菜单根元素为<menu.../>,menu元素下可包含子 ...
- create Context Menu in Windows Forms application using C# z
In this article let us see how to create Context Menu in Windows Forms application using C# Introduc ...
- Win7/Win8右键菜单管理工具(Easy Context Menu) v1.5 绿色版
软件名称: Win7/Win8右键菜单管理工具(Easy Context Menu)软件语言: 简体中文授权方式: 免费软件运行环境: Win8 / Win7 / Vista / WinXP软件大小: ...
- Description Resource Path Location Type Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix. spark-MT line 1 Maven Co
1.相信大家新建的maven项目,然后添加好依赖(即修改了pom.xml文件以后就会出现如下所示的错误): Description Resource Path Location Type Projec ...
- sublime text 3-right click context menu
dd a system wide windows explorer button " Edit with Sublime" similar to how Notepad++ doe ...
- 手机浏览器中屏蔽img的系统右键菜单context menu
我们知道通过oncontextmenu事件可以屏蔽浏览器右键菜单 $('img').on("contextmenu",function(E){E.preventDefault(); ...
- Vue 2.0 右键菜单组件 Vue Context Menu
Vue 2.0 右键菜单组件 Vue Context Menu https://juejin.im/entry/5976d14751882507db6e839c
随机推荐
- 2023-03-03 js map 双重嵌套
恩..其实也没啥要记录的,记住关键一点就是必须要有return,不管是几重,比如: arr.map((item, index) => { return ( item.ar ...
- 成品直播源码,Flutter 夜间模式 全局字体
成品直播源码,Flutter 夜间模式 全局字体 import 'package:flutter/material.dart';import 'package:flutter_widget/route ...
- pyg安装
pyg官网:pytorch_geometric documentation (pytorch-geometric.readthedocs.io) win安装pyg各种报错,原因在于pytorch和py ...
- vue webpack打包之后 重新修改配置文件接口API路径,无需修改代码后再打包
用vue-cli构建的项目通常是采用前后端分离的开发模式,也就是前端与后台完全分离,此时就需要将后台接口地址打包进项目中,但是有的时候需要修改接口地址,为了避免为了修改接口地址而进行修改代码后再重新打 ...
- MyBatis_03(核心配置文件解析)
核心配置的文件的"详解" -->(优化,核心配置文件) "核心配置文件的前言": 核心配置文件中的标签必须按照固定的顺序 ---> ("有 ...
- T14 风扇狂转修整TPFanControl.ini 屏蔽pwr
//注意标红部份屏蔽pwr //NEW: Set UseTWR=1 to see more sensors, will work only on newer T4xx// ATTENTION: if ...
- 电脑cmd命令
查看ip ipconfig/all
- excel数字转日期
import datetime delta = datetime.timedelta() today = datetime.datetime.strptime('1899/12/30', '%Y/%m ...
- C# 中 SetTimeout 方案
近期项目中需在用户点击按钮后,延时执行代码逻辑,避免频繁操作.网上没找到有关 C# SetTimeout 官方API , 于是通过异步线程,动手实现一个.方案如下,如果同一个DelayedProces ...
- SpringMVC文件上传详解
声明 源码基于Spring Boot 2.3.12.RELEASE.Spring Framework 5.2.15.RELEASE Servlet3.0 文件上传 Servlet 3.0对于HttpS ...