view_graphic.cpp

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

CPP
606
字号
    // Handle a visible range change    if (m_SeqWidget->VisibleRangeChanged()) {        TSeqRange range = m_SeqWidget->GetVisibleRange();        // Set  seq loc with the range         CRef<CSeq_loc> loc(new CSeq_loc);        loc->SetInt().SetFrom(range.GetFrom());        loc->SetInt().SetTo  (range.GetTo());		loc->SetId(*m_SeqId);        SetVisibleRange(*loc);        // Post a message the the visible range changed        PostVisibleRangeChanged(GetVisibleRange());        // Reset the panel's VisibleRangeChanged flag        m_SeqWidget->ResetVisibleRangeChanged();        update_menus = true;    }         if (update_menus) {        x_UpdateDynMenus();        PostSelectionChanged(GetSelBuffer());    }}void CViewGraphic:: x_OnZoomToSequence(){    m_SeqWidget->SetZoomX( 1.0f );}void CViewGraphic:: x_OnFitToWindow(){    m_SeqWidget->SetZoomX( 0.0f );}void CViewGraphic::x_SetConfig(CRef<CSeqGraphicConfig> config){    m_ConfigSettings = config;    m_SeqWidget->SetConfig(m_ConfigSettings);}void CViewGraphic::x_OnPreferences(){    // create panel    //CFeatConfigPanel  preference_panel;    CThemeConfigPanel   preference_panel;    // CThemeConfigPanel2   preference_panel;    // preference_panel.SetLayoutDirection(CThemeConfigPanel2::eLayoutDirection_Vertical);          // create configuration mediator from data set and panel    // CFeatConfigMediator preference_mediator(*m_ConfigSettings, preference_panel);    CThemeMediator preference_mediator(*m_ConfigSettings, preference_panel);    // create and display dialog given the mediator.    // CConfigDlg preference_dialog(preference_mediator);    CThemeDlg  preference_dialog(preference_mediator);    EDialogReturnValue dlg_ret = preference_dialog.ShowModal();    if (eCancel == dlg_ret) {        return;    }    // when dialog is done, save values to persistent storage (plugin config cache file).    CDocManager::GetSettings().SavePluginConfig();        // redraw and change settings to show the changes in the preferences.    m_SeqWidget->UpdateConfig();}END_NCBI_SCOPE/* * =========================================================================== * $Log: view_graphic.cpp,v $ * Revision 1000.7  2004/06/01 20:59:43  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.64 * * Revision 1.64  2004/05/21 22:27:49  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.63  2004/04/16 14:45:01  dicuccio * Code clean-up.  Use TConstObjects for passing / retrieving selections.  Use seq * graphic widget for marshalling selections * * Revision 1.62  2004/04/07 13:05:10  dicuccio * Changed view API - require CPluginMessage instead of CPluginArgSet * * Revision 1.61  2004/03/12 16:01:39  lebedev * Command map added. Ability to move between selected feature exon added. * * Revision 1.60  2004/03/11 17:46:58  dicuccio * Use TSeqRange instead of TRange * * Revision 1.59  2004/02/17 20:35:28  rsmith * moved core/settings.[ch]pp and core/system_path.[ch]pp to config and utils, respectively. * * Revision 1.58  2004/02/02 18:48:00  rsmith * commented out alternate preference panel * * Revision 1.57  2004/01/27 16:16:26  lebedev * Interfaces for view to view communication implemented * * Revision 1.56  2004/01/20 20:36:36  rsmith * Call the widget's UpdateConfig, not just redraw, after changing the configuration object. * * Revision 1.55  2004/01/20 14:11:19  rsmith * configuration done with a Theme dialog. * * Revision 1.54  2003/12/30 15:03:21  dicuccio * Fixed for change in file locations * * Revision 1.53  2003/12/29 20:18:05  rsmith * (correction to previous commit log) Move config settings initialization higher in the constructor since other members cstrs depend on it. * * Revision 1.52  2003/12/29 20:09:39  rsmith * add feat_config_list include (NOT: See next log.) * * Revision 1.51  2003/12/22 19:31:36  dicuccio * Lots of changes.  Added better handling of messages received from other views. * Initial attempt at passing in selections (not entirely working) * * Revision 1.50  2003/12/22 13:02:18  lebedev * Plugin updated to use new datasource * * Revision 1.49  2003/11/27 20:22:05  ucko * Don't try to introduce const in static_cast<>. * * Revision 1.48  2003/11/26 19:48:40  friedman * Added handling rceiving visible range change * * Revision 1.47  2003/11/24 15:45:44  dicuccio * Renamed CVersion to CPluginVersion * * Revision 1.46  2003/11/19 20:43:59  friedman * Added detecting visible range change and posting a message * * Revision 1.45  2003/11/18 20:44:32  rsmith * Add configuration object and preference dialog. * * Revision 1.44  2003/11/04 17:49:25  dicuccio * Changed calling parameters for plugins - pass CPluginMessage instead of paired * CPluginCommand/CPluginReply * * Revision 1.43  2003/11/04 12:51:28  friedman * Added event message pool callbacks for the document all-view message pool. * * Revision 1.42  2003/10/27 20:03:42  dicuccio * Rearranged Update() to be consistent * * Revision 1.41  2003/10/27 16:15:17  dicuccio * Implemented initial zoom state * * Revision 1.40  2003/10/16 15:51:24  dicuccio * Set the title to something meaningful - include the sequence title and * accession.  Only update dynamic menus if selections or document have changed. * Properly set dynamic menus to include information for the viewed seq-id, not * the document's seq-id. * * Revision 1.39  2003/10/15 13:42:31  dicuccio * Cleaned up the title - now reflects the actual sequence being viewed * * Revision 1.38  2003/10/07 13:47:06  dicuccio * Renamed CPluginURL* to CPluginValue* * * Revision 1.37  2003/09/30 19:53:53  dicuccio * Disable popup menu (again!) pending crash fix * * Revision 1.36  2003/09/30 15:18:45  dicuccio * Re-enabled popup menu * * Revision 1.35  2003/09/24 18:27:35  dicuccio * Uncommented recreation of data source on document change * * Revision 1.34  2003/09/04 14:54:22  dicuccio * Use IDocument instead of CDocument.  Changed APIs to match changes in IView * * Revision 1.33  2003/08/18 16:19:32  lebedev * Change viewer to use new methods for showing/hiding features * * Revision 1.32  2003/07/23 19:13:13  dicuccio * Added menu options for f\configuring the view * * Revision 1.31  2003/07/21 19:33:47  dicuccio * Added handling of selections in GUI - use menus * * Revision 1.30  2003/06/25 17:03:00  dicuccio * Split CPluginHandle into a handle (pointer-to-implementation) and * implementation file.  Lots of #include file clean-ups. * * Revision 1.29  2003/06/20 19:51:27  dicuccio * Fixed compiler error on MSVC related to operator&& * * Revision 1.28  2003/06/20 14:53:52  dicuccio * Revised plugin registration - moved GetInfo() into the plugin handler * * Revision 1.27  2003/05/19 13:44:42  dicuccio * Moved gui/core/plugin/ --> gui/plugin.  Merged core libraries into * libgui_core.so.  Revamped graphical view to use Vlad Lebedev's new widget. * * Revision 1.26  2003/04/30 13:21:19  dicuccio * Added callback for expanded view.  Make sure that the visible range gets * propagated correctly * * Revision 1.25  2003/04/29 14:54:44  dicuccio * Reworked FLUID-generated code: better memory management, more explicit * control over the constructor * * Revision 1.24  2003/04/24 16:41:55  dicuccio * Updated to reflect changes in plugin, IDocument API * * Revision 1.23  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.22  2003/03/03 14:55:18  dicuccio * Remiplemented using visible range in base class * * Revision 1.21  2003/02/20 19:49:59  dicuccio * Created new plugin architecture, based on ASN.1 spec.  Moved GBENCH frameowrk * over to use new plugin architecture. * * Revision 1.20  2003/01/16 14:55:22  dicuccio * Added CFeaturePanel::Clear().  Fixed issue with some panels not being * properly cleared on update. * * Revision 1.19  2003/01/15 21:10:40  dicuccio * Large updates.  Added support for rendering all feature types.  Separated * features into distinct panels based on types.  Added ability to specify * linking / packing as menu options. * * Revision 1.18  2003/01/13 13:10:08  dicuccio * Namespace clean-up.  Retired namespace gui -> converted all to namespace * ncbi.  Moved all FLUID-generated code into namespace ncbi. * * Revision 1.17  2003/01/09 14:50:41  dicuccio * Use 'const CBioseq_Handle&' instead of 'CBioseq_Handle&' * * Revision 1.16  2002/12/20 19:52:22  dicuccio * Cnaged TRange::SetFrom()/TRange::SetTo() --> TRange::Set() * * Revision 1.15  2002/12/20 19:22:52  dicuccio * Lots of changes to the menus.  Standardized the menu syntax across all views. * Changed to use new dynamic menu managers. * * Revision 1.14  2002/12/19 18:18:20  dicuccio * Fixed thinko: don't clear the selection buffer unless the underlying document * changes. * * Revision 1.13  2002/12/13 13:18:52  dicuccio * Added work-around for inlining problems in some versions of gcc: directly * include a FLUID-generated '*_.cpp' file in the corresponding '*.cpp' and * remove this file from the build.  Thanks Aaron! * * Revision 1.12  2002/12/12 15:23:49  dicuccio * Changed SetSelBuffer() -> non-const GetSelBuffer(). * * Revision 1.11  2002/12/09 20:37:14  dicuccio * Switch to using CSeq_id::GetStringDescr() * * Revision 1.10  2002/12/09 15:41:30  dicuccio * When changing the selection past the end of the controlled sequence, must * preserve the size of the selection (no shrinking) * * Revision 1.9  2002/11/29 16:09:37  dicuccio * Use USING_SCOPE instead of BEGIN/END_SCOPE for out-of-scope classes.  Fixed * function overload resolution issues in Windows. * * Revision 1.8  2002/11/29 15:35:30  dicuccio * Modified to use gui/utils.  Moved utils.[h,c]pp into gui/utils.  Split * utils.[h,c]pp into four files - feature.[h,c]pp and utils.[h,c]pp. * * Revision 1.7  2002/11/27 17:38:06  lebedev * Switched to Sequence Icon View Widget * * Revision 1.6  2002/11/26 17:15:25  lebedev * Switched to SeqInfo widget in graphics viewer * * Revision 1.5  2002/11/22 18:05:34  dicuccio * Fixed memory leak - must remember to delete main window. * * Revision 1.4  2002/11/19 17:11:13  dicuccio * Standardized creation of title. * * Revision 1.3  2002/11/09 20:57:08  dicuccio * Performance improvements:  Implemented smarter widget update (use update * flags to specify update conditions); use a more intuitive (and flexible) * mechanism to obtain features from the object manager. * * Revision 1.2  2002/11/08 02:14:42  dicuccio * Minor code clean-ups (reformat text, eliminate dead variables, favor NCBI * macros) * * Revision 1.1  2002/11/07 16:27:27  dicuccio * Initial revision * * =========================================================================== */

⌨️ 快捷键说明

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