📄 viewer_window_base.cpp
字号:
case MID_CREATE_BLOCK: CancelAllSpecialModesExcept(MID_CREATE_BLOCK); if (DoCreateBlock()) { SetCursor(*wxCROSS_CURSOR); prevMouseMode = viewerWidget->GetMouseMode(); viewerWidget->SetMouseMode(GetMouseModeForCreateAndMerge()); } else CreateBlockOff(); break; case MID_DELETE_BLOCK: CancelAllSpecialModesExcept(MID_DELETE_BLOCK); if (DoDeleteBlock()) SetCursor(*wxCROSS_CURSOR); else DeleteBlockOff(); break; case MID_SYNC_STRUCS: viewer->GetCurrentDisplay()->RedrawAlignedMolecules(); break; }}void ViewerWindowBase::OnMouseMode(wxCommandEvent& event){ const wxMenuItemList& items = mouseModeMenu->GetMenuItems(); for (int i=0; i<items.GetCount(); ++i) items.Item(i)->GetData()->Check( (items.Item(i)->GetData()->GetId() == event.GetId()) ? true : false); switch (event.GetId()) { case MID_SELECT_RECT: viewerWidget->SetMouseMode(SequenceViewerWidget::eSelectRectangle); break; case MID_SELECT_COLS: viewerWidget->SetMouseMode(SequenceViewerWidget::eSelectColumns); break; case MID_SELECT_ROWS: viewerWidget->SetMouseMode(SequenceViewerWidget::eSelectRows); break; case MID_DRAG_HORIZ: viewerWidget->SetMouseMode(SequenceViewerWidget::eDragHorizontal); break; }}void ViewerWindowBase::OnJustification(wxCommandEvent& event){ for (int i=MID_LEFT; i<=MID_SPLIT; ++i) menuBar->Check(i, (i == event.GetId()) ? true : false); switch (event.GetId()) { case MID_LEFT: currentJustification = BlockMultipleAlignment::eLeft; break; case MID_RIGHT: currentJustification = BlockMultipleAlignment::eRight; break; case MID_CENTER: currentJustification = BlockMultipleAlignment::eCenter; break; case MID_SPLIT: currentJustification = BlockMultipleAlignment::eSplit; break; } GlobalMessenger()->PostRedrawSequenceViewer(viewer);}void ViewerWindowBase::OnShowGeomVltns(wxCommandEvent& event){ const ViewerBase::AlignmentList& alignments = viewer->GetCurrentAlignments(); bool showGeometryViolations = menuBar->IsChecked(MID_SHOW_GEOM_VLTNS); ViewerBase::AlignmentList::const_iterator a, ae = alignments.end(); int nViolations = 0; for (a=alignments.begin(); a!=ae; ++a) nViolations += (*a)->ShowGeometryViolations(showGeometryViolations); if (showGeometryViolations) INFOMSG("Found " << nViolations << " geometry violation" << ((nViolations == 1) ? "" : "s") << " in this window"); GlobalMessenger()->PostRedrawSequenceViewer(viewer);}void ViewerWindowBase::OnFindPattern(wxCommandEvent& event){ // remember previous pattern static wxString previousPattern; // get pattern from user wxString pattern = wxGetTextFromUser("Enter a pattern using ProSite syntax:", "Input pattern", previousPattern, this); if (pattern.size() == 0) return; // add trailing period if not present (convenience for the user) if (pattern[pattern.size() - 1] != '.') pattern += '.'; previousPattern = pattern; GlobalMessenger()->RemoveAllHighlights(true); // highlight pattern from each (unique) sequence in the display map < const Sequence * , bool > usedSequences; const SequenceDisplay *display = viewer->GetCurrentDisplay(); for (int i=0; i<display->NRows(); ++i) { const Sequence *sequence = display->GetSequenceForRow(i); if (!sequence || usedSequences.find(sequence) != usedSequences.end()) continue; usedSequences[sequence] = true; if (!sequence->HighlightPattern(pattern.c_str())) break; }}void ViewerWindowBase::MakeSequenceVisible(const MoleculeIdentifier *identifier){ const SequenceDisplay *display = viewer->GetCurrentDisplay(); for (int i=0; i<display->NRows(); ++i) { const Sequence *sequence = display->GetSequenceForRow(i); if (sequence && sequence->identifier == identifier) { viewerWidget->MakeCharacterVisible(-1, i); break; } }}END_SCOPE(Cn3D)/** ---------------------------------------------------------------------------* $Log: viewer_window_base.cpp,v $* Revision 1000.3 2004/06/01 18:29:58 gouriano* PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.50** Revision 1.50 2004/05/21 21:41:40 gorelenk* Added PCH ncbi_pch.hpp** Revision 1.49 2004/03/15 18:38:52 thiessen* prefer prefix vs. postfix ++/-- operators** Revision 1.48 2004/02/19 17:05:22 thiessen* remove cn3d/ from include paths; add pragma to disable annoying msvc warning** Revision 1.47 2003/11/06 18:52:32 thiessen* make geometry violations shown on/off; allow multiple pmid entry in ref dialog** Revision 1.46 2003/07/17 16:52:34 thiessen* add FileSaved message with edit typing** Revision 1.45 2003/02/03 19:20:09 thiessen* format changes: move CVS Log to bottom of file, remove std:: from .cpp files, and use new diagnostic macros** Revision 1.44 2003/01/31 17:18:59 thiessen* many small additions and changes...** Revision 1.43 2003/01/23 20:03:05 thiessen* add BLAST Neighbor algorithm** Revision 1.42 2002/12/19 14:15:37 thiessen* mac fixes to menus, add icon** Revision 1.41 2002/11/22 19:54:29 thiessen* fixes for wxMac/OSX** Revision 1.40 2002/10/18 17:31:10 thiessen* fix for gcc** Revision 1.39 2002/10/18 17:15:33 thiessen* use wxNativeEncodingInfo to store fonts in registry** Revision 1.38 2002/10/15 22:04:09 thiessen* fix geom vltns bug** Revision 1.37 2002/10/13 22:58:08 thiessen* add redo ability to editor** Revision 1.36 2002/10/07 13:29:32 thiessen* add double-click -> show row to taxonomy tree** Revision 1.35 2002/09/06 13:06:31 thiessen* fix menu accelerator conflicts** Revision 1.34 2002/08/15 22:13:18 thiessen* update for wx2.3.2+ only; add structure pick dialog; fix MultitextDialog bug** Revision 1.33 2002/06/13 14:54:07 thiessen* add sort by self-hit** Revision 1.32 2002/06/05 14:28:42 thiessen* reorganize handling of window titles** Revision 1.31 2002/05/26 21:59:16 thiessen* tweaks for new window styles** Revision 1.30 2002/05/17 19:10:27 thiessen* preliminary range restriction for BLAST/PSSM** Revision 1.29 2002/03/01 19:21:00 thiessen* add icon to all frames** Revision 1.28 2002/03/01 15:47:46 thiessen* try tool window style for sequence/log viewers** Revision 1.27 2002/02/21 12:26:30 thiessen* fix row delete bug ; remember threader options** Revision 1.26 2001/12/06 23:13:47 thiessen* finish import/align new sequences into single-structure data; many small tweaks** Revision 1.25 2001/11/27 16:26:10 thiessen* major update to data management system** Revision 1.24 2001/10/16 21:49:07 thiessen* restructure MultiTextDialog; allow virtual bonds for alpha-only PDB's** Revision 1.23 2001/08/16 19:21:02 thiessen* add face name info to fonts** Revision 1.22 2001/08/14 17:18:22 thiessen* add user font selection, store in registry** Revision 1.21 2001/07/27 13:52:47 thiessen* make sure domains are assigned in order of molecule id; tweak pattern dialog** Revision 1.20 2001/07/26 13:41:53 thiessen* add pattern memory, make period optional** Revision 1.19 2001/07/24 15:02:59 thiessen* use ProSite syntax for pattern searches** Revision 1.18 2001/07/23 20:24:23 thiessen* need redraw if no matches found** Revision 1.17 2001/07/23 20:09:23 thiessen* add regex pattern search** Revision 1.16 2001/05/31 14:32:33 thiessen* tweak font handling** Revision 1.15 2001/05/23 17:45:41 thiessen* change dialog implementation to wxDesigner; interface changes** Revision 1.14 2001/05/15 14:57:56 thiessen* add cn3d_tools; bring up log window when threading starts** Revision 1.13 2001/05/11 13:45:06 thiessen* set up data directory** Revision 1.12 2001/05/11 02:10:42 thiessen* add better merge fail indicators; tweaks to windowing/taskbar** Revision 1.11 2001/04/18 15:46:54 thiessen* show description, length, and PDB numbering in status line** Revision 1.10 2001/04/05 22:55:37 thiessen* change bg color handling ; show geometry violations** Revision 1.9 2001/03/30 14:43:41 thiessen* show threader scores in status line; misc UI tweaks** Revision 1.8 2001/03/30 03:07:35 thiessen* add threader score calculation & sorting** Revision 1.7 2001/03/19 15:50:40 thiessen* add sort rows by identifier** Revision 1.6 2001/03/13 01:25:07 thiessen* working undo system for >1 alignment (e.g., update window)** Revision 1.5 2001/03/09 15:49:06 thiessen* major changes to add initial update viewer** Revision 1.4 2001/03/07 13:39:12 thiessen* damn string namespace weirdness again** Revision 1.3 2001/03/06 20:20:51 thiessen* progress towards >1 alignment in a SequenceDisplay ; misc minor fixes** Revision 1.2 2001/03/02 03:26:59 thiessen* fix dangling pointer upon app close** Revision 1.1 2001/03/01 20:15:51 thiessen* major rearrangement of sequence viewer code into base and derived classes**/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -