📄 cdd_splash_dialog.cpp
字号:
/* * =========================================================================== * PRODUCTION $Log: cdd_splash_dialog.cpp,v $ * PRODUCTION Revision 1000.2 2004/06/01 18:28:01 gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.12 * PRODUCTION * =========================================================================== *//* $Id: cdd_splash_dialog.cpp,v 1000.2 2004/06/01 18:28:01 gouriano Exp $* ===========================================================================** PUBLIC DOMAIN NOTICE* National Center for Biotechnology Information** This software/database is a "United States Government Work" under the* terms of the United States Copyright Act. It was written as part of* the author's official duties as a United States Government employee and* thus cannot be copyrighted. This software/database is freely available* to the public for use. The National Library of Medicine and the U.S.* Government have not placed any restriction on its use or reproduction.** Although all reasonable efforts have been taken to ensure the accuracy* and reliability of the software and data, the NLM and the U.S.* Government do not and cannot warrant the performance or results that* may be obtained by using this software or data. The NLM and the U.S.* Government disclaim all warranties, express or implied, including* warranties of performance, merchantability or fitness for any particular* purpose.** Please cite the author in any work or product based on this material.** ===========================================================================** Authors: Paul Thiessen** File Description:* dialog for CDD splash screen** ===========================================================================*/#ifdef _MSC_VER#pragma warning(disable:4018) // disable signed/unsigned mismatch warning in MSVC#endif#include <ncbi_pch.hpp>#include <corelib/ncbistd.hpp>#include <objects/cdd/Cdd_descr_set.hpp>#include <objects/cdd/Cdd_descr.hpp>#include <objects/cdd/Align_annot_set.hpp>#include <objects/pub/Pub.hpp>#include <objects/cdd/Align_annot.hpp>#include <objects/cdd/Feature_evidence.hpp>#include <objects/biblio/PubMedId.hpp>#include <objects/mmdb1/Biostruc_id.hpp>#include <objects/mmdb1/Mmdb_id.hpp>#include <objects/mmdb3/Biostruc_feature_set.hpp>#include <objects/mmdb3/Biostruc_feature_set_descr.hpp>#include <objects/mmdb3/Biostruc_feature.hpp>#include "cdd_splash_dialog.hpp"#include "structure_window.hpp"#include "structure_set.hpp"#include "cn3d_tools.hpp"#include "chemical_graph.hpp"#include "molecule_identifier.hpp"#include "sequence_set.hpp"////////////////////////////////////////////////////////////////////////////////////////////////// The following is taken unmodified from wxDesigner's C++ header from cdd_splash_dialog.wdr////////////////////////////////////////////////////////////////////////////////////////////////#include <wx/image.h>#include <wx/statline.h>#include <wx/spinbutt.h>#include <wx/spinctrl.h>#include <wx/splitter.h>#include <wx/listctrl.h>#include <wx/treectrl.h>#include <wx/notebook.h>#include <wx/grid.h>// Declare window functions#define ID_TEXT 10000#define ID_ST_NAME 10001#define ID_T_DESCR 10002#define ID_B_ANNOT 10003#define ID_B_REF 10004#define ID_B_DONE 10005wxSizer *SetupCDDSplashDialog( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );////////////////////////////////////////////////////////////////////////////////////////////////USING_NCBI_SCOPE;USING_SCOPE(objects);BEGIN_SCOPE(Cn3D)#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type) \ type *var; \ var = wxDynamicCast(FindWindow(id), type); \ if (!var) { \ ERRORMSG("Can't find window with id " << id); \ return; \ }BEGIN_EVENT_TABLE(CDDSplashDialog, wxDialog) EVT_CLOSE ( CDDSplashDialog::OnCloseWindow) EVT_BUTTON (-1, CDDSplashDialog::OnButton)END_EVENT_TABLE()CDDSplashDialog::CDDSplashDialog(StructureWindow *cn3dFrame, StructureSet *structureSet, CDDSplashDialog **parentHandle, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos) : wxDialog(parent, id, title, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE), sSet(structureSet), structureWindow(cn3dFrame), handle(parentHandle){ if (!structureSet) { Destroy(); return; } // construct the panel wxPanel *panel = new wxPanel(this, -1); wxSizer *topSizer = SetupCDDSplashDialog(panel, false); // fill in info DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(tName, ID_ST_NAME, wxStaticText) DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(tDescr, ID_T_DESCR, wxTextCtrl) DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(bAnnot, ID_B_ANNOT, wxButton) DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(bRef, ID_B_REF, wxButton) const string& cddName = structureSet->GetCDDName(); if (cddName.size() > 0) tName->SetLabel(cddName.c_str()); const string& cddDescr = structureSet->GetCDDDescription(); if (cddDescr.size() > 0) { int i, j; for (i=j=0; i<cddDescr.size(); ++i, ++j) { if (j > 60 && cddDescr[i] == ' ') { *tDescr << '\n'; j = 0; } else *tDescr << cddDescr[i]; } *tDescr << "\n\n"; } // summarize annotations const CAlign_annot_set *annots = structureSet->GetCDDAnnotSet(); if (annots && annots->Get().size() > 0) { *tDescr << "Annotation summary:\n\n"; CAlign_annot_set::Tdata::const_iterator a, ae = annots->Get().end(); for (a=annots->Get().begin(); a!=ae; ++a) { *tDescr << ((*a)->IsSetDescription() ? (*a)->GetDescription() : string("")).c_str() << "; evidence:\n"; if ((*a)->IsSetEvidence()) { CAlign_annot::TEvidence::const_iterator e, ee = (*a)->GetEvidence().end(); for (e=(*a)->GetEvidence().begin(); e!=ee; ++e) { if ((*e)->IsComment()) *tDescr << " comment: " << (*e)->GetComment().c_str() << '\n'; else if ((*e)->IsReference() && (*e)->GetReference().IsPmid()) *tDescr << " PubMed " << (*e)->GetReference().GetPmid().Get() << '\n'; else if ((*e)->IsBsannot()) { *tDescr << " structure:"; if ((*e)->GetBsannot().GetFeatures().size() > 0 && (*e)->GetBsannot().GetFeatures().front()->IsSetDescr() && (*e)->GetBsannot().GetFeatures().front()->IsSetDescr() && (*e)->GetBsannot().GetFeatures().front()->GetDescr().front()->IsName()) *tDescr << ' ' << (*e)->GetBsannot().GetFeatures().front()->GetDescr().front()->GetName().c_str(); if ((*e)->GetBsannot().IsSetId() && (*e)->GetBsannot().GetId().front()->IsMmdb_id()) { int mmdbID = (*e)->GetBsannot().GetId().front()->GetMmdb_id().Get(); StructureSet::ObjectList::const_iterator o, oe = structureSet->objects.end(); for (o=structureSet->objects.begin(); o!=oe; ++o) { if ((*o)->mmdbID == mmdbID) { *tDescr << " (" << (*o)->pdbID.c_str() << ')'; break; } } } *tDescr << '\n'; } } } *tDescr << '\n'; } } // summarize structures if (structureSet->objects.size() > 0) { *tDescr << "Structure summary:\n"; StructureSet::ObjectList::const_iterator o, oe = structureSet->objects.end(); for (o=structureSet->objects.begin(); o!=oe; ++o) { *tDescr << "\nPDB " << (*o)->pdbID.c_str() << " (MMDB " << (*o)->mmdbID << ")\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -