'****************************************************************************
'* Copyright (C) 2004 Peter Mortensen and Matthias Mann *
'* This file is part of MSQuant. *
'* *
'* MSQuant is distributed under the terms of *
'* the GNU General Public License. See src/COPYING.TXT or *
'* <http://www.gnu.org/licenses/gpl.txt> for details. *
'* *
'* MSQuant is free software; you can redistribute it *
'* and/or modify it under the terms of the GNU *
'* General Public License as published by the Free *
'* Software Foundation; either version 2 of the *
'* License, or (at your option) any later version. *
'* *
'* MSQuant is distributed in the hope that it will be *
'* useful, but WITHOUT ANY WARRANTY; without even the *
'* implied warranty of MERCHANTABILITY or FITNESS FOR *
'* A PARTICULAR PURPOSE. See the GNU General Public *
'* License for more details. *
'* *
'* You should have received a copy of the GNU General *
'* Public License along with MSQuant; if not, write to *
'* the Free Software Foundation, Inc., 59 Temple *
'* Place, Suite 330, Boston, MA 02111-1307 USA *
'* *
'* Purpose: User set of spectrum zoom range. *
'* Holds Class frmZoomRange, see below for *
'* documentation. *
'* *
'****************************************************************************
'****************************************************************************
'* CEBI *
'* Software Development Group *
'* Peter Mortensen *
'* E-mail: NUKESPAMMERSdrmortensen@get2netZZZZZZ.dk *
'* WWW: http://www.cebi.sdu.dk/ *
'* *
'* Program for post-processing of result from search in mass *
'* spectrometric data. *
'* *
'* FILENAME: frmZoomRange.vb *
'* TYPE: VISUAL_BASIC *
'* *
'* CREATED: PM 2005-03-03 Vrs 1.0. Estimated date... *
'* UPDATED: PM 2005-xx-xx *
'* *
'****************************************************************************
Option Strict On
Option Explicit On
'****************************************************************************
'd$ <summary>
'd$ Purpose: Let the user set a zoom range for a mass spectrum.
'd$
'd$ <see cref="T:VBXMLDoc.CVBXMLDoc" />.
'd$ <applicationname>test_rawDataFileHandling</applicationname>
'd$ <author>Peter Mortensen</author>
'd$ <seealso>http://www.cebi.sdu.dk/</seealso>
'd$ <codetype>GUI</codetype>
'd$ </summary>
Public Class frmZoomRange
Inherits System.Windows.Forms.Form
'Dialog is tied to that particular form....
Private mParentForm As frmProtValidation
#Region " Windows Form Designer generated code "
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Sub New( _
ByVal aZoom As massZoomStructure, _
ByRef aParentForm As frmProtValidation)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
Init(aZoom, aParentForm)
End Sub 'New
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtStartMass As System.Windows.Forms.TextBox
Friend WithEvents txtEndMass As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.btnCancel = New System.Windows.Forms.Button
Me.btnOK = New System.Windows.Forms.Button
Me.Label1 = New System.Windows.Forms.Label
Me.txtStartMass = New System.Windows.Forms.TextBox
Me.txtEndMass = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'btnCancel
'
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(208, 105)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(72, 24)
Me.btnCancel.TabIndex = 100
Me.btnCancel.Text = "&Cancel"
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(115, 105)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(75, 23)
Me.btnOK.TabIndex = 101
Me.btnOK.Text = "&OK"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(32, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(104, 16)
Me.Label1.TabIndex = 5
Me.Label1.Text = "Start mass [Da]:"
'
'txtStartMass
'
Me.txtStartMass.Location = New System.Drawing.Point(144, 16)
Me.txtStartMass.Name = "txtStartMass"
Me.txtStartMass.Size = New System.Drawing.Size(80, 20)
Me.txtStartMass.TabIndex = 6
Me.txtStartMass.Text = "0"
Me.txtStartMass.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'txtEndMass
'
Me.txtEndMass.Location = New System.Drawing.Point(144, 48)
Me.txtEndMass.Name = "txtEndMass"
Me.txtEndMass.Size = New System.Drawing.Size(80, 20)
Me.txtEndMass.TabIndex = 8
Me.txtEndMass.Text = "9000"
Me.txtEndMass.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(32, 48)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(104, 16)
Me.Label2.TabIndex = 7
Me.Label2.Text = "End mass [Da]:"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(12, 64)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(72, 23)
Me.Label3.TabIndex = 102
Me.Label3.Text = "Label3"
'
'frmZoomRange
'
Me.AcceptButton = Me.btnOK
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(292, 141)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.txtEndMass)
Me.Controls.Add(Me.txtStartMass)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnOK)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmZoomRange"
Me.Text = "Zoom Range"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub Init( _
ByVal aZoom As massZoomStructure, _
ByRef aParentForm As frmProtValidation)
mParentForm = aParentForm
txtStartMass.Text = aZoom.startMass.ToString("#.#####")
txtEndMass.Text = aZoom.endMass.ToString("#.#####")
End Sub 'Init
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub btnCancel_Click( _
ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
Handles btnCancel.Click
Me.Close()
End Sub 'btnCancel_Click
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub btnOK_Click( _
ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
Handles btnOK.Click
'No validation....
Dim startMass As Double = CDbl(txtStartMass.Text)
Dim endMass As Double = CDbl(txtEndMass.Text)
Dim zoom As massZoomStructure
zoom.startMass = startMass
zoom.endMass = endMass
zoom.maxYVal = -1
mParentForm.setZoomRange(zoom)
Me.Close()
End Sub 'btnOK_Click
End Class 'frmZoomRange
Generated by script codePublish.pl at 2008-09-23T11:59:18.