コード例 #1
0
ファイル: Program.cs プロジェクト: 28427328/SQCharts
        public MainWindow()
            : base(WindowType.Toplevel)
        {
            this.barChart = new SmartQuant.Controls.BarChart.BarChart();
            this.barChart2 = new SmartQuant.Controls.BarChart.BarChart2();
            this.chart3 = new SmartQuant.FinChart.Chart();
            this.chart3.ActionType = ChartActionType.Cross;
            var nb = new Notebook();
            nb.Add(barChart);
            nb.SetTabLabelText(barChart, "Chart");
            nb.Add(barChart2);
            nb.SetTabLabelText(barChart2, "Chart(Gapless)");
            nb.Add(chart3);
            nb.SetTabLabelText(chart3, "Performance");
            Add(nb);
            SetDefaultSize(624, 362);

            DeleteEvent += (sender, e) =>
            {
                Application.Quit();
                e.RetVal = true;
            };

            var f = new Framework("Demo", true);
            f.IsDisposable = false;
            f.GroupDispatcher = new GroupDispatcher(f);
            this.barChart.Init(f, null, null);
            this.barChart2.Init(f, null, null);
            this.barChart.ResumeUpdates();
            this.barChart2.ResumeUpdates();

            GLib.Timeout.Add(500, new TimeoutHandler(delegate
            {
                barChart.UpdateGUI();
                barChart2.UpdateGUI();
                return true;
            }));

            // Until the framework is created, We cannot show them
            ShowAll();
        }