https://github.com/bbqz007/zhelper-wxWidgets

https://github.com/bbqz007/zhelper-wxWidgets/tree/master/demo/smali-toolkit

zhelper-wxWidgets

a helper header help you easy to program gui app on wxWidgets 3.x

you can easily write menus like this

Frame* frame = new Frame;
Delegate* delegate = new Delegate(frame);
menu::begin(new MenuBar)
("File",
menu::begin(new Menu)
(ID_OPEN, "open")
[onclick = [=] (event& e) {
delegate->handle(e);
}]
(ID_NEW, "new")
[onclick, [=] (event& e) {
delegate->handle(e);
}]
(menu::end))
("About",
menu::begin(new Menu)
(ID_HELP, "help")
[onclick, [=] (event&) { }]
(menu::end))
(menu::end,
[=] (MenuBar* mb) {
frame->SetMenuBar(mb);
});

you can easily write windows like this as well:

Frame* frame = new Frame;
layout::begin(new layout)
(layout::begin(new layout)
[layout_flags]
(new textctrl)
[layout_flags]
[ ondropfiles = [] (event&) {} ]
[ onchar = [] (event&) {} ]
(new button)
[layout_flags]
[ onclick = [] (event&) {} ]
(layout::end))
(layout::begin(new layout)
[layout_flags]
(new textctrl)
[layout_flags]
(new button)
[layout_flags]
[ onclick = [] (event&) {} ]
(layout::end))
(layout::begin(new layout)
(new button)
[ onclick = [] (event&) {} ]
(layout::end))
(layout::begin(new layout)
(new button)
[ onclick = [] (event&) {} ]
(layout::end))
(layout::end,
layout::oncomplete = [=] (layout& layout) {
frame->SetLayout(layout);
});

just easy like writing a html

<div id='0'>
<div id='1'>
<input type="button" onclick="handler()">
</div>
<div id='2'>
<input type="button" onclick="handler()">
</div>
<div id='3'>
<input type="button" onclick="handler()">
</div>
<div id='4'>
<input type="button" onclick="handler()">
</div>
</div>

how to use?

just include the header and use c++11.

how to write layouts?

1.begin with calling layout::begin(somelayout)

2.add elements(layout or widget) to layout, by calling operator () (widget)

3.configure your latest added elements, by calling operator [] (prop)

4.end with calling operator () (layout::end)

just like

layout::begin(somelayout)   // begin to write a layout
[prop] // configure layout properties of somelayout
(new element) // add a element to somelayout
[prop] // configure layout properties of new element
[onclick = ...] // configure onclick function associated with new element
[onchar = ...] // configure onchar function associated with new element
(layout::end) // end up writing a layout

new features for programming with wxListCtrl

you do not need to fill things into item then insert and lots of code,

you do not need to know about the interfaces of wxListCtrl.

you just need to write () and [ ].

  1. easy way to write wxListCtrl headers (columns)
wxListCtrl* p = new wxListCtrl;
using namespace zhelper::wxWidgets::listctrlhlp;
column::begin(p)
("col 1") [ font ] [ color ]
("col 2") [ font ] [ color ]
(column::end)
  1. easy way to append rows into wxListCtrl
row::begin(p)
("row 1_col 1") [ font ] [ color ]
("row 1_col 2") [ font ] [ color ]
(row::another)
("row 2_col 1") [ font ] [ color ]
("row 2_col 2") [ font ] [ color ]
(row::end)
  1. easy way to modify cell of wxListCtrl
cell::begin(p)
(1, 1) // row 2 , col 2
[ "change value" ] [ change_font ] [ change_color ]
(0, 1) // row 1 , col 2
[ "change value" ] [ change_font ] [ change_color ]
(cell:end)

zwx_helper 只用小括号()和中括号[ ] 轻松开发wxWidgets的更多相关文章

  1. javascript小括号、中括号、大括号学习总结

    作为一名编程人员,和括号打交道是必不可少的.你可知道在不同的上下文中,括号的作用是不一样的,今天就让我们简单总结下javascript小括号.中括号.大括号的用法. 总的来说,JavaScript中小 ...

  2. Python的小括号( )、中括号[ ]和大括号{}分别代表什么?

    python语言最常见的括号有三种,分别是:小括号( ).中括号[ ]和大括号也叫做花括号{ },分别用来代表不同的python基本内置数据类型. 1.python中的小括号( ):代表tuple元组 ...

  3. JS使用正则表达式获取小括号、中括号及花括号内容的方法示例

    本文实例讲述了JS使用正则表达式获取小括号.中括号及花括号内容的方法.分享给大家供大家参考,具体如下: JS 正则表达式 获取小括号 中括号 花括号内的内容 <!DOCTYPE html> ...

  4. JavaScript小括号、中括号、大括号的多义性

    语义1,函数声明时参数表 func(arg1,arg2){ // ... } 语义2,和一些语句联合使用以达到某些限定作用 // 和for in一起使用 for(var a in obj){ // . ...

  5. bash 括号(小括号,双小括号,中括号,双中括号,大括号)

    小括号()和大括号{} 主要包括一下几种 ${var} $(cmd) ()和{} $((exp)) ${var:-string},${var:+string},${var:=string},${var ...

  6. shell中的括号(小括号,中括号,大括号)及单引号、 双引号,反引号(``)

    一.小括号,园括号() 1.单小括号 () ①命令组.括号中的命令将会新开一个子shell顺序执行,所以括号中的变量不能够被脚本余下的部分使用.括号中多个命令之间用分号隔开,最后一个命令可以没有分号, ...

  7. shell之小括号、中括号、大括号

    1.Shell中变量的原形:${var}  一串命令的执行 #等价于 $ var=test $ echo $var test #例如,用在这个位置 $ echo ${var}AA testAA 2.命 ...

  8. php使用正则表达式提取字符串中尖括号、小括号、中括号、大括号中的字符串

    $str="你好<我>(爱)[北京]{天安门}"; echo f1($str); //返回你好 echo f2($str); //返回我 echo f3($str); ...

  9. php正则:匹配(),{},[]小括号,大括号,中括号里面的内容

    php正则:匹配(),{},[]小括号,大括号,中括号里面的内容 比如有一段字符: $s='60c8 {"code":"200","message&q ...

随机推荐

  1. cmd命令行中无pip命令的解决办法

    cmd命令行中无pip命令的解决办法 只需简单的两步即可,按顺序执行以下命令(在cmd中): python -m ensurepip python -m pip install --upgrade p ...

  2. CentOS7虚拟机安装vmtools

    直接开始: 在安装vmtools之前,需要先安装两个小部件,否则将安装失败. 下面是步骤: 1.切换为root模式,需要输入root密码,但是不显示. 命令为: su 2.安装gcc 命令为: yum ...

  3. OSChina 周一乱弹 —— 为什么人类和人工智能定要一战

    2019独角兽企业重金招聘Python工程师标准>>> Osc乱弹歌单(2018)请戳(这里) [今日歌曲] @小小编辑:推荐歌曲,又失恋了 - 花粥 <又失恋了>- 花 ...

  4. Codeforces Round #618 (Div. 2)-Non-zero

    Guy-Manuel and Thomas have an array a of n integers [a1,a2,-,an]. In one step they can add 1 to any ...

  5. CF1336C Kaavi and Magic Spell

    CF1336C Kaavi and Magic Spell 区间dp 题意 给一个长度为 \(n\) 的字符串 \(S\) 和一个长度为 \(m\) 的字符串\(T\) ,\(1\le m\le n\ ...

  6. Jmeter简单压测之服务器监控

    此篇为最近工作需要到内容,故现在做一个总结. 最近家里电脑坏了,等待会公司空闲在编写. 文章构思中,敬请期待.......

  7. andorid jar/库源码解析

    前言 本篇作为开篇,会大体上说明,需要解读源码的,类库,或者jar. 序 原本,类库和jar的系列准备写到逆向系列课程的,但是那个东西,在写了两篇,就没有后续了,现在也不知道从哪里开始了, 只能等后期 ...

  8. 微信小程序-swiper(轮播图)抖动问题

    ps:问题 组件swiper(轮播图)真机上不自动滚动 一直卡在那里抖动 以前遇到这个问题,官方一直没有正面回复.就搁置了,不过有大半年没写小程序了也没去关注,今天就去看了下官方文档,发觉更新了点好东 ...

  9. react中dangerouslySetInnerHTML使用

    在react中,通过富文本编辑器进行操作后的内容,会保留原有的标签样式,并不能正确展示. 在显示时,将内容写入__html对象中即可.具体如下: <div dangerouslySetInner ...

  10. uCOS2014.1.9

    卢友亮P69 ptcb->OSTCBStat |= OS_STAT_SUSPEND; /*标志任务被挂起*/ 这句是标志人物被挂起成阻塞态的关键. OSTCBStat  //任务的当前状态标志 ...