/// <summary> /// Конструктор. /// </summary> /// <param name="GanttParent">Объект ПЛМ, от имени которого запущена диаграмма Гантта</param> /// <param name="GanttDiag">Диаграмма, на которой происходит рисование (передаётся из родительской формы)</param> /// <param name="InstHelperPLM">Объект ПЛМ, от имени которого запущена диаграмма Гантта</param> public CustExpand(InfoObject GanttParent, Gantt GanttDiag, HelperPLM InstHelperPLM) { this.GanttDiag = GanttDiag; this.GanttParent = GanttParent; this.InstHelperPLM = InstHelperPLM; }
public frmMain(InfoObject obj, EntityAttribute attr, String job) { this.Font = SystemFonts.MessageBoxFont; InitializeComponent(); this.DefGanttComparer = ucGantt1.gantt1.LayoutLogic.ItemComparer; SetFormFont(); MyJob = job; MyObj = obj; if (attr != null) MyAttr = attr.CollectionElements; ucGantt1.gantt1.Project.Text = (MyObj != null ? MyObj["TaskName"].ToString() : ""); if (MyJob != "Project") { // You want a readonly control ? ucGantt1.gantt1.AllowEdit = false; ucGantt1.ganttDataGrid1.AllowEdit = false; ucGantt1.ganttDataGrid1.SelectionMode = GanttDataGrid.GanttDataGridSelectionModes.Row; } ucGantt1.gantt1.SuspendItemLayout(); ucGantt1.ganttDataGrid1.SelectionMode = GanttDataGrid.GanttDataGridSelectionModes.Cell; ucGantt1.gantt1.ItemsChanged += new EventHandler(gantt1_ItemsChanged); ucGantt1.gantt1.SelectionChanged += new Gantt.SelectionChangedEventHandler(gantt1_SelectionChanged); ucGantt1.ganttDataGrid1.UpdateEditMenu += new EventHandler(ganttDataGrid1_UpdateEditMenu); ucGantt1.gantt1.ViewModeChanged += new EventHandler(gantt1_ViewModeChanged); ucGantt1.gantt1.ItemDoubleClick += new KS.Gantt.Gantt.ItemDoubleClickEventHandler(gantt1_ItemDoubleClick); ucGantt1.gantt1.ItemClick += new KS.Gantt.Gantt.ItemClickEventHandler(gantt1_ItemClick); ucGantt1.gantt1.BeforeDelete += new KS.Gantt.Gantt.BeforeDeleteEventHandler(gantt1_BeforeDelete); // ucGantt1.gantt1.Update += new da(gantt1_Updata); ucGantt1.gantt1.MovingItem += new KS.Gantt.Gantt.MovingItemEventHandler(gantt1_MovingItem); ucGantt1.gantt1.ItemsMoved += new EventHandler(gantt1_ItemsMoved); ucGantt1.gantt1.ItemsResized += new EventHandler(gantt1_ItemsResized); ucGantt1.gantt1.ItemHover += new KS.Gantt.Gantt.ItemHoverEventHandler(gantt1_ItemHover); ucGantt1.gantt1.AfterAddItem2Group += new Gantt.AfterAddItem2GroupEventHandler(gantt1_AfterAddItem2Group); SetGanttDefaults(); #region Настройка команд меню mnuSelectAll.Click += new EventHandler(mnuSelectAll_Click); mnuInverseSelection.Click += new EventHandler(mnuInverseSelection_Click); mnuCollapseGroups.Click += new EventHandler(mnuCollapseGroups_Click); mnuExpandGroups.Click += new EventHandler(mnuExpandGroups_Click); mnuUndo.Click += new EventHandler(mnuUndo_Click); mnuUndo1.Click += new EventHandler(mnuUndo_Click); mnuRedo.Click += new EventHandler(mnuRedo_Click); mnuRedo1.Click += new EventHandler(mnuRedo_Click); mnuCut.Click += new EventHandler(mnuCut_Click); mnuCopy.Click += new EventHandler(mnuCopy_Click); mnuPaste.Click += new EventHandler(mnuPaste_Click); mnuDelete.Click += new EventHandler(mnuDelete_Click); mnuTaskView.Click += new EventHandler(mnuTaskView_Click); mnuResourceView.Click += new EventHandler(mnuResourceView_Click); mnuExit.Click += new EventHandler(mnuExit_Click); mnuZoomToFit.Click += new EventHandler(mnuZoomToFit_Click); mnuCenterNow.Click += new EventHandler(mnuCenterNow_Click); mnuZoomIn.Click += new EventHandler(mnuZoomIn_Click); mnuZoomOut.Click += new EventHandler(mnuZoomOut_Click); mnuAddTask.Click += new EventHandler(mnuAddTask_Click); mnuAddTask1.Click += new EventHandler(mnuAddTask_Click); mnuAddGroup.Click += new EventHandler(mnuAddGroup_Click); mnuAddGroup1.Click += new EventHandler(mnuAddGroup_Click); mnuAddResource.Click += new EventHandler(mnuAddResource_Click); mnuAddResource1.Click += new EventHandler(mnuAddResource_Click); mnuNew1.Click += new EventHandler(mnuNew_Click); mnuNew.Click += new EventHandler(mnuNew_Click); mnuNewInstance.Click += new EventHandler(mnuNewInstance_Click); //mnuOpen1.Click += new EventHandler(mnuOpen_Click); //mnuOpen.Click += new EventHandler(mnuOpen_Click); mnuSave1.Click += new EventHandler(mnuSave_Click); mnuSave.Click += new EventHandler(mnuSave_Click); mnuSaveAs.Click += new EventHandler(mnuSaveAs_Click); mnuExportAsImage.Click += new EventHandler(mnuExportAsImage_Click); mnuExportAsXML.Click += new EventHandler(mnuExportAsXML_Click); mnuImportFromXML.Click += new EventHandler(mnuImportFromXML_Click); mnuPrintPageSetup.Click += new EventHandler(mnuPrintPageSetup_Click); mnuPrintPreview.Click += new EventHandler(mnuPrintPreview_Click); mnuPrint.Click += new EventHandler(mnuPrint_Click); mnuAbout.Click += new EventHandler(mnuAbout_Click); mnuAbout1.Click += new EventHandler(mnuAbout_Click); mnuHelpIndex.Click += new EventHandler(mnuHelpIndex_Click); mnuHelpIndex1.Click += new EventHandler(mnuHelpIndex_Click); mnuKrollSoftwareWebsite.Click += new EventHandler(mnuKrollSoftwareWebsite_Click); mnuProjectSettings.Click += new EventHandler(mnuProjectSettings_Click); mnuProjectSettings1.Click += new EventHandler(mnuProjectSettings_Click); mnuProjectCalendars.Click += new EventHandler(mnuProjectCalendars_Click); mnuProjectCalendars1.Click += new EventHandler(mnuProjectCalendars_Click); mnuProjectCost.Click += new EventHandler(mnuProjectCost_Click); mnuProjectCost1.Click += new EventHandler(mnuProjectCost_Click); mnuASAP.Click += new EventHandler(mnuASAP_Click); mnuASAP1.Click += new EventHandler(mnuASAP_Click); mnuSolve.Click += new EventHandler(mnuSolve_Click); mnuSolve1.Click += new EventHandler(mnuSolve_Click); mnuPathDimming.Click += new EventHandler(mnuPathDimming_Click); ucGantt1.gantt1.PathDimmingChanged += new EventHandler(gantt1_PathDimmingChanged); mnuMaxZoomLevelGranularity.Checked = true; mnuMaxZoomLevelGranularity.Click += new EventHandler(mnuMaxZoomLevelGranularity_Click); mnuMaxZoomLevelMinute.Click += new EventHandler(mnuMaxZoomLevelMinute_Click); ucGantt1.gantt1.MaxZoomLevelChanged += new EventHandler(gantt1_MaxZoomLevelChanged); ucGantt1.gantt1.GranularityChanged += new EventHandler(gantt1_GranularityChanged); mnuFind.Click += new EventHandler(mnuFind_Click); mnuFindMore.Click += new EventHandler(mnuFindMore_Click); mnuFind1.Click += new EventHandler(mnuFind_Click); mnuFindMore1.Click += new EventHandler(mnuFindMore_Click); #endregion ucGantt1.gantt1.ResetModified(); ucGantt1.gantt1.HistoryClear(); ucGantt1.gantt1.ResumeItemLayout(); ucGantt1.gantt1.HistoryChanged += new EventHandler(gantt1_HistoryChanged); ucGantt1.gantt1.ShowStatus += new Gantt.ShowStatusEventHandler(gantt1_ShowStatus); tabMain.SelectedIndexChanged += new EventHandler(tabMain_SelectedIndexChanged); SetUpContextMenu(); SetUpContextMenu4DataGrid(); // Test Topo ucGantt1.gantt1.CustomItemTextDisplay += new Gantt.ItemTextDisplayEventHandler(gantt1_CustomItemTextDisplay); this.KeyDown += new KeyEventHandler(frmMain_KeyDown); // *************** Load ****************** ucGantt1.parent = this; ucTasks1.GanttControl = ucGantt1.gantt1; ucTasks1.parent = this; ucResources1.GanttControl = ucGantt1.gantt1; ucGroups1.GanttControl = ucGantt1.gantt1; ucSkills1.GanttControl = ucGantt1.gantt1; ucSchedule1.GanttControl = ucGantt1.gantt1; ucGantt1.gantt1.UndoRedoCalled += new EventHandler(gantt1_UndoRedoCalled); ResetLanguageMenu(); CheckSelectedLanguageMenu(); // Set some language specific texts ucGantt1.gantt1.NewTaskName = Properties.Resources.NewTaskName; ucGantt1.gantt1.WeekPrefix = Properties.Resources.WeekPrefix; ucGantt1.gantt1.PathDimming = Strings.GetSafeBool(Program.GetMySetting("PathDimming", 1)); bool bMaxZoomLevelMinute = Strings.GetSafeBool(Program.GetMySetting("MaxZoomLevelMinute", 1)); if (bMaxZoomLevelMinute) ucGantt1.gantt1.MaxZoomLevel = Gantt.ZoomLevels.Minute; else ucGantt1.gantt1.MaxZoomLevel = Gantt.ZoomLevels.Granularity; KS.Gantt.Helpers.DialogTitle = Program.DialogTitle; // MRU FileList mruManager = new MRUManager(); mruManager.Initialize( this, // owner form mnuFileMRU, // Recent Files menu item Program.C_RegistrySectionKey); // Registry path to keep MRU list // Optional. Call these functions to change default values: //mruManager.CurrentDir = "....."; // default is current directory mruManager.MaxMRULength = 7; // default is 10 mruManager.MaxDisplayNameLength = 60; // default is 40 #region Some Shortcuts // Setting Shortcut Keys by resource, throws errors in different Visual-Studio language versions. // This is, why we set them by code mnuNew.ShortcutKeys = Keys.N | Keys.Control; mnuNewInstance.ShortcutKeys = Keys.N | Keys.Control | Keys.Alt; mnuOpen.ShortcutKeys = Keys.O | Keys.Control; mnuSave.ShortcutKeys = Keys.S | Keys.Control; mnuSaveAs.ShortcutKeys = Keys.S | Keys.Control | Keys.Alt; mnuPrint.ShortcutKeys = Keys.P | Keys.Control; mnuTaskView.ShortcutKeys = Keys.T | Keys.Control; mnuResourceView.ShortcutKeys = Keys.R | Keys.Control; mnuZoomToFit.ShortcutKeys = Keys.M | Keys.Control; mnuCenterNow.ShortcutKeys = Keys.M | Keys.Alt; mnuSelectAll.ShortcutKeys = Keys.A | Keys.Control; mnuUndo.ShortcutKeys = Keys.Z | Keys.Control; mnuRedo.ShortcutKeys = Keys.Y | Keys.Control; mnuDelete.ShortcutKeys = Keys.Delete; mnuCut.ShortcutKeys = Keys.X | Keys.Control; mnuCopy.ShortcutKeys = Keys.C | Keys.Control; mnuPaste.ShortcutKeys = Keys.V | Keys.Control; mnuFind.ShortcutKeys = Keys.F | Keys.Control; mnuASAP.ShortcutKeys = Keys.L | Keys.Control; mnuExpandGroups.ShortcutKeys = Keys.Oemplus | Keys.Control; mnuCollapseGroups.ShortcutKeys = Keys.OemMinus | Keys.Control; mnuExpandGroups.ShortcutKeyDisplayString = "Ctrl + Plus"; mnuCollapseGroups.ShortcutKeyDisplayString = "Ctrl + Minus"; #endregion InstHelperPLM = new HelperPLM(this.MyObj, ucGantt1.gantt1); }
// private Dictionary<InfoObject, ResourceItem> dictResurce = new Dictionary<InfoObject, ResourceItem>(); /// <summary> /// Конструктор. /// </summary> /// <param name="GanttDiag">Диаграмма, на которой происходит рисование (передаётся из родительской формы)</param> public HelperResource(Gantt GanttDiag, HelperPLM ParentHelper) { this.GanttDiag = GanttDiag; this.ParentHelper = ParentHelper; }