wxWidgets初学者导引(5)——用wxSmith进行可视化设计

论坛 期权论坛     
匿名小用户   2019-10-20 18:18   203   0
<div><strong>wxWidgets初学者导引全目录</strong><a data-token="ed4b1f3af18769fcba8af54fe7379359" href="http://download.csdn.net/detail/sxhelijian/7365537" rel="nofollow">PDF版及附件下载</a><div><a data-token="4355f46294cd6b52c727d9daaef805e8" href="http://blog.csdn.net/sxhelijian/article/details/26158709" rel="nofollow">1 前言</a><br><a data-token="ccd517d2ca2d39932bfb576e57562911" href="http://blog.csdn.net/sxhelijian/article/details/26163791" rel="nofollow">2 下载、安装wxWidgets</a><br><a data-token="cd56fe0597fd3be6550dc6a6a14e9909" href="http://blog.csdn.net/sxhelijian/article/details/26164181" rel="nofollow">3 wxWidgets应用程序初体验</a><br><a data-token="6853f4c9619e676d6b03cd9e670ec531" href="http://blog.csdn.net/sxhelijian/article/details/26164865" rel="nofollow">4 wxWidgets学习资料及利用方法指导</a><br><a data-token="d5b8e2573a27097076e986d4f4e6d884" href="http://blog.csdn.net/sxhelijian/article/details/26165237" rel="nofollow">5 用wxSmith进行可视化设计</a><br><a data-token="c5af4df76e0e291a6b91d6e32df1f51b" href="http://blog.csdn.net/sxhelijian/article/details/26165879" rel="nofollow">附:学习材料清单</a></div><br></div><h1><a name="_Toc14672"></a>5<span style="font-family:'宋体';">用</span><span style="font-family:'Times New Roman';">wxSmith</span><span style="font-family:'宋体';">进行可视化设计</span></h1><p>  按照第<span style="font-family:'Times New Roman';">4</span><span style="font-family:'宋体';">章的要求看过了相关的书籍,应该具备了通过直接写代码的方式界面程序的能力。而在实际的工程开发中,做界面的工作常通过可视化的操作完成。</span><span style="font-family:'Times New Roman';">wxSmith</span><span style="font-family:'宋体';">就是这样一个支持</span><span style="font-family:'Times New Roman';">wxWidgets</span><span style="font-family:'宋体';">快速开发的一个工具,专门用来做界面。</span></p><p>  wxSmith<span style="font-family:'宋体';">已经是</span><span style="font-family:'Times New Roman';">Code::Blocks</span><span style="font-family:'宋体';">的一个标准配置,在</span><span style="font-family:'Times New Roman';">Code::Blocks</span><span style="font-family:'宋体';">菜单中可以看到这一项。</span></p><p>  这一章,我们将从做一个应用程序开始。应用程序的窗口中有两个按钮,按<span style="font-family:'Times New Roman';">SayHello</span><span style="font-family:'宋体';">按钮,屏幕上会出现“</span><span style="font-family:'Times New Roman';">HelloWorld</span><span style="font-family:'宋体';">”,按</span><span style="font-family:'Times New Roman';">Quit</span><span style="font-family:'宋体';">按钮,程序将结束。</span></p><p><span style="font-family:'宋体';"><br></span></p><h2><a name="_Toc5533"></a>5.1<span style="font-family:'黑体';">用</span><span style="font-family:Arial;">wxSmith</span><span style="font-family:'黑体';">创建应用程序的外观</span></h2><p>  创建一个空项目,名称为<span style="font-family:'Times New Roman';">plain</span><span style="font-family:'宋体';">。选择菜单</span><span style="font-family:'Times New Roman';">wxSmith-&gt;AddwxFrame</span><span style="font-family:'宋体';">,将要建立的</span><span style="font-family:'Times New Roman';">Frame</span><span style="font-family:'宋体';">命名为</span><span style="font-family:'Times New Roman';">plainFrame</span><span style="font-family:'宋体';">。</span></p><p>  在左侧的<span style="font-family:'Times New Roman';">Management</span><span style="font-family:'宋体';">窗口中,显示</span><span style="font-family:'Times New Roman';">Resources</span><span style="font-family:'宋体';">页签,我们看到的界面如下图所示:</span></p><p>  <img alt="" src="https://201907.oss-cn-shanghai.aliyuncs.com/cs/5606289-61d9b72d76fd8f6f977285b75853e8de"></p><p>  窗口中由许多小点构成的部分,就是将来应用程序的界面部分,我们称之为“设计区”。</p><p>  在整个窗口的左下方,是“属性<span style="font-family:'Times New Roman';">/</span><span style="font-family:'宋体';">事件”窗口,被称为“属性编辑区”在其中可以设置属性,以及加入响应“</span><span style="font-family:'Times New Roman';">OnClick</span><span style="font-family:'宋体';">”之类事件的代码。点击靠左的</span>显示和设置“属性”,而右边的显示和设置“事件”(现在动手试一下)。</p><p>  现在只看到整个<span style="font-family:'Times New Roman';">Frame</span><span style="font-family:'宋体';">的属性和事件,我们做些修改。</span></p><p>  例如,将<span style="font-family:'Times New Roman';">Defaultsize</span><span style="font-family:'宋体';">属性后面的“√”取消掉,将随后的</span><span style="font-family:'Times New Roman';">Width</span><span style="font-family:'宋体';">和</span><span style="font-family:'Times New Roman';">Height</span><span style="font-family:'宋体';">分别设置为</span><span style="font-family:'Times New Roman';">400</span><span style="font-family:'宋体';">和</span><span style="font-family:'Times New Roman';">200</span><s
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:50
帖子:1079
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP