创建CAA对话框程序的详细步骤

2014-07-28 21:38:57|?次阅读|上传:wustguangh【已有?条评论】发表评论

关键词:C/C++, CAA, CATIA|来源:唯设编程网

使用CAA进行CATIA二次开发的时候,总是难免要和用户界面打交道,本文通过一个详细例子,介绍CAA开发对话框程序的详细流程。通常,使用CAA开发一个对话框程序的基本流程是:创建一个用于生产对话框的Module-> 创建交互式的Application-> 创建应用程序窗口(Window)-> 编译工程-> 生产代码提示-> 运行工程。

1. 创建一个用于生成对话框的Module

首先将Framework设置为当前活动项目,然后在其中新建一个名为CAADlgHelloApplication的Module,设置如下:

CAA对话框程序的详细流程

2. 创建交互式的Application

  1. 从文件菜单选择“Add CAAV5 Item->CAA V5 Class”:

CAA对话框程序的详细流程

  1. 在弹出的对话框中进行如下设置:

CAA对话框程序的详细流程

  1. 在“CAADlgHelloApplication.h”中手动添加BeginApplication和EndApplication方法,将默认的构造方法和复制、赋值函数设置成private,避免编译器自动生成默认的public方法被其他模块调用。最终的CAADlgHelloApplication.h文件如下:
#ifndef CAADlgHelloApplication_H

#define CAADlgHelloApplication_H

// COPYRIGHT DASSAULT SYSTEMES 2003

//=============================================================================

//  Abstract of the sample

//  -----------------------

//

//  This sample shows how implement a CATInteractiveApplication.

//

//=============================================================================

//  How to Launch the sample:

//  -------------------------

//

//  Type:

//    mkrun -c CAADlgHelloApplication

//

//=============================================================================

// Dialog Framework

#include "CATInteractiveApplication.h"

// Local Framework

class CAADlgHelloApplication: public CATInteractiveApplication {

  public:

    // Constructs the application given an identifier

    // Parameters:

    //    iIdentifier:

    //        The identifier

    CAADlgHelloApplication(const CATString &iIdentifier);

    virtual ~CAADlgHelloApplication();

    //Contains the application code 

    void BeginApplication();

    //Returns the application return code.

    int EndApplication();

  private:

    // Default constructor, not implemented

    // Set as private to prevent from compiler automatic creation as public.

    CAADlgHelloApplication ();

    // Copy constructor, not implemented

    // Set as private to prevent from compiler automatic creation as public.

    CAADlgHelloApplication(const CAADlgHelloApplication &iObjectToCopy);

    // Assignment operator, not implemented

    // Set as private to prevent from compiler automatic creation as public.

    CAADlgHelloApplication & operator = (const CAADlgHelloApplication &iObjectToCopy);

};

#endif
发表评论0条 】
网友评论(共?条评论)..
创建CAA对话框程序的详细步骤