ProjectManager, Project and ProjectFile in Code::Blocks

CB-Project-File IDE的内部实现中,关于项目和文件之间的关系和数据保存主要维护在Project,和ProjectFile这几个类里面。在里面有几个部分:1)View:包括m_pNotebook, m_pTree, m_plugin等;2)Status:包括m_isLoadingProject, m_isclosingProject, m_isCheckingForExternallyModifiedProject等,从字面意义上就可以看出它们的用途;3)Project:包括m_pActiveProject和指针*m_pProjects。这个当前活动的项目m_pActiveProject就是Project类的实例。

Continue reading ProjectManager, Project and ProjectFile in Code::Blocks - 全文阅读

FLTK & the List of Widget toolkits based on C/C++

Fltk_widget_toolkit All below widget toolkits are cross platform and based on C/C++(from wikipedia):

CEGUI · Component Library for Cross Platform · dlib C++ Library · FLTK · FOX toolkit · OpenGL User Interface Library · GTK+ · IUP · Juce · Qt · Tk · TnFOX · Visual Component Framework · wxWidgets · YAAF · XForms · XVT

其中我们可以看到比较熟悉的FLTK,OpenGL,GTK+,Qt, 等。和QT或者相比,非常轻量级的FLTK也具有很多优点。

Continue reading FLTK & the List of Widget toolkits based on C/C++ - 全文阅读

wxWidget Layout Algorithm Demo - BoxPlanner

BoxPlanner Many applications specify absolute position and absolute sizes when they lay out controls in the parent window. This strategy has some drawbacks: The created cannot be resized, changes are difficult and creation of good looking is time consuming.

Another way which is very common in cross platform frameworks (, QT, …) is to use layout algorithm. A layout algorithm determines the size and position of its controls based on its policy. Although every control can provide its preferences about its size, position and alignment, the layout algorithm can ignore these preferences if they are against its layout policy.

Continue reading wxWidget Layout Algorithm Demo - BoxPlanner - 全文阅读

wxWidget 类型转换(wxString, wxdatatime)

samsung_transformer 在C++里常用类型转换感觉很杂,不好用;跟C#没得比:可以强类型转换,还有convert通用的转换,非常方便的说。刚用wxwidget时类型转换也是一头大,了解后发现要比MFC简洁好用多,接口也容易记住。下面上wxWidget常用类型转换:

一、wxstring与其他类型转换

    1.1 int  to wxString:     wxString str = wxString::Format(wxT("%i"),myInt);

    1.2    wxString to int :     int i;  i = wxAtoi(str);

    1.3    string to wxString:     std::string stlString = "sdfas"; wxString mystr(stlString .c_str(),wxConvUTF8);

Continue reading wxWidget 类型转换(wxString, wxdatatime) - 全文阅读

A rough guide for wxWidgets programming

puzzle1 从最基本的概念开始,一个wxWidgets程序需要从wxApp继承一个应用程序类并且该程序还必须有一个top-level的窗口(继承自wxFrame或者wxDialog)。这样就组成了一个最下化的应用程序实例,剩下的就是基于你设计的界面添加和逻辑部分。在Frame/Dialog之上,有wxPanel,wxSplitterWindow或者其他的窗口控件可供使用,在上一篇的Sizer/Frame/Panel关系的文章中大家已经看到如何利用这些元素组织和设计程序界面。

Continue reading A rough guide for wxWidgets programming - 全文阅读

wxWidgets Programming: Sizer, Frame and Panel

wxwidget-gui-library 个人感觉在wxWidgets UI编程时,一开始最难于理解和使用的就是,尤其是在与各种控件、Panel嵌套搭配的时候,包括对控件间隙以及父窗口大小发生改变时各个控件的变化定义等。在网上发现这篇文章非常详细的总结了, Frame和Panel的关系并通过简单的实例深入浅出地讲解了这一部分,转载在此供大家参考,如果你有相关技术问题或者开发心得也可以发评论参加讨论。

[原文如下] 最近在研究跨平台的C/C++ 库,基本说来功能强大,稳定且开源的库就是QT和wxWidgets了,关于他们之间具体的比较详见《WxWidgets Compared To Other Toolkits》。 N年以前研究过一段时间QT的代码,不过主要因为其在开发商用软件还是要一定的license费用,所以不能说是真正的免费跨平台。 wxWidgets则是一套免费开源的跨平台C++ 库,它的一个特点就是可以转换为native 的api图形界面。就是说用同样的代码,在平台看起来就是window风格的,在X 平台看起来就是linux风格的。

Continue reading wxWidgets Programming: Sizer, Frame and Panel - 全文阅读

Book: Cross-Platform GUI Programming with wxWidgets (Bruce Perens)(含中英文版本下载地址)

Cross-Platform GUI Programming with wxWidgets 以前通过学习Python认识了wxPython,那里面有很多文档和源代码实例可以参考学习,对编程帮助很大。后来在C++项目中也需要用到wxWidgets,发现这本书非常实用,结合wxWidgets的官方手册,编程感觉非常畅快。特别推荐大家阅读,如果你对wxWidgets编程感兴趣的话。有什么读书心得也可以跟贴共享给大家。

wxWidgets now has its own 700-page to help you learn or brush up on your cross-platform skills. Written by Julian Smart and Kevin Hock with Stefan Csomor, "Cross-Platform with wxWidgets" was published on July 27th 2005 by Prentice Hall. It’s part of Bruce Perens’ Series.

Continue reading Book: Cross-Platform GUI Programming with wxWidgets (Bruce Perens)(含中英文版本下载地址) - 全文阅读

CodeLite Plugin Internal(2)-Load: 插件加载分析

hat_dll_load 上回书说到接口和众插件之间的关系,这里讲讲插件加载的过程。加载点在系统初始化时Framezhong 调用,上次也说过。这里主要是从PluginManager::Load() 说起。首先读取插件配置文件 config/plugins.xml,并将信息保存到std::map<wxString, PluginInfo> m_pluginsInfo中,这个成员m_pluginsInfo是属于PluginManager,这个map保存了插件名称和Pluginfo的映射关系。接着TagManagerST和LanguageST互相赋值。

现在进入重点循环,针对插件目录下的每个.dll/.so文件,会进行1)加载动态库;2)读插件信息;3)加载插件;4)调用插件相关创建toolbar和menu的函数。下面一一详述:

Continue reading CodeLite Plugin Internal(2)-Load: 插件加载分析 - 全文阅读

Using XRC in wxWidgets based Application for UI design

WxWidgets 相信很多程序员有过类似的经历,想实现一款图形界面的应用软件。核心算法和后台程序都写好后,等到实现界面时总是发现缺乏艺术细胞,对自己设计的界面和对话框等不满意,或者是消耗在挑选控件、配色和布局等繁琐的工作中不能自拔,最终也许会因为UI的问题而导致放弃整个项目。一款没有优秀界面的应用软件在繁多的类似产品中很难获得用户的喜爱。利用wxWidgets我们可以将很多界面设计工作轻松搞定,而且利用XRC,XML based resource,规范,可以将界面设计工作和程序分离,独立的XML文件维护容易,简单直观而且可以使得程序本身只关注于逻辑,何乐而不为呢。

以下包括几个部分介绍XRC,有XRC介绍包括中英文的(摘自网络)和使用步骤,以及几个常用设计工具的链接。

Continue reading Using XRC in wxWidgets based Application for UI design - 全文阅读

 Page 1 of 2  1  2 »

Contact us

Admin: Bryan Wu