NCBI C++ ToolKit
|
Search Toolkit Book for CTextSelHandler
Class CTextSelHandler represents in GUI a two-dimnesional multi-segment selection. More...
#include <gui/widgets/seq_text/text_sel_handler.hpp>
Public Types | |
enum | ERenderingOption { eActiveState , ePassiveState } |
enum | EColorType { eSelection , ePasssiveSelection , eSymbol } |
typedef CRangeCollection< TSeqPos > | TRangeColl |
Protected Types | |
enum | EExtState { eNoExt , eExtRangeStart , eExtRangeEnd } |
enum | EOpType { eNoOp , eAdd , eRemove , eChange } |
Protected Member Functions | |
int | x_OnMouseMove (CGUIEvent &event, CGlPane &Pane) |
void | x_OnStartSel (wxMouseEvent &event) |
Signal handlers. More... | |
void | x_OnChangeSelRange (wxMouseEvent &event) |
void | x_OnEndSelRange () |
void | x_OnResetAll () |
void | x_OnOpChange (wxMouseEvent &event) |
void | x_OnSelectCursor (wxMouseEvent &event) |
void | x_SetCursor () |
void | x_SetHoverPos (TSeqPos pos) |
EOpType | x_GetOpTypeByEvent (wxKeyEvent &event) const |
helper functions More... | |
EOpType | x_GetOpTypeByEvent (wxMouseEvent &event) const |
TSeqPos | x_MouseToSeqPos (wxMouseEvent &event) |
bool | x_MouseInRightMargin (wxMouseEvent &event) |
TSeqPos | x_ClipPosByRange (TSeqPos Pos) |
void | x_HitTest (TSeqRange &Range, bool &bHitStart, wxMouseEvent &event) |
void | x_AddToSelection (const TSeqRange &Range) |
void | x_RemoveFromSelection (const TSeqRange &Range) |
void | x_RenderRange (TSeqRange r, CRgbaColor &fill_color) |
void | x_RenderOpSymbol (TSeqRange r) |
void | x_RenderSelectedFeatures () |
Private Attributes | |
TRangeColl | m_Selection |
TSeqRange | m_CurrRange |
CObjectIndex | m_SelectedObjects |
EExtState | m_ExtState |
EOpType | m_OpType |
bool | m_bResizeCursor |
ISeqTextGeometry * | m_pGeometry |
CRef< objects::CSeq_loc_Mapper > | m_Mapper |
CRgbaColor | m_SelColor |
CRgbaColor | m_BorderColor |
CRgbaColor | m_PassiveSelColor |
CRgbaColor | m_SymbolColor |
CGlTextureFont | m_Font |
TSeqPos | m_HoverPos |
Class CTextSelHandler represents in GUI a two-dimnesional multi-segment selection.
CTextSelHandler renders the selection in a given CGlPane and allows to interactively modify the selection.
CTextSelHandler implements IGlEventHandler what makes it compatible with IGlEventHandler-supproting widgets. CTextSelHandler provides API for programmatical manipulation of the
Definition at line 66 of file text_sel_handler.hpp.
Definition at line 71 of file text_sel_handler.hpp.
Enumerator | |
---|---|
eSelection | |
ePasssiveSelection | |
eSymbol |
Definition at line 79 of file text_sel_handler.hpp.
|
protected |
Enumerator | |
---|---|
eNoExt | |
eExtRangeStart | |
eExtRangeEnd |
Definition at line 139 of file text_sel_handler.hpp.
|
protected |
Enumerator | |
---|---|
eNoOp | |
eAdd | |
eRemove | |
eChange |
Definition at line 144 of file text_sel_handler.hpp.
Enumerator | |
---|---|
eActiveState | |
ePassiveState |
Definition at line 73 of file text_sel_handler.hpp.
CTextSelHandler::CTextSelHandler | ( | ) |
class CTextSelHandler
Definition at line 71 of file text_sel_handler.cpp.
|
virtual |
Definition at line 87 of file text_sel_handler.cpp.
Definition at line 130 of file text_sel_handler.cpp.
References m_pGeometry, m_SelectedObjects, CObjectIndex::Remove(), and ISeqTextGeometry::STG_OnChanged().
Referenced by CSeqTextPane::DeSelectObject().
const CTextSelHandler::TRangeColl & CTextSelHandler::GetSelection | ( | void | ) | const |
Definition at line 104 of file text_sel_handler.cpp.
References m_Selection.
Referenced by CSeqTextPane::GetSelection().
TSeqRange CTextSelHandler::GetSelectionLimits | ( | ) | const |
Definition at line 98 of file text_sel_handler.cpp.
References CRangeCollection< Position >::GetLimits(), and m_Selection.
void CTextSelHandler::OnKeyDown | ( | wxKeyEvent & | event | ) |
void CTextSelHandler::OnKeyUp | ( | wxKeyEvent & | event | ) |
void CTextSelHandler::OnMouseDrag | ( | wxMouseEvent & | event | ) |
Definition at line 189 of file text_sel_handler.cpp.
References eNoOp, m_OpType, x_MouseToSeqPos(), x_OnChangeSelRange(), x_OnSelectCursor(), and x_SetHoverPos().
Referenced by CSeqTextPane::OnMouseDrag().
void CTextSelHandler::OnMousePush | ( | wxMouseEvent & | event | ) |
Definition at line 178 of file text_sel_handler.cpp.
References x_OnResetAll(), x_OnSelectCursor(), and x_OnStartSel().
Referenced by CSeqTextPane::OnMousePush().
void CTextSelHandler::OnMouseRelease | ( | wxMouseEvent & | event | ) |
Definition at line 203 of file text_sel_handler.cpp.
References m_OpType, x_GetOpTypeByEvent(), x_OnChangeSelRange(), x_OnEndSelRange(), and x_OnSelectCursor().
Referenced by CSeqTextPane::OnMouseRelease().
void CTextSelHandler::Render | ( | CGlPane & | Pane, |
ERenderingOption | option = eActiveState |
||
) |
Definition at line 675 of file text_sel_handler.cpp.
References C, eActiveState, eNoOp, CGlPane::eOrtho, CGlPane::GetVisibleRect(), CGlRect< T >::IsEmpty(), ITERATE, m_BorderColor, m_CurrRange, m_HoverPos, m_OpType, m_pGeometry, m_Selection, m_SymbolColor, NULL, option, r(), ISeqTextGeometry::STG_GetFeaturesAtPosition(), ISeqTextGeometry::STG_RenderMouseOverFeature(), x_RenderOpSymbol(), x_RenderRange(), and x_RenderSelectedFeatures().
Referenced by CSeqTextPane::x_RenderSelHandler().
void CTextSelHandler::ResetObjectSelection | ( | bool | b_redraw | ) |
Definition at line 119 of file text_sel_handler.cpp.
References CObjectIndex::Clear(), m_pGeometry, m_SelectedObjects, ISeqTextGeometry::STG_GetScope(), and ISeqTextGeometry::STG_OnChanged().
Referenced by CSeqTextPane::ResetObjectSelection(), and ResetSelection().
void CTextSelHandler::ResetRangeSelection | ( | bool | bRedraw | ) |
Definition at line 150 of file text_sel_handler.cpp.
References CRangeCollection< Position >::clear(), m_pGeometry, m_Selection, and ISeqTextGeometry::STG_OnChanged().
Referenced by CSeqTextPane::ResetRangeSelection(), and ResetSelection().
void CTextSelHandler::ResetSelection | ( | bool | bRedraw | ) |
Definition at line 158 of file text_sel_handler.cpp.
References ResetObjectSelection(), and ResetRangeSelection().
Referenced by CSeqTextPane::ResetSelection().
Definition at line 141 of file text_sel_handler.cpp.
References CObjectIndex::Add(), m_pGeometry, m_SelectedObjects, NULL, and ISeqTextGeometry::STG_OnChanged().
Referenced by CSeqTextPane::SelectObject().
void CTextSelHandler::SetColor | ( | EColorType | type, |
const CRgbaColor & | color | ||
) |
Definition at line 164 of file text_sel_handler.cpp.
References _ASSERT, color, ePasssiveSelection, eSelection, eSymbol, m_PassiveSelColor, m_SelColor, and m_SymbolColor.
void CTextSelHandler::SetHost | ( | ISeqTextGeometry * | pGeometry | ) |
Definition at line 92 of file text_sel_handler.cpp.
References m_pGeometry.
void CTextSelHandler::SetRangeSelection | ( | const TRangeColl & | C, |
bool | bRedraw | ||
) |
Definition at line 110 of file text_sel_handler.cpp.
References C, m_pGeometry, m_Selection, and ISeqTextGeometry::STG_OnChanged().
Referenced by CSeqTextPane::SetRangeSelection().
|
virtual |
Implements ISequenceTextGraphHost.
Definition at line 762 of file text_sel_handler.cpp.
References CSeqFeatData::eSubtype_bad, i, ITERATE, m_HoverPos, m_pGeometry, NULL, ISeqTextGeometry::STG_GetFeaturesAtPosition(), ISeqTextGeometry::STG_GetVisibleRange(), and ISeqTextGeometry::STG_SetSubtypesForFeature().
|
virtual |
Implements ISequenceTextGraphHost.
Definition at line 714 of file text_sel_handler.cpp.
References CSeq_loc_Mapper::eSeqMap_Up, CSeqFeatData::eSubtype_bad, CSeq_feat_Base::GetData(), CSeq_feat_Base::GetLocation(), CObjectIndex::GetObjects(), CSeqFeatData::GetSubtype(), CSerialObject::GetThisTypeInfo(), i, ITERATE, m_Mapper, m_pGeometry, m_SelectedObjects, NULL, CRef< C, Locker >::Reset(), ISeqTextGeometry::STG_GetDataSourceLoc(), ISeqTextGeometry::STG_GetScope(), ISeqTextGeometry::STG_GetVisibleRange(), and ISeqTextGeometry::STG_SetSubtypesForFeature().
Definition at line 510 of file text_sel_handler.cpp.
References CRangeCollection< Position >::CombineWith(), m_Selection, and compile_time_bits::range().
Referenced by x_OnEndSelRange().
Definition at line 497 of file text_sel_handler.cpp.
References _ASSERT, m_pGeometry, max(), min(), and ISeqTextGeometry::STG_GetLineInfo().
Referenced by x_OnChangeSelRange().
|
protected |
helper functions
Definition at line 417 of file text_sel_handler.cpp.
References eNoOp.
Referenced by OnMouseRelease(), x_OnOpChange(), and x_OnStartSel().
|
protected |
Definition at line 428 of file text_sel_handler.cpp.
|
protected |
Definition at line 459 of file text_sel_handler.cpp.
References _ASSERT, abs, C, int, ITERATE, kDragThreshold, m_pGeometry, m_Selection, compile_time_bits::range(), and ISeqTextGeometry::STG_GetSequenceByWindow().
Referenced by x_OnSelectCursor(), and x_OnStartSel().
|
protected |
Definition at line 451 of file text_sel_handler.cpp.
References m_pGeometry, and ISeqTextGeometry::STG_IsPointInRightMargin().
Referenced by x_OnChangeSelRange().
|
protected |
Definition at line 443 of file text_sel_handler.cpp.
References m_pGeometry, and ISeqTextGeometry::STG_GetSequenceByWindow().
Referenced by OnMouseDrag(), x_OnChangeSelRange(), and x_OnStartSel().
|
protected |
Definition at line 284 of file text_sel_handler.cpp.
References eExtRangeEnd, eExtRangeStart, COpenRange< Position >::Empty(), eNoExt, CRange_Base::GetFrom(), COpenRange< Position >::GetToOpen(), m_CurrRange, m_ExtState, m_pGeometry, CRange_Base::SetFrom(), COpenRange< Position >::SetToOpen(), ISeqTextGeometry::STG_Redraw(), x_ClipPosByRange(), x_MouseInRightMargin(), x_MouseToSeqPos(), and x_SetHoverPos().
Referenced by OnMouseDrag(), and OnMouseRelease().
|
protected |
Definition at line 337 of file text_sel_handler.cpp.
References eAdd, eChange, COpenRange< Position >::Empty(), eNoExt, eNoOp, eRemove, m_CurrRange, m_ExtState, m_OpType, m_pGeometry, COpenRange< Position >::SetLength(), ISeqTextGeometry::STG_OnChanged(), x_AddToSelection(), and x_RemoveFromSelection().
Referenced by OnMouseRelease().
|
protected |
Definition at line 369 of file text_sel_handler.cpp.
References eNoExt, m_ExtState, m_OpType, m_pGeometry, ISeqTextGeometry::STG_Redraw(), x_GetOpTypeByEvent(), and x_OnSelectCursor().
|
protected |
Definition at line 355 of file text_sel_handler.cpp.
References CRangeCollection< Position >::clear(), CRangeCollection< Position >::empty(), eNoExt, eNoOp, m_ExtState, m_OpType, m_pGeometry, m_Selection, and ISeqTextGeometry::STG_OnChanged().
Referenced by OnMousePush().
|
protected |
Definition at line 384 of file text_sel_handler.cpp.
References eAdd, eChange, eNoOp, eRemove, m_bResizeCursor, m_OpType, COpenRange< Position >::NotEmpty(), x_HitTest(), and x_SetCursor().
Referenced by OnMouseDrag(), OnMousePush(), OnMouseRelease(), and x_OnOpChange().
|
protected |
Signal handlers.
Definition at line 258 of file text_sel_handler.cpp.
References eChange, eExtRangeEnd, eExtRangeStart, m_CurrRange, m_ExtState, m_OpType, m_pGeometry, COpenRange< Position >::NotEmpty(), CRange_Base::SetFrom(), COpenRange< Position >::SetToOpen(), ISeqTextGeometry::STG_Redraw(), x_GetOpTypeByEvent(), x_HitTest(), x_MouseToSeqPos(), and x_RemoveFromSelection().
Referenced by OnMousePush().
Definition at line 516 of file text_sel_handler.cpp.
References m_Selection, compile_time_bits::range(), and CRangeCollection< Position >::Subtract().
Referenced by x_OnEndSelRange(), and x_OnStartSel().
|
protected |
Definition at line 591 of file text_sel_handler.cpp.
References _ASSERT, CGlRect< T >::Bottom(), eAdd, eChange, eNoOp, eRemove, CGlRect< T >::Height(), CGlRect< T >::Left(), m_Font, m_OpType, m_pGeometry, CGlPoint< T >::m_X, CGlPoint< T >::m_Y, max(), min(), r(), ISeqTextGeometry::STG_GetModelPointBySourcePos(), ISeqTextGeometry::STG_GetVisibleRange(), CGlTextureFont::TextOut(), and CGlRect< T >::Width().
Referenced by Render().
|
protected |
Definition at line 533 of file text_sel_handler.cpp.
References _ASSERT, GetGl(), CGlRect< T >::Init(), IRender::LineWidth(), m_PassiveSelColor, m_pGeometry, CGlPoint< T >::m_X, CGlPoint< T >::m_Y, max(), min(), r(), RenderRect(), ISeqTextGeometry::STG_GetLineInfo(), ISeqTextGeometry::STG_GetModelPointBySourcePos(), and ISeqTextGeometry::STG_GetVisibleRange().
Referenced by Render().
|
protected |
Definition at line 643 of file text_sel_handler.cpp.
References CSeq_loc_Mapper::eSeqMap_Up, CSeq_feat_Base::GetLocation(), CObjectIndex::GetObjects(), CSerialObject::GetThisTypeInfo(), ITERATE, m_Mapper, m_pGeometry, m_SelectedObjects, NULL, CRef< C, Locker >::Reset(), ISeqTextGeometry::STG_GetDataSourceLoc(), ISeqTextGeometry::STG_GetScope(), and ISeqTextGeometry::STG_RenderSelectedFeature().
Referenced by Render().
|
protected |
Definition at line 402 of file text_sel_handler.cpp.
References m_bResizeCursor, m_pGeometry, ISeqTextGeometry::STG_SetDefaultCursor(), and ISeqTextGeometry::STG_SetResizeCursor().
Referenced by x_OnSelectCursor().
|
protected |
Definition at line 212 of file text_sel_handler.cpp.
References m_HoverPos, m_pGeometry, NULL, ISeqTextGeometry::STG_OnChanged(), and ISeqTextGeometry::STG_ReportMouseOverPos().
Referenced by OnMouseDrag(), and x_OnChangeSelRange().
|
private |
Definition at line 184 of file text_sel_handler.hpp.
Referenced by Render().
|
private |
Definition at line 178 of file text_sel_handler.hpp.
Referenced by x_OnSelectCursor(), and x_SetCursor().
|
private |
Definition at line 172 of file text_sel_handler.hpp.
Referenced by Render(), x_OnChangeSelRange(), x_OnEndSelRange(), and x_OnStartSel().
|
private |
Definition at line 176 of file text_sel_handler.hpp.
Referenced by x_OnChangeSelRange(), x_OnEndSelRange(), x_OnOpChange(), x_OnResetAll(), and x_OnStartSel().
|
private |
Definition at line 188 of file text_sel_handler.hpp.
Referenced by x_RenderOpSymbol().
|
private |
Definition at line 190 of file text_sel_handler.hpp.
Referenced by Render(), STGH_GetMouseOverFeatureSubtypes(), and x_SetHoverPos().
|
private |
Definition at line 181 of file text_sel_handler.hpp.
Referenced by STGH_GetSelectedFeatureSubtypes(), and x_RenderSelectedFeatures().
|
private |
Definition at line 177 of file text_sel_handler.hpp.
Referenced by OnMouseDrag(), OnMouseRelease(), Render(), x_OnEndSelRange(), x_OnOpChange(), x_OnResetAll(), x_OnSelectCursor(), x_OnStartSel(), and x_RenderOpSymbol().
|
private |
Definition at line 185 of file text_sel_handler.hpp.
Referenced by SetColor(), and x_RenderRange().
|
private |
Definition at line 180 of file text_sel_handler.hpp.
Referenced by DeSelectObject(), Render(), ResetObjectSelection(), ResetRangeSelection(), SelectObject(), SetHost(), SetRangeSelection(), STGH_GetMouseOverFeatureSubtypes(), STGH_GetSelectedFeatureSubtypes(), x_ClipPosByRange(), x_HitTest(), x_MouseInRightMargin(), x_MouseToSeqPos(), x_OnChangeSelRange(), x_OnEndSelRange(), x_OnOpChange(), x_OnResetAll(), x_OnStartSel(), x_RenderOpSymbol(), x_RenderRange(), x_RenderSelectedFeatures(), x_SetCursor(), and x_SetHoverPos().
|
private |
Definition at line 183 of file text_sel_handler.hpp.
Referenced by SetColor().
|
private |
Definition at line 174 of file text_sel_handler.hpp.
Referenced by DeSelectObject(), ResetObjectSelection(), SelectObject(), STGH_GetSelectedFeatureSubtypes(), and x_RenderSelectedFeatures().
|
private |
Definition at line 171 of file text_sel_handler.hpp.
Referenced by GetSelection(), GetSelectionLimits(), Render(), ResetRangeSelection(), SetRangeSelection(), x_AddToSelection(), x_HitTest(), x_OnResetAll(), and x_RemoveFromSelection().
|
private |
Definition at line 186 of file text_sel_handler.hpp.
Referenced by Render(), and SetColor().