view_feattable.cpp

来自「ncbi源码」· C++ 代码 · 共 537 行 · 第 1/2 页

CPP
537
字号
const string& CViewFeatTable::GetTitle() const{    static string s_str("Feature Table View");    return s_str;}void CViewFeatTable::x_OnHelp(){}void CViewFeatTable::x_OnFilter(){    if ( !m_FilterDlg.get() ) {        m_FilterDlg.reset(new CFilterDlg());        m_FilterDlg->SetFilters(&m_FeatTable->GetFilters());    }    m_FilterDlg->Show();    x_Update();}void CViewFeatTable::x_OnSelChanged(){    SetSelBuffer().Clear();    for (size_t i = 0;  i < m_FeatTable->GetRows();  ++i) {        if ( !m_FeatTable->row_selected(i) ) {            continue;        }        CMappedFeat feat = m_FeatTable->GetData(i);        SetSelBuffer().AddSelection(GetDocument(), feat.GetOriginalFeature());    }    // update our dynamic menus    x_UpdateDynMenus();    //...and notify our connected views    PostSelectionChanged(GetSelBuffer());}void CViewFeatTable::x_OnVisibleRangeChange(){    // Get the max value for the "to" field    CBioseq_Handle handle = GetDocument()->GetScope().GetBioseqHandle(*m_SeqId);    TSeqPos seq_size = handle.GetSeqVector().size();    // set the dialog with the current seting    const CSeq_loc& loc = GetVisibleRange();    TSeqRange range(loc.GetTotalRange());        CFeatTable::EVisibleRangeMethod method;    method = m_FeatTable->GetVisibleRangeMethod();    auto_ptr<CVisibleRangeDialog> dlg;    if (method == CFeatTable::eScrollTo) {        dlg.reset(new CVisibleRangeDialog(range.GetFrom(), seq_size));    } else {        dlg.reset(new CVisibleRangeDialog(seq_size));        if (!range.IsWhole() && !range.Empty()) {            dlg->SetRange(range);        }    }    if (dlg->ShowModal()) {        if (method == CFeatTable::eScrollTo) {            range.SetFrom(dlg->GetScrollTo());            range.SetTo(seq_size);        } else {            range = dlg->GetRange();        }        x_SetVisibleRange(range);        m_FeatTable->Update            (GetDocument()->GetScope().GetBioseqHandle(*m_SeqId));        // Post a message the the visible range changed        PostVisibleRangeChanged(GetVisibleRange());    }}void CViewFeatTable::x_OnPreferences(){    CFeatTablePreferenceDialog dlg;    CFeatTable::EVisibleRangeMethod method;    // set dialog with current setting - Default is Scrool To    method = m_FeatTable->GetVisibleRangeMethod();    if (method == CFeatTable::eEntirelyContained) {        dlg.SetEntirelyContained();    } else if (method == CFeatTable::eIntersection) {        dlg.SetIntersection();    } else {        dlg.SetScrollTo();    }    if (dlg.ShowModal()) {        // visible range method        if (dlg.EntirelyContainedMethod()) {            method = CFeatTable::eEntirelyContained;        } else if (dlg.ScrollToMethod()) {            method = CFeatTable::eScrollTo;        } else if (dlg.IntersectionMethod()) {            method = CFeatTable::eIntersection;        }        m_FeatTable->SetVisibleRangeMethod(method);        CBioseq_Handle handle =             m_Document->GetScope().GetBioseqHandle(*m_SeqId);        m_FeatTable->Update(handle);        }}END_NCBI_SCOPE/* * =========================================================================== * $Log: view_feattable.cpp,v $ * Revision 1000.7  2004/06/01 21:01:26  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.37 * * Revision 1.37  2004/05/21 22:27:49  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.36  2004/04/16 14:47:27  dicuccio * Enabled alignment table view.  Use appropriate ISelection interface for dynamic menus * * Revision 1.35  2004/04/07 13:04:24  dicuccio * Changed view API - use CPluginMessage instead of CPluginArgSet.  Use * TConstScopedObjects instead of CSelectionBuffer::TSelItems. * * Revision 1.34  2004/03/11 17:47:22  dicuccio * Use TSeqRange instead of TRange * * Revision 1.33  2004/01/27 18:45:35  dicuccio * Added missing header files * * Revision 1.32  2004/01/20 18:17:53  dicuccio * Changed to match new API in CTablePanel * * Revision 1.31  2004/01/07 18:51:46  dicuccio * Guard against self-assignment in OnSelectionsChanged() * * Revision 1.30  2003/12/30 15:03:56  dicuccio * Added ability to pass selections into feature table * * Revision 1.29  2003/12/24 17:23:49  friedman * Changed x_UpdateDynMenus to pass in visible range seqloc instead of seqid. * * Revision 1.28  2003/12/24 16:33:18  friedman * Added posting visible range change message. * * Revision 1.27  2003/12/22 19:32:24  dicuccio * Lots of code clean-up.  Changed to match new APIs in IView.  Added first pass * at processing selections (not entirely working) * * Revision 1.26  2003/12/22 18:15:08  friedman * Added various visible range methods and the selection of a method * through the preference menu selection and dialog. * * Revision 1.25  2003/12/03 22:24:12  friedman * Added changing visible range of the table. * * Revision 1.24  2003/11/26 19:45:39  friedman * Changed CSeq_id plugn arg to CSeq_loc. Set visible range based on seq loc passed in. * * Revision 1.23  2003/11/24 15:45:45  dicuccio * Renamed CVersion to CPluginVersion * * Revision 1.22  2003/11/20 21:50:39  jcherry * Set status message *after* updating feature table (fixes reporting of * number of features) * * Revision 1.21  2003/11/20 16:54:33  ucko * OnVisibleRangeChanged: don't try to introduce const in static_cast<>. * * Revision 1.20  2003/11/19 20:45:28  friedman * Added handling a visible range change event * * Revision 1.19  2003/11/04 12:51:28  friedman * Added event message pool callbacks for the document all-view message pool. * * Revision 1.18  2003/10/27 20:03:42  dicuccio * Rearranged Update() to be consistent * * Revision 1.17  2003/10/07 13:47:07  dicuccio * Renamed CPluginURL* to CPluginValue* * * Revision 1.16  2003/09/04 14:54:23  dicuccio * Use IDocument instead of CDocument.  Changed APIs to match changes in IView * * Revision 1.15  2003/07/31 17:04:34  dicuccio * Changed type stored by feature table view - use CMappedFeat instead of CFeature * (less memory consumption) * * Revision 1.14  2003/07/22 15:32:17  dicuccio * Changed to make use of new API in plugin_utils.hpp - GetArgValue() * * Revision 1.13  2003/06/26 15:33:41  dicuccio * Moved GetURLValue() from PluginURL.hpp to plugin_utils.hpp.  Fixed compilation * errors relating to missing #includes * * Revision 1.12  2003/06/25 17:03:01  dicuccio * Split CPluginHandle into a handle (pointer-to-implementation) and * implementation file.  Lots of #include file clean-ups. * * Revision 1.11  2003/06/20 14:53:53  dicuccio * Revised plugin registration - moved GetInfo() into the plugin handler * * Revision 1.10  2003/06/02 16:06:24  dicuccio * Rearranged src/objects/ subtree.  This includes the following shifts: *     - src/objects/asn2asn --> arc/app/asn2asn *     - src/objects/testmedline --> src/objects/ncbimime/test *     - src/objects/objmgr --> src/objmgr *     - src/objects/util --> src/objmgr/util *     - src/objects/alnmgr --> src/objtools/alnmgr *     - src/objects/flat --> src/objtools/flat *     - src/objects/validator --> src/objtools/validator *     - src/objects/cddalignview --> src/objtools/cddalignview * In addition, libseq now includes six of the objects/seq... libs, and libmmdb * replaces the three libmmdb? libs. * * Revision 1.9  2003/05/19 13:46:51  dicuccio * Moved gui/core/plugin/ --> gui/plugin/.  Merged core libraries into * libgui_core.so * * Revision 1.8  2003/04/29 14:56:16  dicuccio * Reworked FLUID-generated code: better memory management, more explicit control * over the constructor * * Revision 1.7  2003/04/24 16:42:52  dicuccio * Updated to reflect changes in IDocument, plugin API * * Revision 1.6  2003/03/17 14:54:15  dicuccio * Changed base class CView - added member variable for FLTK gui component for * child windows, which is now maintained via an auto_ptr<>.  Eliminated * Show()/Hide() as a pure virtual requirement. * * Revision 1.5  2003/03/03 14:58:56  dicuccio * Changed to use visible range from the base class.  Added an explicit setter for * the visible range * * Revision 1.4  2003/01/13 13:10:09  dicuccio * Namespace clean-up.  Retired namespace gui -> converted all to namespace ncbi. * Moved all FLUID-generated code into namespace ncbi. * * Revision 1.3  2003/01/08 14:58:47  dicuccio * Major overhaul.  Added column selection dialog to base class - moved out of * this class.  Added ability to sort columns based on menu selections.  Added * ability to filter features based on a wide range of criteria. * * Revision 1.2  2002/12/31 16:16:27  dicuccio * Fixed odd compiler error in MSVC release builds - ambiguous '&&' operator * * Revision 1.1  2002/12/30 18:49:41  dicuccio * Initial revision * * =========================================================================== */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?