示例#1
0
        /// <summary>
        ///
        /// </summary>
        public GanttControl()
        {
            InitializeComponent();

            _Properties          = new GanttProperties();
            _Properties.StartDay = Utils.GetMidnightDateTime(DateTime.Now);
            _Properties.StartRow = 0;
            _Scale           = 15.0;
            _Operation       = EMouseOperation.None;
            _VisibleTasks    = new List <TaskVisuals>();
            _SelectedProject = null;
            _SelectedTask    = null;

            _Brush_Background      = new SolidBrush(Color.White);
            _Brush_Name            = new SolidBrush(Color.Black);
            _Brush_Container       = new SolidBrush(Color.Black);
            _Brush_Project_Warning = new SolidBrush(Color.Red);
            _Brush_Task            = new SolidBrush(Color.Blue);
            _Brush_Task_Fixed      = new SolidBrush(Color.Gray);
            _Brush_Marker          = new SolidBrush(Color.Red);
            _Brush_Marker_Warning  = new SolidBrush(Color.Orange);
            _Brush_Trigram         = new SolidBrush(Color.White);
            _Brush_Day_Light       = new SolidBrush(Color.LightGray);
            _Brush_Day_Today       = new SolidBrush(Color.LightGreen);

            _Pen_Day           = new Pen(Color.Black, 1.0f);
            _Pen_Day_Light     = new Pen(Color.LightGray, 1.0f);
            _Pen_Selected_Task = new Pen(Color.Red, 2.0f);

            ScaleFonts();
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        private void BuildUI()
        {
            GanttProperties GanttProps = null;

            // Get Gantt control properties
            if (Projects.TabPages.Count > 0)
            {
                GanttProps = ((GanttControl)Projects.TabPages[TabGantt].Controls[0]).Properties;
            }

            // Clear tabs
            Projects.TabPages.Clear();

            // Create Gantt control
            Projects.TabPages.Add("Gantt");
            GanttControl Gantt = new GanttControl();

            Gantt.Dock = DockStyle.Fill;
            Gantt.setWorkspace(TheWorkspace);
            Projects.TabPages[TabGantt].Controls.Add(Gantt);

            // Set gantt properties
            if (GanttProps != null)
            {
                Gantt.Properties = GanttProps;
            }

            // Create resources control
            Projects.TabPages.Add("Ressources");
            ResourceControl Resources = new ResourceControl(TheWorkspace);

            Resources.Dock = DockStyle.Fill;
            Projects.TabPages[TabResources].Controls.Add(Resources);

            // Create project tabs
            foreach (Project AProject in TheWorkspace.Projects)
            {
                BuildProjectTab(AProject);
            }

            UpdateUI();
        }