示例#1
0
        public static void ShowModule(string name, DevExpress.XtraEditors.GroupControl group, ChartAppearanceMenu chartAppearanceMenu, IDXMenuManager menuManager, DevExpress.Utils.Frames.ApplicationCaption caption)
        {
            ModuleInfo item          = ChartModulesInfo.GetItem(name);
            Cursor     currentCursor = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                Control oldTutorial = null;
                if (Instance.CurrentModuleBase != null)
                {
                    if (Instance.CurrentModuleBase.Name == name)
                    {
                        return;
                    }
                    oldTutorial = Instance.CurrentModuleBase.TModule;
                }

                TutorialControlBase tutorialBase = item.TModule as TutorialControlBase;
                tutorialBase.Bounds        = group.DisplayRectangle;
                Instance.CurrentModuleBase = item;
                tutorialBase.Visible       = false;
                group.Controls.Add(tutorialBase);
                tutorialBase.Dock = DockStyle.Fill;

                //-----Init----
                //-----Set----
                tutorialBase.TutorialName = name;
                tutorialBase.Caption      = caption;

                TutorialControl tutorial = tutorialBase as TutorialControl;
                if (tutorial != null)
                {
                    tutorial.MenuManager = menuManager;
                }

                ChartModuleBase chartDemo = tutorialBase as ChartModuleBase;
                chartAppearanceMenu.UpdateAppearanceAndPalette();

                bool wizardAndPrintAndAppearancesMenuEnabled = chartDemo != null;
                chartAppearanceMenu.EnableWizardAndPrintAndAppearancesMenu(wizardAndPrintAndAppearancesMenuEnabled);
                //------------

                tutorialBase.Visible = true;
                item.WasShown        = true;
                if (oldTutorial != null)
                {
                    oldTutorial.Visible = false;
                }
            }
            finally
            {
                Cursor.Current = currentCursor;
            }
            RaiseModuleChanged();
        }
        void OnExportImageClick(object sender, ItemClickEventArgs e)
        {
            BarExportToImageItem item = e.Item as BarExportToImageItem;

            if (item == null)
            {
                return;
            }
            ChartModulesInfo.ExportToImage(item.ImageCodecInfo, item.ImageFormat);
        }
        void SetPaletteName(string name)
        {
            if (miPalettes == null)
            {
                return;
            }
            paletteName = name;
            string appearanceName = ChartModulesInfo.SetPaletteName(paletteName);

            if (appearanceName.Length > 0)
            {
                this.appearanceName = appearanceName;
            }
            UpdateMenu();
        }
        void SetAppearanceName(string name)
        {
            if (miAppearances == null)
            {
                return;
            }
            appearanceName = name;
            string paletteName = ChartModulesInfo.SetAppearanceName(appearanceName);

            if (paletteName.Length > 0)
            {
                this.paletteName = paletteName;
            }
            UpdateMenu();
        }
 void miRunChartWizard_Click(object sender, ItemClickEventArgs e)
 {
     ChartModulesInfo.RunChartWizard();
 }
 void miExportToXls_Click(object sender, ItemClickEventArgs e)
 {
     ChartModulesInfo.ExportToXls();
 }
 void miPrintPreview_Click(object sender, ItemClickEventArgs e)
 {
     ChartModulesInfo.PrintPreview();
 }
 internal void UpdateAppearanceAndPalette()
 {
     ChartModulesInfo.SetAppearanceName(appearanceName);
     ChartModulesInfo.SetPaletteName(paletteName);
 }
示例#9
0
 public static void Register()
 {
     ChartModulesInfo.Add("ChartModule", typeof(ucChartModule), "图表分析");
     ChartModulesInfo.Add("TemplateChartModule", typeof(ucTemplateChartModule), "图表模板展示");
 }