SaveNodeForm.cpp
上传用户:szb0815
上传日期:2007-06-13
资源大小:338k
文件大小:4k
- /*
- Software and source code Copyright (C) 1998-2000 Stanford University
- Written by Michael Eisen (eisen@genome.stanford.edu)
- This software is copyright under the following conditions:
- Permission to use, copy, and modify this software and its documentation
- is hereby granted to all academic and not-for-profit institutions
- without fee, provided that the above copyright notice and this permission
- notice appear in all copies of the software and related documentation.
- Permission to distribute the software or modified or extended versions
- thereof on a not-for-profit basis is explicitly granted, under the above
- conditions. However, the right to use this software in conjunction with
- for profit activities, and the right to distribute the software or modified or
- extended versions thereof for profit are *NOT* granted except by prior
- arrangement and written consent of the copyright holders.
- Use of this source code constitutes an agreement not to criticize, in any
- way, the code-writing style of the author, including any statements regarding
- the extent of documentation and comments present.
- The software is provided "AS-IS" and without warranty of ank kind, express,
- implied or otherwise, including without limitation, any warranty of
- merchantability or fitness for a particular purpose.
- In no event shall Stanford University or the authors be liable for any special,
- incudental, indirect or consequential damages of any kind, or any damages
- whatsoever resulting from loss of use, data or profits, whether or not
- advised of the possibility of damage, and on any theory of liability,
- arising out of or in connection with the use or performance of this software.
- This code was written using Borland C++ Builder 4 (Inprise Inc., www.inprise.com)
- and may be subject to certain additional restrictions as a result.
- */
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <dir.h>
- #pragma hdrstop
- #include "SaveNodeForm.h"
- #include "TreeViewMain.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TSaveNodeDataForm *SaveNodeDataForm;
- //---------------------------------------------------------------------------
- __fastcall TSaveNodeDataForm::TSaveNodeDataForm(TComponent* Owner)
- : TForm(Owner)
- {
- MinCorr = 0.5;
- MaxCorr = 0.8;
- MinElements = 1;
- }
- //---------------------------------------------------------------------------
- void __fastcall TSaveNodeDataForm::Button1Click(TObject *Sender)
- {
- if ((TreeViewMainForm->Cluster->BestNode != NULL) &&
- (UseSelectedNodeCheckBox->Checked == true) )
- {
- char FileRoot[100];
- fnsplit(TreeViewMainForm->OpenDialog1->FileName.c_str(),NULL,NULL,FileRoot,NULL);
- SaveDialog1->FileName = AnsiString(FileRoot) + "_" + TreeViewMainForm->Cluster->BestNode->Data->ID
- + "_Nodes.txt";
- }
- if (SaveDialog1->Execute())
- {
- TreeViewMainForm->SaveNodeData(SaveDialog1->FileName);
- }
- ModalResult = 1;
- }
- //---------------------------------------------------------------------------
- void __fastcall TSaveNodeDataForm::MinCorrEditExit(TObject *Sender)
- {
- try
- {
- MinCorr = MinCorrEdit->Text.ToDouble();
- }
- catch (EConvertError &E)
- {
- MinCorr = 0.5;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TSaveNodeDataForm::MaxCorrEditExit(TObject *Sender)
- {
- try
- {
- MaxCorr = MaxCorrEdit->Text.ToDouble();
- }
- catch (EConvertError &E)
- {
- MaxCorr = 0.8;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TSaveNodeDataForm::MinElementsEditExit(TObject *Sender)
- {
- try
- {
- MinElements = MinElementsEdit->Text.ToInt();
- }
- catch (EConvertError &E)
- {
- MinElements = 1;
- }
- }
- //---------------------------------------------------------------------------