Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4654


Ignore:
Timestamp:
10/29/10 12:55:50 (12 years ago)
Author:
mkommend
Message:

Reused SaveFileDialog and renamed menu item to "Export Chart" (ticket #1237).

Location:
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.Designer.cs

    r4637 r4654  
    4747      this.components = new System.ComponentModel.Container();
    4848      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
    49       this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     49      this.exportChartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    5050      this.copyImageToClipboardBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     51      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
    5152      this.contextMenuStrip.SuspendLayout();
    5253      ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
     
    5657      //
    5758      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    58             this.saveImageToolStripMenuItem,
     59            this.exportChartToolStripMenuItem,
    5960            this.copyImageToClipboardBitmapToolStripMenuItem});
    6061      this.contextMenuStrip.Name = "contextMenuStrip";
    61       this.contextMenuStrip.Size = new System.Drawing.Size(257, 70);
     62      this.contextMenuStrip.Size = new System.Drawing.Size(257, 48);
    6263      //
    63       // saveImageToolStripMenuItem
     64      // exportChartToolStripMenuItem
    6465      //
    65       this.saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem";
    66       this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(256, 22);
    67       this.saveImageToolStripMenuItem.Text = "Save Image";
    68       this.saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click);
     66      this.exportChartToolStripMenuItem.Name = "exportChartToolStripMenuItem";
     67      this.exportChartToolStripMenuItem.Size = new System.Drawing.Size(256, 22);
     68      this.exportChartToolStripMenuItem.Text = "Export Chart";
     69      this.exportChartToolStripMenuItem.Click += new System.EventHandler(this.exportChartToolStripMenuItem_Click);
    6970      //
    7071      // copyImageToClipboardBitmapToolStripMenuItem
     
    7475      this.copyImageToClipboardBitmapToolStripMenuItem.Text = "Copy Image to Clipboard (Bitmap)";
    7576      this.copyImageToClipboardBitmapToolStripMenuItem.Click += new System.EventHandler(this.copyImageToClipboardBitmapToolStripMenuItem_Click);
     77      //
     78      // saveFileDialog
     79      //
     80      this.saveFileDialog.Filter = "\"Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|GIF " +
     81          "(*.gif)|*.gif|TIFF (*.tif)|*.tif\"";
     82      this.saveFileDialog.FilterIndex = 2;
    7683      //
    7784      // EnhancedChart
     
    8794
    8895    private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
    89     private System.Windows.Forms.ToolStripMenuItem saveImageToolStripMenuItem;
     96    private System.Windows.Forms.ToolStripMenuItem exportChartToolStripMenuItem;
    9097    private System.Windows.Forms.ToolStripMenuItem copyImageToClipboardBitmapToolStripMenuItem;
     98    private System.Windows.Forms.SaveFileDialog saveFileDialog;
    9199  }
    92100}
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.cs

    r4646 r4654  
    9494
    9595      public double ChartX(double pixelX, int width) {
    96         return ChartStartPosition.X - (pixelX - PixelStartPosition.X) * 
     96        return ChartStartPosition.X - (pixelX - PixelStartPosition.X) *
    9797          (ChartArea.AxisX.ScaleView.ViewMaximum - ChartArea.AxisX.ScaleView.ViewMinimum) /
    9898            (width * ChartArea.Position.Width * ChartArea.InnerPlotPosition.Width / 100 / 100);
    9999      }
    100100      public double ChartY(double pixelY, int height) {
    101         return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) * 
     101        return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) *
    102102          (ChartArea.AxisY.ScaleView.ViewMaximum - ChartArea.AxisY.ScaleView.ViewMinimum) /
    103103            (height * ChartArea.Position.Height * ChartArea.InnerPlotPosition.Height / 100 / 100);
     
    138138    #endregion
    139139
    140     private void saveImageToolStripMenuItem_Click(object sender, System.EventArgs e) {
    141       SaveFileDialog saveFileDialog = new SaveFileDialog();
    142 
    143       // Sets the current file name filter string, which determines
    144       // the choices that appear in the "Save as file type" or
    145       // "Files of type" box in the dialog box.
    146       saveFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif";
    147       saveFileDialog.FilterIndex = 2;
    148       saveFileDialog.RestoreDirectory = true;
    149 
     140    private void exportChartToolStripMenuItem_Click(object sender, System.EventArgs e) {
    150141      // Set image file format
    151142      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
Note: See TracChangeset for help on using the changeset viewer.