An IViewport that is placed over a world coordinate system and provides methods to transform between world and view coordinates
Inheritance: IViewport
Ejemplo n.º 1
0
        /// <summary>
        /// Construct a gantt chart
        /// </summary>
        public Chart()
        {
            CultureInfo culture = new GSD.Globalization.PersianCulture();
            culture.DateTimeFormat.ShortDatePattern = "yy/MM/dd";
            culture.DateTimeFormat.LongDatePattern = "yyyy/MM/dd";
            culture.DateTimeFormat.ShortTimePattern = "HH:mm:ss";
            culture.DateTimeFormat.LongTimePattern = "";
            Application.CurrentCulture = culture;

            // Designer values
            InitializeComponent();

            // Factory values
            HeaderOneHeight = 32;
            HeaderTwoHeight = 20;
            BarSpacing = 26;
            BarHeight = 20;
            BarWidth = 20;
            this.DoubleBuffered = true;
            var viewport = new ControlViewport(this);
            viewport.WheelDelta = BarSpacing;
            _mViewport = viewport;
            TimeScaleDisplay = GanttChart.TimeScaleDisplay.DayOfWeek;
            AllowTaskDragDrop = true;
            ShowRelations = true;
            ShowSlack = false;
            AccumulateRelationsOnGroup = false;
            ShowTaskLabels = true;
            this.Dock = DockStyle.Fill;
            this.Margin = new Padding(0, 0, 0, 0);
            this.Padding = new Padding(0, 0, 0, 0);
            // Formatting
            TaskFormat = new GanttChart.TaskFormat()
            {
                Color = Brushes.Black,
                Border = Pens.Maroon,
                BackFill = Brushes.MediumSlateBlue,
                ForeFill = Brushes.YellowGreen,
                SlackFill = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.LightDownwardDiagonal, Color.Blue, Color.Transparent)
            };
            CriticalTaskFormat = new GanttChart.TaskFormat()
            {
                Color = Brushes.Black,
                Border = Pens.Maroon,
                BackFill = Brushes.Crimson,
                ForeFill = Brushes.YellowGreen,
                SlackFill = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.LightDownwardDiagonal, Color.Red, Color.Transparent)
            };
            HeaderFormat = new GanttChart.HeaderFormat()
            {
                Color = Brushes.Black,
                Border = new Pen(SystemColors.ActiveBorder),
                GradientLight = SystemColors.ButtonHighlight,
                GradientDark = SystemColors.ButtonFace
            };
        }