NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | List of all members
CTextSelHandler Class Reference

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>

+ Inheritance diagram for CTextSelHandler:
+ Collaboration diagram for CTextSelHandler:

Public Types

enum  ERenderingOption { eActiveState , ePassiveState }
 
enum  EColorType { eSelection , ePasssiveSelection , eSymbol }
 
typedef CRangeCollection< TSeqPosTRangeColl
 

Public Member Functions

 CTextSelHandler ()
 class CTextSelHandler More...
 
virtual ~CTextSelHandler ()
 
void SetHost (ISeqTextGeometry *pGeometry)
 
void Render (CGlPane &Pane, ERenderingOption option=eActiveState)
 
void STGH_GetSelectedFeatureSubtypes (CSeqTextDefs::TSubtypeVector &subtypes)
 
void STGH_GetMouseOverFeatureSubtypes (CSeqTextDefs::TSubtypeVector &subtypes)
 
void SetColor (EColorType type, const CRgbaColor &color)
 
TSeqRange GetSelectionLimits () const
 
const TRangeCollGetSelection () const
 
void SetRangeSelection (const TRangeColl &C, bool bRedraw)
 
void ResetRangeSelection (bool bRedraw)
 
void ResetObjectSelection (bool b_redraw)
 
void DeSelectObject (const CObject *obj, bool b_redraw)
 
void SelectObject (const CObject *obj, bool b_redraw)
 
void ResetSelection (bool bRedraw)
 
void OnKeyDown (wxKeyEvent &event)
 
void OnKeyUp (wxKeyEvent &event)
 
void OnMousePush (wxMouseEvent &event)
 
void OnMouseDrag (wxMouseEvent &event)
 
void OnMouseRelease (wxMouseEvent &event)
 
- Public Member Functions inherited from ISequenceTextGraphHost
virtual ~ISequenceTextGraphHost ()
 

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
 
ISeqTextGeometrym_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
 

Detailed Description

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.

Member Typedef Documentation

◆ TRangeColl

Definition at line 71 of file text_sel_handler.hpp.

Member Enumeration Documentation

◆ EColorType

Enumerator
eSelection 
ePasssiveSelection 
eSymbol 

Definition at line 79 of file text_sel_handler.hpp.

◆ EExtState

Enumerator
eNoExt 
eExtRangeStart 
eExtRangeEnd 

Definition at line 139 of file text_sel_handler.hpp.

◆ EOpType

enum CTextSelHandler::EOpType
protected
Enumerator
eNoOp 
eAdd 
eRemove 
eChange 

Definition at line 144 of file text_sel_handler.hpp.

◆ ERenderingOption

Enumerator
eActiveState 
ePassiveState 

Definition at line 73 of file text_sel_handler.hpp.

Constructor & Destructor Documentation

◆ CTextSelHandler()

CTextSelHandler::CTextSelHandler ( )

class CTextSelHandler

Definition at line 71 of file text_sel_handler.cpp.

◆ ~CTextSelHandler()

CTextSelHandler::~CTextSelHandler ( )
virtual

Definition at line 87 of file text_sel_handler.cpp.

Member Function Documentation

◆ DeSelectObject()

void CTextSelHandler::DeSelectObject ( const CObject obj,
bool  b_redraw 
)

◆ GetSelection()

const CTextSelHandler::TRangeColl & CTextSelHandler::GetSelection ( void  ) const

Definition at line 104 of file text_sel_handler.cpp.

References m_Selection.

Referenced by CSeqTextPane::GetSelection().

◆ GetSelectionLimits()

TSeqRange CTextSelHandler::GetSelectionLimits ( ) const

Definition at line 98 of file text_sel_handler.cpp.

References CRangeCollection< Position >::GetLimits(), and m_Selection.

◆ OnKeyDown()

void CTextSelHandler::OnKeyDown ( wxKeyEvent &  event)

◆ OnKeyUp()

void CTextSelHandler::OnKeyUp ( wxKeyEvent &  event)

◆ OnMouseDrag()

void CTextSelHandler::OnMouseDrag ( wxMouseEvent &  event)

◆ OnMousePush()

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().

◆ OnMouseRelease()

void CTextSelHandler::OnMouseRelease ( wxMouseEvent &  event)

◆ Render()

void CTextSelHandler::Render ( CGlPane Pane,
ERenderingOption  option = eActiveState 
)

◆ ResetObjectSelection()

void CTextSelHandler::ResetObjectSelection ( bool  b_redraw)

◆ ResetRangeSelection()

void CTextSelHandler::ResetRangeSelection ( bool  bRedraw)

◆ ResetSelection()

void CTextSelHandler::ResetSelection ( bool  bRedraw)

Definition at line 158 of file text_sel_handler.cpp.

References ResetObjectSelection(), and ResetRangeSelection().

Referenced by CSeqTextPane::ResetSelection().

◆ SelectObject()

void CTextSelHandler::SelectObject ( const CObject obj,
bool  b_redraw 
)

◆ SetColor()

void CTextSelHandler::SetColor ( EColorType  type,
const CRgbaColor color 
)

◆ SetHost()

void CTextSelHandler::SetHost ( ISeqTextGeometry pGeometry)

Definition at line 92 of file text_sel_handler.cpp.

References m_pGeometry.

◆ SetRangeSelection()

void CTextSelHandler::SetRangeSelection ( const TRangeColl C,
bool  bRedraw 
)

◆ STGH_GetMouseOverFeatureSubtypes()

void CTextSelHandler::STGH_GetMouseOverFeatureSubtypes ( CSeqTextDefs::TSubtypeVector subtypes)
virtual

◆ STGH_GetSelectedFeatureSubtypes()

void CTextSelHandler::STGH_GetSelectedFeatureSubtypes ( CSeqTextDefs::TSubtypeVector subtypes)
virtual

◆ x_AddToSelection()

void CTextSelHandler::x_AddToSelection ( const TSeqRange Range)
protected

◆ x_ClipPosByRange()

TSeqPos CTextSelHandler::x_ClipPosByRange ( TSeqPos  Pos)
protected

Definition at line 497 of file text_sel_handler.cpp.

References _ASSERT, m_pGeometry, max(), min(), and ISeqTextGeometry::STG_GetLineInfo().

Referenced by x_OnChangeSelRange().

◆ x_GetOpTypeByEvent() [1/2]

CTextSelHandler::EOpType CTextSelHandler::x_GetOpTypeByEvent ( wxKeyEvent &  event) const
protected

helper functions

Definition at line 417 of file text_sel_handler.cpp.

References eNoOp.

Referenced by OnMouseRelease(), x_OnOpChange(), and x_OnStartSel().

◆ x_GetOpTypeByEvent() [2/2]

CTextSelHandler::EOpType CTextSelHandler::x_GetOpTypeByEvent ( wxMouseEvent &  event) const
protected

Definition at line 428 of file text_sel_handler.cpp.

References eAdd, and eRemove.

◆ x_HitTest()

void CTextSelHandler::x_HitTest ( TSeqRange Range,
bool bHitStart,
wxMouseEvent &  event 
)
protected

◆ x_MouseInRightMargin()

bool CTextSelHandler::x_MouseInRightMargin ( wxMouseEvent &  event)
protected

Definition at line 451 of file text_sel_handler.cpp.

References m_pGeometry, and ISeqTextGeometry::STG_IsPointInRightMargin().

Referenced by x_OnChangeSelRange().

◆ x_MouseToSeqPos()

TSeqPos CTextSelHandler::x_MouseToSeqPos ( wxMouseEvent &  event)
protected

◆ x_OnChangeSelRange()

void CTextSelHandler::x_OnChangeSelRange ( wxMouseEvent &  event)
protected

◆ x_OnEndSelRange()

void CTextSelHandler::x_OnEndSelRange ( )
protected

◆ x_OnMouseMove()

int CTextSelHandler::x_OnMouseMove ( CGUIEvent event,
CGlPane Pane 
)
protected

◆ x_OnOpChange()

void CTextSelHandler::x_OnOpChange ( wxMouseEvent &  event)
protected

◆ x_OnResetAll()

void CTextSelHandler::x_OnResetAll ( )
protected

◆ x_OnSelectCursor()

void CTextSelHandler::x_OnSelectCursor ( wxMouseEvent &  event)
protected

◆ x_OnStartSel()

void CTextSelHandler::x_OnStartSel ( wxMouseEvent &  event)
protected

◆ x_RemoveFromSelection()

void CTextSelHandler::x_RemoveFromSelection ( const TSeqRange Range)
protected

◆ x_RenderOpSymbol()

void CTextSelHandler::x_RenderOpSymbol ( TSeqRange  r)
protected

◆ x_RenderRange()

void CTextSelHandler::x_RenderRange ( TSeqRange  r,
CRgbaColor fill_color 
)
protected

◆ x_RenderSelectedFeatures()

void CTextSelHandler::x_RenderSelectedFeatures ( )
protected

◆ x_SetCursor()

void CTextSelHandler::x_SetCursor ( )
protected

◆ x_SetHoverPos()

void CTextSelHandler::x_SetHoverPos ( TSeqPos  pos)
protected

Member Data Documentation

◆ m_BorderColor

CRgbaColor CTextSelHandler::m_BorderColor
private

Definition at line 184 of file text_sel_handler.hpp.

Referenced by Render().

◆ m_bResizeCursor

bool CTextSelHandler::m_bResizeCursor
private

Definition at line 178 of file text_sel_handler.hpp.

Referenced by x_OnSelectCursor(), and x_SetCursor().

◆ m_CurrRange

TSeqRange CTextSelHandler::m_CurrRange
private

Definition at line 172 of file text_sel_handler.hpp.

Referenced by Render(), x_OnChangeSelRange(), x_OnEndSelRange(), and x_OnStartSel().

◆ m_ExtState

EExtState CTextSelHandler::m_ExtState
private

◆ m_Font

CGlTextureFont CTextSelHandler::m_Font
private

Definition at line 188 of file text_sel_handler.hpp.

Referenced by x_RenderOpSymbol().

◆ m_HoverPos

TSeqPos CTextSelHandler::m_HoverPos
private

Definition at line 190 of file text_sel_handler.hpp.

Referenced by Render(), STGH_GetMouseOverFeatureSubtypes(), and x_SetHoverPos().

◆ m_Mapper

CRef<objects::CSeq_loc_Mapper> CTextSelHandler::m_Mapper
private

◆ m_OpType

EOpType CTextSelHandler::m_OpType
private

◆ m_PassiveSelColor

CRgbaColor CTextSelHandler::m_PassiveSelColor
private

Definition at line 185 of file text_sel_handler.hpp.

Referenced by SetColor(), and x_RenderRange().

◆ m_pGeometry

ISeqTextGeometry* CTextSelHandler::m_pGeometry
private

◆ m_SelColor

CRgbaColor CTextSelHandler::m_SelColor
private

Definition at line 183 of file text_sel_handler.hpp.

Referenced by SetColor().

◆ m_SelectedObjects

CObjectIndex CTextSelHandler::m_SelectedObjects
private

◆ m_Selection

TRangeColl CTextSelHandler::m_Selection
private

◆ m_SymbolColor

CRgbaColor CTextSelHandler::m_SymbolColor
private

Definition at line 186 of file text_sel_handler.hpp.

Referenced by Render(), and SetColor().


The documentation for this class was generated from the following files:
Modified on Thu May 02 14:33:49 2024 by modify_doxy.py rev. 669887