NCBI C++ ToolKit
fasta_context.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: fasta_context.cpp 39785 2017-11-03 16:40:10Z katargir $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Roman Katargin
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
36 
37 #include "fasta_context.hpp"
38 #include "text_commands.hpp"
39 
40 #include <wx/menu.h>
41 
44 
45 BEGIN_EVENT_TABLE(CFastaViewContext, CTextPanelContext)
48 
50  : CTextPanelContext(leftMargin, scope, so)
51 {
52 }
53 
55 {
56 }
57 
58 static
59 WX_DEFINE_MENU(kFastaContextMenu)
60  WX_MENU_SEPARATOR_L("Edit Selection")
63 
64 wxMenu* CFastaViewContext::CreateMenu() const
65 {
67  wxMenu* menu = cmd_reg.CreateMenu(kFastaContextMenu);
68  return menu;
69 }
70 
71 void CFastaViewContext::OnExpandAll(wxCommandEvent& event)
72 {
73  CCompositeTextItem* root = dynamic_cast<CCompositeTextItem*>(m_Panel->GetRootItem());
74  if (!root) return;
75 
76  CExpandTraverser expander(*this, true);
77  root->Traverse(expander);
78  root->UpdatePositions();
79  m_Panel->Layout();
80  m_Panel->Refresh();
81 
83 }
84 
virtual void UpdatePositions()
virtual bool Traverse(ICompositeTraverser &traverser)
void OnExpandAll(wxCommandEvent &event)
CScope –.
Definition: scope.hpp:92
Base class for all serializable objects.
Definition: serialbase.hpp:150
ITextItem * GetRootItem()
virtual bool Layout()
CTextItemPanel * m_Panel
CUICommandRegistry is a centralized registry where all application commands should be registered.
Definition: ui_command.hpp:146
static CUICommandRegistry & GetInstance()
the main instance associated with the application
Definition: ui_command.cpp:176
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
Definition: ui_command.cpp:349
USING_SCOPE(objects)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
END_EVENT_TABLE()
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
@ kExpandAll
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
Definition: ui_command.hpp:266
#define WX_END_MENU()
Definition: ui_command.hpp:294
#define WX_MENU_SEPARATOR_L(label)
Definition: ui_command.hpp:285
#define WX_MENU_ITEM(cmd)
Definition: ui_command.hpp:270
wxMenu * CreateMenu(const CMenuItem *item)
Creates a wxMenu object replicating the structure of CMenuItem.
Definition: wx_utils.cpp:365
#define const
Definition: zconf.h:232
Modified on Mon May 20 04:59:22 2024 by modify_doxy.py rev. 669887