在dialog中返回一个formBuildDesign的object,利用这个object,可以加formdesign的control,例如button
image.png
static void AKBackupMorphXVCData(Args _args)
{
SysDataExport sysDataExport;
SysDataImport sysDataImport;
Dialog dialog = new Dialog();
FormBuildRadioControl fbImportExport;
FormRadioControl radioResults;
dialog.addText("Warning, if you choose Import, this will replace your VCS data and is not reversible!");
// Add the radio button, name it anything
fbImportExport = dialog.formBuildDesign().addControl(FormControlType::RadioButton, 'RadioButton1');
fbImportExport.caption("Choose Import/Export");
fbImportExport.items(2);
fbImportExport.item(1);
fbImportExport.text("Export");
fbImportExport.item(2);
fbImportExport.text("Import");
dialog.doInit();
dialog.formRun().design().moveControl(fbImportExport.id());
dialog.run();
if (dialog.closedOk())
{
radioResults = dialog.formRun().control(fbImportExport.id());
if (radioResults.selection() == 0) // Export
{
sysDataExport = new SysDataExport();
sysDataExport.parmDoNotBypassDefIO(true);
sysDataExport.parmServerAccess(true);
sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlMorphXItemTable), false);
sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlMorphXLockTable), false);
sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlMorphXRevisionTable), false);
sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlParameters), false);
sysDataExport.addTmpExpImpTable(tableNum(SysVersionControlSynchronizeLog), false);
if (sysDataExport.prompt())
{
sysDataExport.parmFiletype(FileType::Binary);
sysDataExport.run();
}
}
else if (radioResults.selection() == 1) // Import
{
sysDataImport = new SysDataImport();
if (sysDataImport.prompt())
{
sysDataImport.parmLoadAll(true);
sysDataImport.parmInclTablesNotPerComp(true);
sysDataImport.parmFiletype(FileType::Binary);
sysDataImport.run();
versioncontrol.init();
}
}
info("Done!");
}
}
网友评论