zhenhj 发表于 2003-10-4 15:19:00

如何在图形属性扩展对话框上增加自己的表头?

在ObjectArxSDK示例中,有一个在选项扩展对话框上增加自己对话框的例子,哪位高手知道如何在图形属性扩展对话框上增加自己的表头?

关键就是如何获得图形属性扩展对话框的名称。例选项扩展对话框的名称是"OptionsDialog"。
For example:

extern "C" AcRx::AppRetCode acrxEntryPoint(
    AcRx::AppMsgCode msg, void* appId)
{
    switch (msg) {
    case AcRx::kInitAppMsg:
      acrxDynamicLinker->unlockApplication(appId);
      acrxDynamicLinker->registerAppMDIAware(appId);
      initApp();
      break;
    case AcRx::kUnloadAppMsg:
      unloadApp();
      break;
    case AcRx::kInitDialogMsg:
    // A dialog is initializing that we are interested in adding
    // tabs to.
      addMyTabs((CAdUiTabExtensionManager*)pkt);
      break;
    default:
      break;
    }
    return AcRx::kRetOK;
}
void initApp()
{
    InitMFC();
    // Do other initialization tasks here.
    acedRegCmds->addCommand(
      "MYARXAPP",
      "MYARXAPP",
      "MYARXAPP",
      ACRX_CMD_MODAL,
      &MyArxAppCreate);
    // Here is where we register the fact that we want to add
    // a tab to the Options dialog.
    acedRegisterExtendedTab("MYARXAPP.ARX", "OptionsDialog");
}
// CMyTab1 is subclassed from CAcUiTabExtension.
static CMyTab1* pTab1;
void addMyTabs(CAdUiTabExtensionManager* pXtabManager)
{
    // Allocate an extended tab if it has not been done already
    // and add it through the CAdUiTabExtensionManager.
    pTab1 = new CMyTab1;
    pXtabManager->AddTab(_hdllInstance, IDD_TAB1,
      "My Tab1", pTab1);
    // If the main dialog is resizable, add your control
    // resizing directives here.
    pTab1->StretchControlXY(IDC_EDIT1, 100, 100);
}
Then for the CMyTab1 class implementation:
void CMyTab1::PostNcDestroy()
// Override to delete added tab.
{
    delete pTab1;
    pTab1 = NULL;
    CAcUiTabExtension::PostNcDestroy();
}

lilin 发表于 2003-11-4 21:21:00

不错
页: [1]
查看完整版本: 如何在图形属性扩展对话框上增加自己的表头?