'****************************************************************************
'* 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: <to be filled in>. *
'* *
'****************************************************************************
'****************************************************************************
'* 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: frmFind.vb *
'* TYPE: VISUAL_BASIC *
'* *
'* CREATED: PM 2006-07-27 Vrs 1.0. *
'* UPDATED: PM 2006-xx-xx *
'* *
'****************************************************************************
Option Strict On
Option Explicit On
Imports System.Windows.Forms
'The rest of the class is in frmFind.Designer.vb:
' Partial Class frmFind
' Inherits System.Windows.Forms.Form
Public Class frmFind
Public Structure findParametersStructure
Dim initialised As Boolean 'As we don't have a field that
' can be set to an invalid value...
Dim toFind As String
Dim matchCase2 As Boolean
Dim clearSelectionBeforeSearch As Boolean
Dim onlySearchSelection As Boolean
End Structure 'findParametersStructure
Private mParent As frmProteinList
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Sub New(ByRef anInOutParent As frmProteinList, _
ByVal aFindParameters As findParametersStructure)
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
If Not aFindParameters.initialised Then
aFindParameters.initialised = True
aFindParameters.clearSelectionBeforeSearch = True
aFindParameters.matchCase2 = False
aFindParameters.toFind = "histone"
aFindParameters.onlySearchSelection = False
End If
mParent = anInOutParent
'Just to be sure of no conflicts.
If aFindParameters.onlySearchSelection Then
aFindParameters.clearSelectionBeforeSearch = True
End If
'Visual stuff.
If True Then
txtFindWhat.Focus()
txtFindWhat.Text = aFindParameters.toFind
chkOnlySearchSelection.Checked = aFindParameters.onlySearchSelection
chkClearSelectionBeforeSearch.Checked = _
aFindParameters.clearSelectionBeforeSearch
If aFindParameters.onlySearchSelection Then
chkClearSelectionBeforeSearch.Enabled = True
End If
chkMatchCase.Checked = aFindParameters.matchCase2
End If
End Sub 'New
''****************************************************************************
''* <placeholder for header> *
''****************************************************************************
'Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
' Me.DialogResult = System.Windows.Forms.DialogResult.OK
' Me.Close()
'End Sub
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub txtFindWhat_TextChanged( _
ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
Handles txtFindWhat.TextChanged
'Find button should be dimmed if the search text is empty.
Dim newValue As Boolean = True
If txtFindWhat.Text = "" Then
newValue = False
End If
End Sub 'txtFindWhat_TextChanged
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub btnCancel_Button_Click( _
ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
Handles btnCancel_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub 'Cancel_Button_Click
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub btnFind_Button_Click( _
ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
Handles btnFind_Button.Click
Dim params As findParametersStructure
params.toFind = txtFindWhat.Text
params.clearSelectionBeforeSearch = chkClearSelectionBeforeSearch.Checked
params.matchCase2 = chkMatchCase.Checked
params.onlySearchSelection = chkOnlySearchSelection.Checked
mParent.SetFindParams(params)
Me.Close()
End Sub 'Find_Button_Click
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub chkOnlySearchSelection_CheckedChanged( _
ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
Handles chkOnlySearchSelection.CheckedChanged
Dim newVal As Boolean = chkOnlySearchSelection.Checked
If newVal = True Then
chkClearSelectionBeforeSearch.Checked = True
chkClearSelectionBeforeSearch.Enabled = False
Else
chkClearSelectionBeforeSearch.Enabled = True
End If
End Sub 'chkOnlySearchSelection_CheckedChanged
End Class 'frmFind
Generated by script codePublish.pl at 2009-01-05T15:20:59.