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)

最新文章

  1. 如何使用PullToRefresh
  2. ivy,ivyde插件-eclipse
  3. zBoot/Makefile
  4. 解决Autofac MVC 自动注入在 Areas拆分到不同dll下的注入失败问题
  5. 20145120 《Java程序设计》实验三实验报告
  6. windows下安装ubantu
  7. 关于C/C++函数指针声明的理解
  8. OpenCV中OpenCL模块函数
  9. jquery抖动的按钮
  10. Checking the Calendar
  11. centos6.5 源码安装 gtk 环境
  12. Lucence_Curd
  13. Handlebars模板引擎渲染页面
  14. .net 通用面试题
  15. ios12版本以上键盘唤起后,收回页面不回滚问题
  16. 类型限定词——const
  17. MYSQL行号
  18. 理解position定位
  19. [HNOI/AHOI2018]道路
  20. PyCharm使用Anaconda新建的环境

热门文章

  1. windows服务程序的编写
  2. 【批处理】TXT文件批量转HTML文件工具
  3. Centos7下查询jdk安装路径
  4. HDU 1159.Common Subsequence【动态规划DP】
  5. App 抓包代理设置
  6. JWT的浅谈
  7. redis系列之3----redis高级应用(主从、事务与锁、持久化)
  8. C. Game with Chips(陷阱暴力题)
  9. Android下拉刷新SwipeRefreshLayout简单用法
  10. java结合email实现自动推送