Wt::WTreeNode

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

A single node in a tree.

这个 widget 渲染的是一棵树的一个节点。

A tree list is constructed by combining several tree node objects in a tree hierarchy, by passing the parent tree node as the last argument in the child node constructor, or by using addChildNode(), to add a child to its parent.

一棵树或者说一个树表,由很多树节点对象按一定的层次关系组合而成,可以先创建子节点然后告诉它谁是父节点,或者创建父节点,然后使用 addChildNode() 增加子节点。

Each tree node has a label, and optionally a label icon pair. The icon pair offers the capability to show a different icon depending on the state of the node (expanded or collapsed). When the node has any children, a child count may be displayed next to the label using setChildCountPolicy().

每个树节点都有一个 标签,这个标签也可以用一对小图标代替。 这一对小图标具有根据节点打开/关闭状态切换显示的功能。当某个节点含有子节点时,可以通过 setChildCountPolicy() 来设置是否在父节点标签上显示子节点的数量。

Expanding a tree node it will collapse all its children, so that a user may collapse/expand a node as a short-cut to collapsing all children.

扩展开一个树节点将显示其所有下级子节点

The treenode provides several policies to communicate the current contents of the tree to the client (if possible):

树节点与客户端通讯的方式有如下几种:

  • WTreeNode::PreLoading: the entire tree is transmitted to the client, and all tree navigation requires no further communication.
  • 一次全部载入,未来不用与服务器通讯。
  • WTreeNode::LazyLoading: only the minimum is transmitted to the client. When expanding a node for the first time, only then it is transmitted to the client, and this may thus have some latency.
  • 最小载入原则,当第一次扩展某个节点时才载入到客户端,这显然需要有载入时间。
  • WTreeNode::NextLevelLoading: all leafs of visible children are transmitted, but not their children. This provides a good trade-off between bandwith use and interactivity, since expanding any tree node will happen instantly, and at the same time trigger some communication in the back-ground to load the next level of invisible nodes.
  • 可见载入原则。这是一种平衡原则,当前看不到的子节点不用载入,需要时才载入。

The default policy is WTreeNode::LazyLoading. Another load policy may be specified using setLoadPolicy() on the root node and before adding any children. The load policy is inherited by all children in the tree.

Wt 默认的是最小载入原则,其他的可以通过 setLoadPolicy()  对根节点定义,特别要注意必须是在添加子节点前定义。载入原则可以被所有子节点继承。

There are a few scenarios where it makes sense to specialize the WTreeNode class. One scenario is create a tree that is populated dynamically while browsing. For this purpose you should reimplement the populate() method, whose default implementation does nothing. This method is called when 'loading' the node. The exact moment for loading a treenode depends on the LoadPolicy.

A second scenario that is if you want to customize the look of the tree label (see labelArea()) or if you want to modify or augment the event collapse/expand event handling (see doExpand() and doCollapse()).

〔节点的样式可以自定义,通过labelArea() 扩展当前标签区域的内容或动作等,当然扩展或收起的事件处理也可以自定义,具体参考doExpand() 和 doCollapse()〕

See WTree for a usage example.

CSS

The tree is styled by the current CSS theme. The look can be overridden using the Wt-tree CSS class and the following selectors:

默认树节点的样式采用 CSS theme 定义,我们可以重写 Wt-tree 样式类,如下:

.Wt-tree .Wt-trunk          : vertical line, trunk
.Wt-tree .Wt-end : vertical line, last item
.Wt-tree .Wt-collapse : collapse icon (img *)
.Wt-tree .Wt-expand : expand icon (img *)
.Wt-tree .Wt-noexpand : leaf icon

.Wt-tree .Wt-label : the node label
.Wt-tree .Wt-childcount : the node child count
* The collapse and expand icons are fetched themselves as images, nav-plus.gif and nav-minus.gif.

See also:
WTree, WTreeTableNode

类别: c++witty  查看评论

转载于:https://my.oschina.net/zhmsong/blog/5226

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/549210.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

匿名内部类探究——它是一个实例

目录我的学习过程匿名内部类概述匿名内部类探究代码验证(匿名内部类是一个实例)结论我的学习过程 昨天想学习一下Java8新特性,看到Lambda表达式可以替代匿名内部类。我对匿名内部类不太理解,决定学习一下。并进行了下面的归纳和思…

利用SQL查找表中的质数(prime number)和完全数(perfect number)以及几个有趣的SQL语句...

之前在某次interview中被老外问到如何用SQL找出列上的质数和完全数的问题;我当时已经多年没有写过这种考算法和SQL技巧(纯粹的技巧)的语句了,乍遇此问题倒是有些棘手。现在录以记之,供人参考. SQL> create table numbers(NO int) ;表已创建…

Lambda表达式及应用

目录Lambda表达式概念应用在forEach()方法使用用来替代匿名内部类代码验证(Lambda表达式替代匿名内部类)Lambda表达式 概念 语法形式: () -> {} 组成: 括号:表示参数列表;箭头:表示lambda…

UrlRewriter 伪url的配置

UrlRewriter 是微软封装好了的一个URL重写组件。使用它可以让我节约很多自已开发的时间。 好了,开始讲述我的应用经验,这只是很菜鸟的经验,高手就不用看了。 第一步,请从此下载此组件。解压,把UrlRewriter.dll copy到你…

网络地址和广播地址的快速计算方法

目录前提条件方法原理网络地址快速计算示例广播地址快速计算示例前提条件 由IP地址和子网掩码,快速计算网络地址和广播地址。 小窍门前提:当子网掩码组成只有255和0组成时。 方法原理 利用255(或者0)和其他数字的&&#xf…

职场提醒:面试失败n次以后

投了一份简历,是中国一个很有名的医药公司的职位。面试后对方回复说,我不符合他们的要求。之前也参加过很多公司面试,结果都是说我经验不足。一次次的失败也让我对自己有了新的认识,也不断的刺激我。发现一个工作经验不足的人&…

关于list遍历时sychronizedList方法和synchronized同步块的线程安全问题思考

目录我的难点sychronizedList方法无法解决List遍历时线程不安全问题sychronizd同步块为什么可以解决List遍历时线程不安全问题我的思考过程我的难点 sychronizedList方法无法解决List遍历时线程不安全问题 关于慕课网的socket课程学习中,qiujuer老师在课程中讲到&…

WinCE CEDDK之DMA相关函数

CEDDK提供了DMA的相关函数,在CEDDK/DDK_DMA/ddk_dma.c中定义。实际上里面最有用的就两个函数,HalAllocateCommonBuffer(..)和HalFreeCommonBuffer(..)分别用于为DMA申请和释放 首先介绍一下会用到的DMA适配器结构,在ceddk.h中定义,如下: type…

Navicat中无法自定义标量值函数的问题

目录自定义标量函数代码自定义函数无法创建问题自定义标量函数代码 我的思路:我要创建一个自定义标量函数。使用软件:navicat12.1版本。点击Fx图标进行创建。代码中,使用num作为入参,根据num的大小返回颜色。num大于0返回白色&am…

把十六进制字符转换成十进制数

2019独角兽企业重金招聘Python工程师标准>>> /*** Get the hex value of a character (base16).* param c A character between 0 and 9 or between A and F or* between a and f.* return An int between 0 and 15, or -1 if c was not a hex digit.*/public stat…

明白90/10的原理吗?

什么是90/10原理?即在您的一生中,只有10的事情您无能为力,而90的事情都在您的把握之中。 我们无法阻止汽车老化出故障,我们无法预料飞机晚点,我们的行程可能被司机耽误在路上,等等,这些都是我们…

SQL Server更新某一列中多个字典码对应内容(sql示例)

目录示例-查询出多个字典码对应的内容示例-替换多个字典码对应的内容说明CHARINDEXFOR XML PATH示例-查询出多个字典码对应的内容 建立表格:学生-学习科目表student_study 注意:科目kemu列内容是字典码,需要更换成对应内容。 建立表格&…

DirectX支配游戏!历代GPU架构全解析

http://tech.163.com/digi/10/0430/08/65GM21CJ001618J7.html转载于:https://www.cnblogs.com/qilinzi/archive/2010/06/23/1940494.html

mybatisPlus中的field-strategy(字段更新插入策略):null值插入和更新问题

目录mybatisPlus中null值插入和更新问题实际项目解决方法示例一实际项目解决方法示例二field-strategy字段更新插入策略介绍枚举类FieldStrategy源码枚举类字段简介mybatisPlus中null值插入和更新问题 配置mybatisPlus的项目中,默认进行了不是全量更新的策略&#…

javascript变量声明语法的应用和分号讲究适用性

变量声明语法:var变量名,通常应用在语句的代码当中。在语句ECMAScript中必须与关键字var变量名之间至少有一个空格。(也就是变量名需要遵守一定的规范,至少不应该出现中文;如出现中文那就使语法中的语句代码不能相应连接到有关系地对数据处理…

SQL Server和MysQL中的联表更新sql示例

目录需求说明SQL Server中联表更新sql示例MySQL中联表更新sql示例需求说明 需求说明:把表B的报名号数据,更新到另一张表A的报名号列。通过表A证件号码和表B身份证号相等。 SQL Server中联表更新sql示例 UPDATE a SET a.bmhb.bmh FROM A aINNER J…

Mybatis中(#{ })模糊查询like(使用oracle的concat函数嵌套拼接SQL)

需求: 模糊查询需要左右各拼接一个’%’,如:like %key% 。 项目情况: mybatis中动态传参一般采用占位符#{key}。使用数据库:orecle。 错误的尝试: 尝试使用: like % #{key} %这样写不起作用…

linux构建主从域名服务器

实验步骤:一、构建主域名服务器1、安装域名服务(BIND服务器软件包)BIND软件包是目前Linux下使用最广泛的DNS服务器安装包,它可以运行到大多数UNIX服务器中,也包括Linux系统。RHEL4默认没有安装BIND服务器软件包&#x…

HashMap的put方法(Java7)和putVal方法(Java8)

目录数组链表:存在性能最坏情况O(n)Java7的HashMap的put方法思路数组链表红黑树:性能提高到O(logn)Java8的HashMap的putVal方法思路数组链表:存在性能最坏情况O(n) Java8以前,HashMap底层数据结构采用数组链表的结构。 数组特点&…

管道过滤器(Pipe-And-Filter)模式

按照《POSA(面向模式的软件架构)》里的说法,管道过滤器(Pipe-And-Filter)应该属于架构模式,因为它通常决定了一个系统的基本架构。管道过滤器和生产流水线类似,在生产流水线上,原材料在流水线上经一道一道的…