NCBI C++ ToolKit
sequence_viewer_window.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: sequence_viewer_window.hpp 100477 2023-08-04 16:22:30Z lanczyck $
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: Paul Thiessen
27 *
28 * File Description:
29 * implementation of GUI part of main sequence/alignment viewer
30 *
31 * ===========================================================================
32 */
33 
34 #ifndef CN3D_SEQUENCE_VIEWER_WINDOW__HPP
35 #define CN3D_SEQUENCE_VIEWER_WINDOW__HPP
36 
37 #include "viewer_window_base.hpp"
38 
39 
40 BEGIN_SCOPE(Cn3D)
41 
42 class SequenceViewer;
43 class SequenceDisplay;
44 class TaxonomyTree;
45 
47 {
48  friend class SequenceDisplay;
49 
50 public:
51  SequenceViewerWindow(SequenceViewer *parentSequenceViewer);
53 
54  bool RequestEditorEnable(bool enable);
55  void EnableDerivedEditorMenuItems(bool enabled);
56  void TurnOnEditor(void);
57  void SetWindowTitle(void);
58 
59 private:
62 
63  // menu identifiers - additional items beyond base class items
64  enum {
65  // view menu
82  // edit menu
84  MID_SORT_ROWS, // sort rows submenu
93  // mouse mode
95  // update menu
102  };
103 
104  void OnShowHideRows(wxCommandEvent& event);
105  void OnDeleteRow(wxCommandEvent& event);
106  void OnMoveRow(wxCommandEvent& event);
107  void OnShowUpdates(wxCommandEvent& event);
108  void OnRealign(wxCommandEvent& event);
109  void OnSort(wxCommandEvent& event);
110  void OnScoreThreader(wxCommandEvent& event);
111  void OnMarkBlock(wxCommandEvent& event);
112  void OnExport(wxCommandEvent& event);
113  void OnSelfHit(wxCommandEvent& event);
114  void OnTaxonomy(wxCommandEvent& event);
115  void OnHighlight(wxCommandEvent& event);
116 
117  // called before an operation (e.g., alignment editor enable) that requires
118  // all rows of an alignment to be visible; 'false' return should abort that operation
119  bool QueryShowAllRows(void);
120 
121  void OnCloseWindow(wxCloseEvent& event);
122 
123  wxMenu *updateMenu;
124 
126  {
127  menuBar->Check(MID_RESTRICT_HIGHLIGHTS, false);
128  SetCursor(wxNullCursor);
129  }
130  void DeleteRowOff(void)
131  {
132  menuBar->Check(MID_DELETE_ROW, false);
133  SetCursor(wxNullCursor);
134  }
135  void RealignRowOff(void)
136  {
137  menuBar->Check(MID_REALIGN_ROW, false);
138  SetCursor(wxNullCursor);
139  }
140  void MarkBlockOff(void)
141  {
142  menuBar->Check(MID_MARK_BLOCK, false);
143  SetCursor(wxNullCursor);
144  }
145  void ProximitySortOff(void)
146  {
147  menuBar->Check(MID_PROXIMITY_SORT, false);
148  SetCursor(wxNullCursor);
149  }
150  void SortLoopsOff(void)
151  {
152  menuBar->Check(MID_SORT_LOOPS, false);
153  SetCursor(wxNullCursor);
154  }
155 
157  {
159  }
160 
161  DECLARE_EVENT_TABLE()
162 
163 public:
164 
165  bool SaveDialog(bool prompt, bool canCancel);
166 
167  bool DoRestrictHighlights(void) const { return menuBar->IsChecked(MID_RESTRICT_HIGHLIGHTS); }
168  bool DoDeleteRow(void) const { return menuBar->IsChecked(MID_DELETE_ROW); }
169  bool DoRealignRow(void) const { return menuBar->IsChecked(MID_REALIGN_ROW); }
170  bool DoMarkBlock(void) const { return menuBar->IsChecked(MID_MARK_BLOCK); }
171  bool DoProximitySort(void) const { return menuBar->IsChecked(MID_PROXIMITY_SORT); }
172  bool DoSortLoops(void) const { return menuBar->IsChecked(MID_SORT_LOOPS); }
173 
175  {
177  if (id != MID_DELETE_ROW && DoDeleteRow()) DeleteRowOff();
178  if (id != MID_REALIGN_ROW && DoRealignRow()) RealignRowOff();
179  if (id != MID_MARK_BLOCK && DoMarkBlock()) MarkBlockOff();
181  if (id != MID_SORT_LOOPS && DoSortLoops()) SortLoopsOff();
182  }
183 };
184 
185 END_SCOPE(Cn3D)
186 
187 #endif // CN3D_SEQUENCE_VIEWER_WINDOW__HPP
void OnShowHideRows(wxCommandEvent &event)
void OnMoveRow(wxCommandEvent &event)
void OnSort(wxCommandEvent &event)
SequenceViewerWindow(SequenceViewer *parentSequenceViewer)
bool SaveDialog(bool prompt, bool canCancel)
void EnableDerivedEditorMenuItems(bool enabled)
void OnExport(wxCommandEvent &event)
void OnSelfHit(wxCommandEvent &event)
SequenceViewerWidget::eMouseMode GetMouseModeForCreateAndMerge(void)
void OnDeleteRow(wxCommandEvent &event)
void OnCloseWindow(wxCloseEvent &event)
void OnHighlight(wxCommandEvent &event)
void OnMarkBlock(wxCommandEvent &event)
void OnScoreThreader(wxCommandEvent &event)
void OnTaxonomy(wxCommandEvent &event)
bool DoRestrictHighlights(void) const
void OnShowUpdates(wxCommandEvent &event)
bool RequestEditorEnable(bool enable)
void OnRealign(wxCommandEvent &event)
void CancelDerivedSpecialModesExcept(int id)
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
Modified on Wed Apr 17 13:08:50 2024 by modify_doxy.py rev. 669887