VoidT createNewDocLineBook() { F_ObjHandleT bookId; StringT path, bookPath; IntT err; /* Choose workspace for new docline project */ err = F_ApiChooseFile(&path, "Choose directory to save new docline project", "", "", FV_ChooseOpenDir, ""); if (err) return; /* Open template book and save it to the selected directory*/ bookId = F_ApiSimpleOpen("C:\\Program Files\\Adobe\\FrameMaker8\\Structure\\xml\\docline\\docline_book_template.book",False); bookPath = F_Alloc(F_StrLen(path)+F_StrLen(defaultBookName)+3,NO_DSE); F_Sprintf(bookPath,"%s\\%s\0", path, defaultBookName); F_ApiDeallocateString(&path); F_ApiSimpleSave(bookId, bookPath, False); F_ApiDeallocateString(&bookPath); }
VoidT ProcTemplateDesignerEvent(F_ObjHandleT dlgId, IntT itemNum) { StringT newname = NULL; IntT err = 0; switch (itemNum) { case DLG_DTPL_FMTPL_CK: EnableItems(dlgId, DLG_DTPL_FMTPL_BOX, DLG_DTPL_OVERS_CK, GetDlgState(dlgId, itemNum)); DesignerChanged = True; break; case DLG_DTPL_FMTPL_BOX: /* prohibit direct changes from typing in box */ SetDlgText(dlgId, DLG_DTPL_FMTPL_BOX, FMTemplateName); break; case DLG_DTPL_FMTPL_BTN: #if 0 err = F_ApiChooseFile(&newname, ChooseTemplateFileStr, CurrProjPath, FMTemplateName, FV_ChooseSelect, (StringT) ""); #else M2GGetOpenFile(ChooseTemplateFileStr, CurrProjPath, &newname); #endif if (!err && (newname != NULL)) { SetDlgText(dlgId, DLG_DTPL_FMTPL_BOX, FMTemplateName = newname); newname = NULL; } DesignerChanged = True; break; case DLG_DTPL_PSTYL_CK: case DLG_DTPL_CSTYL_CK: case DLG_DTPL_TABLS_CK: case DLG_DTPL_XREFS_CK: case DLG_DTPL_CONDS_CK: case DLG_DTPL_CFNTS_CK: case DLG_DTPL_PAGES_CK: case DLG_DTPL_REFPGS_CK: case DLG_DTPL_VARS_CK: case DLG_DTPL_COLORS_CK: case DLG_DTPL_EQUS_CK: case DLG_DTPL_DOCS_CK: case DLG_DTPL_OVERS_CK: case DLG_DTPL_PBRKS_CK: DesignerChanged = True; break; case DLG_DTPL_WDTPL_CK: EnableItems(dlgId, DLG_DTPL_AUTOUP_CK, DLG_DTPL_WDTPL_BTN, GetDlgState(dlgId, itemNum)); DesignerChanged = True; break; case DLG_DTPL_AUTOUP_CK: DesignerChanged = True; break; case DLG_DTPL_WDTPL_BOX: /* prohibit direct changes from typing in box */ SetDlgText(dlgId, DLG_DTPL_WDTPL_BOX, WDTemplateName); break; case DLG_DTPL_WDTPL_BTN: #if 0 err = F_ApiChooseFile(&newname, ChooseTemplateFileStr, CurrProjPath, WDTemplateName, FV_ChooseSelect, (StringT) ""); #else M2GGetOpenFile(ChooseTemplateFileStr, CurrProjPath, &newname); #endif if (!err && (newname != NULL)) { SetDlgText(dlgId, DLG_DTPL_WDTPL_BOX, WDTemplateName = newname); newname = NULL; } DesignerChanged = True; break; default: break; } }