美文网首页
Ax formBuildDesign class

Ax formBuildDesign class

作者: axxxxxxxx | 来源:发表于2018-05-17 15:24 被阅读0次

    在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!");
        }
    }
    

    相关文章

      网友评论

          本文标题:Ax formBuildDesign class

          本文链接:https://www.haomeiwen.com/subject/novbdftx.html