예제 #1
0
 void CustomObjectsManager_DynamicObjectBuiltEvent(CustomObjectsManager manager, DynamicCustomObject dynamicObject)
 {
     foreach (ToolStripItem item in toolStripDynamicObjects.Items)
     {
         if (item is ToolStripButton)
         {
             ((ToolStripButton)item).Checked = false;
         }
     }
 }
 void CustomObjectsManager_DynamicObjectBuiltEvent(CustomObjectsManager manager, DynamicCustomObject dynamicObject)
 {
     foreach (ToolStripItem item in toolStripDynamicObjects.Items)
     {
         if (item is ToolStripButton)
         {
             ((ToolStripButton)item).Checked = false;
         }
     }
 }
예제 #3
0
        /// <summary>
        /// 
        /// </summary>
        void InitializeElements()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);

            // Establishing a brand new state.
            _stateId = Guid.NewGuid();

            _drawingSpace = new RectangleF(0, 0, 0, 0);
            _drawingSpaceDisplayLimit = _drawingSpace;

            _actualSpaceGrid.Visible = false;
            _actualSpaceGrid.Pen = new Pen(Color.Gray);

            _yAxisLabelsPosition = YAxisLabelPosition.Right;

            _actualDrawingSpaceAreaMarginLeft = 15 + _additionalDrawingSpaceAreaMarginLeft;
            _actualDrawingSpaceAreaMarginTop = 60;
            _actualDrawingSpaceAreaMarginRight = 45 + _additionalDrawingSpaceAreaMarginRight;
            _actualDrawingSpaceAreaMarginBottom = 20;

            _resources = new ComponentResourceManager(typeof(ChartPane));

            _seriesTypeDynamicContextMenu = new ContextMenuStrip();

            _chartContextMenu = new ContextMenuStrip();
            _chartContextMenu.Opening += new CancelEventHandler(_chartContextMenu_Opening);

            ToolStripMenuItem item;

            item = new ToolStripMenuItem("Zoom In", ((Image)(_resources.GetObject("imageZoomIn"))), new EventHandler(ZoomInChartContextMenuItem_Click));
            _chartContextMenu.Items.Add(item);
            item = new ToolStripMenuItem("Zoom Out", ((Image)(_resources.GetObject("imageZoomOut"))), new EventHandler(ZoomOutChartContextMenuItem_Click));
            _chartContextMenu.Items.Add(item);
            _chartContextMenu.Items.Add(new ToolStripSeparator());

            item = new ToolStripMenuItem("Fit To Screen", ((Image)(_resources.GetObject("imageLayoutCenter"))), new EventHandler(FitToScreenChartContextMenuItem_Click));
            _chartContextMenu.Items.Add(item);
            item = new ToolStripMenuItem("Fit Horizontal", ((Image)(_resources.GetObject("imageLayoutHorizontal"))), new EventHandler(FitHorizontalChartContextMenuItem_Click));
            _chartContextMenu.Items.Add(item);
            item = new ToolStripMenuItem("Fit Vertical", ((Image)(_resources.GetObject("imageLayoutVertical"))), new EventHandler(FitVerticalChartContextMenuItem_Click));
            _chartContextMenu.Items.Add(item);
            _chartContextMenu.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem selectionContextMenuItem = new ToolStripMenuItem("Selection");
            foreach(string name in Enum.GetNames(typeof(SelectionModeEnum)))
            {
                ToolStripItem subItem = selectionContextMenuItem.DropDownItems.Add(name, null, new EventHandler(SelectionChartContextMenuItem_Click));
                subItem.Tag = name;
            }
            _chartContextMenu.Items.Add(selectionContextMenuItem);
            _chartContextMenu.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem scrollContextMenuItem = new ToolStripMenuItem("Scroll");
            foreach(string name in Enum.GetNames(typeof(ScrollModeEnum)))
            {
                ToolStripItem subItem = scrollContextMenuItem.DropDownItems.Add(name, null, new EventHandler(ScrollChartContextMenuItem_Click));
                subItem.Tag = name;
            }
            _chartContextMenu.Items.Add(scrollContextMenuItem);
            _chartContextMenu.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem appearanceContextMenuItem = new ToolStripMenuItem("Appearance");
            foreach(string name in Enum.GetNames(typeof(AppearanceSchemeEnum)))
            {
                ToolStripItem subItem = appearanceContextMenuItem.DropDownItems.Add(GeneralHelper.SeparateCapitalLetters(name), null, new EventHandler(AppearanceChartContextMenuItem_Click));
                subItem.Tag = name;
            }

            _chartContextMenu.Items.Add(appearanceContextMenuItem);
            _chartContextMenu.Items.Add(new ToolStripSeparator());

            _autoScrollToEndContextMenuItem = new ToolStripMenuItem("Auto Scroll to End", ((Image)(_resources.GetObject("imageScrollToEnd"))), new EventHandler(AutoScrollToEndChartContextMenuItem_Click));
            _autoScrollToEndContextMenuItem.CheckOnClick = true;
            _autoScrollToEndContextMenuItem.Checked = this.AutoScrollToEnd;
            _chartContextMenu.Items.Add(_autoScrollToEndContextMenuItem);

            _crossHairContextMenuItem = new ToolStripMenuItem("Crosshair", ((Image)(_resources.GetObject("imageTarget"))), new EventHandler(CrosshairChartContextMenuItem_Click));
            _crossHairContextMenuItem.CheckOnClick = true;
            _crossHairContextMenuItem.Checked = false;
            _chartContextMenu.Items.Add(_crossHairContextMenuItem);

            _labelsContextMenuItem = new ToolStripMenuItem("Labels", ((Image)(_resources.GetObject("imageText"))), new EventHandler(LabelsChartContextMenuItem_Click));
            _labelsContextMenuItem.CheckOnClick = true;
            _labelsContextMenuItem.Checked = true;
            _chartContextMenu.Items.Add(_labelsContextMenuItem);

            _limitViewContextMenuItem = new ToolStripMenuItem("Limit View", ((Image)(_resources.GetObject("imageElementSelection"))), new EventHandler(LimitViewChartContextMenuItem_Click));
            _limitViewContextMenuItem.CheckOnClick = true;
            _limitViewContextMenuItem.Checked = true;
            _chartContextMenu.Items.Add(_limitViewContextMenuItem);

            _chartContextMenu.Items.Add(new ToolStripSeparator());

            _seriesPropertiesContextMenuItem = new ToolStripMenuItem("Series Properties", null);
            _chartContextMenu.Items.Add(_seriesPropertiesContextMenuItem);

            _chartContextMenu.Items.Add(new ToolStripSeparator());

            _selectedObjectsContextMenuItem = new ToolStripMenuItem("Selected Object(s) Properties");
            _selectedObjectsContextMenuItem.DropDownItemClicked += new ToolStripItemClickedEventHandler(_selectedObjectsContextMenuItem_DropDownItemClicked);
            _chartContextMenu.Items.Add(_selectedObjectsContextMenuItem);

            _customObjectsManager = new CustomObjectsManager();
            _customObjectsManager.Initialize(this);

            _customObjectDrawingImage = ((Image)(_resources.GetObject("imageBrush")));
        }
예제 #4
0
 public void UnInitialize()
 {
     _manager = null;
 }
예제 #5
0
 public virtual bool Initialize(CustomObjectsManager manager)
 {
     SystemMonitor.CheckThrow(_manager == null);
     _manager = manager;
     return(true);
 }
 public void UnInitialize()
 {
     _manager = null;
 }
 public virtual bool Initialize(CustomObjectsManager manager)
 {
     SystemMonitor.CheckThrow(_manager == null);
     _manager = manager;
     return true;
 }