CodeLite代码分析之 – Create New Project流程

2590501425-tools3通过点击菜单Workspace->Create New Project,系统会 1)调用:Frame::OnProjectNewProject

2) 该函数中将创建对话框 NewProjectDlg,其中会读取 templates/projects目录下所有项目模板文件和编译器列表

3) 读取从第二步对话框中得到的数据并调用Manager::CreateProject ( ProjectData &data )创建项目。

所有的项目模板文件都是格式的,所以如果我们有新模板需求的话,可以定制自己的模板文件供用户使用。

在这个流程中比较重要的几个类有:

class WXDLLIMPEXP_LE_SDK Project

class WXDLLIMPEXP_LE_SDK ProjectItem

It’s a node item that represents a displayable project item ‘Displayable’ items are items that will be shown in the FileView control.

class FilewViewTreeItemData; a user defined class which stores a node private information.

class ProjectData
{
public:
    wxString m_name;    //< project name
    wxString m_path;    //< project directoy
    ProjectPtr m_srcProject; 这个是smartpointer 指向对话框创建的的项目类;typedef SmartPtr<Project> ProjectPtr;
    wxString m_cmpType; //< Project compiler type
};

当用户在New project对话框中选择完各项并点击OK时,所有参数会保存到ProjcetData并传递到Manager的CreateProject。

在创建项目前,如果还没有worksapce,系统会缺省创建一个workspace。

然后调用WorkspaceST::Get()->CreateProject创建项目。稍后还有一个比较重要的调用TagsManagerST::Get()->RetagFiles ( projectFiles );

通过它可以重新创建项目tag。[待续]

如转载请保留原文链接和作者信息: Bryan Wu. www.cbforge.com

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Slashdot
  • Technorati
  • TwitThis

Related posts:

  1. Codelite代码分析之 Singleton Pattern Template实现及应用
  2. CodeLite Plugin Internal(1) – IPlugin interface
  3. CodeLite to CodeInsight task 1: Internationalization
  4. CodeLite Plugin Internal(2)-Load: 插件加载分析
  5. Debugging With CodeLite - CodeLite调试简介
  6. wxWidget 类型转换(wxString, wxdatatime)

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Contact us

Admin: Bryan Wu