alnmulti_pane.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:25k
- /*
- * ===========================================================================
- * PRODUCTION $Log: alnmulti_pane.cpp,v $
- * PRODUCTION Revision 1000.6 2004/06/01 21:07:09 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.42
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: alnmulti_pane.cpp,v 1000.6 2004/06/01 21:07:09 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Andrey Yazhuk
- *
- * File Description:
- *
- */
- #include <ncbi_pch.hpp>
- #include <corelib/ncbistl.hpp>
- #include <corelib/ncbitime.hpp>
- #include <gui/opengl/glutils.hpp>
- #include <gui/utils/command.hpp>
- #include <gui/widgets/aln_multiple/alnmulti_settings.hpp>
- #include <gui/widgets/aln_multiple/alnmulti_pane.hpp>
- #include <algorithm>
- #include <FL/Fl.H>
- BEGIN_NCBI_SCOPE
- static const int kRulerSpace = 4;
- static const int kMasterRowSpace = 4;
- CAlnMultiPane::CAlnMultiPane(int PosX, int PosY, int Width, int Height, const char* Label)
- : CGlCanvas2d(PosX, PosY, Width, Height, Label),
- m_pParent(NULL),
- m_pModel(NULL),
- m_pCurrHandler(NULL),
- m_Renderer(TVPRect(0, 0, Width, Height))
- {
- m_Tooltip.SetMode(CTooltip::eHideOnMove);
- m_HandlerPane.EnableOffset();
- m_Renderer.SetBackColor(CGlColor(0.95f, 1.0f, 0.95f));
-
- //setup Event Handlers
- m_MarkHandler.SetHost(static_cast<IAlignMarkHandlerHost*>(this));
- x_AddHandler(dynamic_cast<IEventHandler*>(&m_MarkHandler), fAlignArea);
- m_SelHandler.SetHost(static_cast<ISelHandlerHost*>(this));
- x_AddHandler(dynamic_cast<IEventHandler*>(&m_SelHandler), fAlignArea);
-
- m_MouseZoomHandler.SetHost(static_cast<IMouseZoomHandlerHost*>(this));
- x_AddHandler(dynamic_cast<IEventHandler*>(&m_MouseZoomHandler), fAlignArea);
- x_AddHandler(dynamic_cast<IEventHandler*>(this), fDescrArea);
- m_Event.StandardConfig();
- }
- void CAlnMultiPane::SetWidget(IAlnMultiPaneParent* p_parent)
- {
- m_pParent = p_parent;
- }
- void CAlnMultiPane::SetContext(IAlnMultiRendererContext* p_context)
- {
- m_pContext = p_context;
- m_Renderer.SetContext(m_pContext);
- if(m_pContext) {
- m_HandlerPane = x_GetContext()->GetAlignPort();
- }
- }
- void CAlnMultiPane::SetBackColor(const CGlColor Color)
- {
- m_Renderer.SetBackColor(Color);
- }
- CRuler& CAlnMultiPane::GetRuler()
- {
- return m_Renderer.GetRuler();
- }
- CAlnMultiRenderer& CAlnMultiPane::GetRenderer()
- {
- return m_Renderer;
- }
- void CAlnMultiPane::resize(int x, int y, int w, int h)
- {
- CGlCanvas2d::resize(x, y, w, h);
-
- m_Renderer.Resize(TVPRect(0, 0, w - 1, h - 1));
-
- if(x_GetParent())
- x_GetParent()->OnChildResize();
- }
- int CAlnMultiPane::handle(int event)
- {
- m_Event.OnFLTKEvent(event);
- int res = 0;
- switch(event) {
- case FL_FOCUS:
- case FL_UNFOCUS: redraw(); return 1;
- case FL_KEYDOWN:
- case FL_KEYUP: res = x_HandleKeyEvent(); break;
- case FL_MOVE: res = x_HandleMouseMove(); break;
- case FL_PUSH: res = x_HandleMousePush(); break;
- case FL_DRAG: res = x_HandleMouseDrag(); break;
- case FL_RELEASE: res = x_HandleMouseRelease(); break;
- case FL_MOUSEWHEEL: res = x_HandleMouseWheel(); break;
- case FL_ENTER:
- case FL_LEAVE:
- //fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE); // drop to default
- default: res = CGlCanvas2d::handle(event);
- }
- m_Tooltip.Handle(event);
- return res;
- }
- int CAlnMultiPane::x_HandleKeyEvent()
- {
- IEventHandler* pH = NULL; //dummy
- int res = x_Handlers_handle(fAllAreas, pH, false);
- if(res == 0 && m_Event.GetFLTKEvent() == FL_KEYDOWN) {
- switch(m_Event.GetGUISignal()) {
- case CGUIEvent::eZoomInSignal: x_SendCommand(eCmdZoomIn); break;
- case CGUIEvent::eZoomOutSignal: x_SendCommand(eCmdZoomOut); break;
- case CGUIEvent::eZoomAllSignal: x_SendCommand(eCmdZoomAll); break;
- default: break;
- }
- }
- return res;
- }
- void CAlnMultiPane::x_SendCommand(TCmdID cmd)
- {
- CCommandTarget* target = dynamic_cast<CCommandTarget*>(m_pParent);
- if(target) {
- target->OnCommand(cmd);
- }
- }
- int CAlnMultiPane::x_HandleMouseMove()
- {
- int res = 0;
- IEventHandler* pH = NULL; //dummy
- EColumnType type = m_Renderer.GetColumnTypeByX(Fl::event_x());
-
- switch(type) {
- case IAlignRow::eDescr: res = x_Handlers_handle(fDescrArea, pH, true); break;
- case IAlignRow::eAlignment:
- res = x_Handlers_handle(fAlignArea, pH); break;
- default: break;
- }
- if(res == 0) {
- fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);
- }
- x_UpdateTooltip();
-
- m_pCurrHandler = NULL;
- return res;
- }
- int CAlnMultiPane::x_HandleMousePush()
- {
- if(Fl::focus() != static_cast<Fl_Widget*>(this)) {
- take_focus();
-
- m_Event.OnFLTKEvent(FL_PUSH); // restore event state after focus handling
- }
-
- int res = 0;
- if(m_Event.GetGUISignal() == CGUIEvent::ePopupSignal) {
- x_GetParent()->OnShowPopup();
- res = 1;
- } else {
- IEventHandler* pH = NULL; //dummy
- EColumnType type = m_Renderer.GetColumnTypeByX(Fl::event_x());
-
- switch(type) {
- case IAlignRow::eDescr: res = x_Handlers_handle(fDescrArea, pH, true); break;
- case IAlignRow::eIcons: res = x_Row_handle(); break;
- case IAlignRow::eAlignment:
- res = x_Handlers_handle(fAlignArea, pH); break;
- default: break;
- }
- m_pCurrHandler = pH;
- }
- if(res == 0) {
- fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);
- }
- return res;
- }
- int CAlnMultiPane::x_HandleMouseDrag()
- {
- int res = 0;
- if(m_pCurrHandler) {
- res = m_pCurrHandler->handle(m_Event, m_HandlerPane);
- }
- if(res ==0) {
- fl_cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);
- }
- return res;
- }
- int CAlnMultiPane::x_HandleMouseRelease()
- {
- if(m_Event.GetGUISignal() == CGUIEvent::ePopupSignal) {
- x_GetParent()->OnShowPopup();
- return 1;
- } else return x_HandleMouseDrag();
- }
- int CAlnMultiPane::x_HandleMouseWheel()
- {
- IEventHandler* pH = NULL; //dummy
- int res = x_Handlers_handle(fAllAreas, pH, false);
- if(! res) {
- int d_y = Fl::event_dy();
- x_GetParent()->OnScroll(0, (TModelUnit) d_y);
- }
- return res;
- }
- int CAlnMultiPane::x_Row_handle()
- {
- int i_line = x_GetLineByWindowY(Fl::event_y());
- if(i_line >= 0) {
- IAlignRow* p_row = x_GetContext()->GetRowByLine(i_line);
- _ASSERT(p_row);
-
- int i_col = m_Renderer.GetColumnIndexByX(Fl::event_x());
- IAlignRow::EColumnType type = (IAlignRow::EColumnType)
- (int) m_Renderer.GetColumn(i_col).m_UserData;
- const CGlPane& VP = x_GetContext()->GetAlignPort();
- int vp_top_y = m_Renderer.GetVPListTop() + (int) VP.GetVisibleRect().Top()
- - x_GetContext()->GetLinePosY(i_line);
- CGlPane pane(CGlPane::eNeverUpdate);
- pane.EnableOffset();
- m_Renderer.SetupPaneForRow(pane, p_row, vp_top_y);
- m_Renderer.SetupPaneForColumn(pane, i_col);
- return p_row->handle(m_Event, type, pane);
- }
- return 0;
- }
- void CAlnMultiPane::x_UpdateTooltip()
- {
- int x = Fl::event_x();
- int y = Fl::event_y();
-
- int vp_top = m_Renderer.GetRulerAreaHeight() + m_Renderer.GetMasterAreaHeight();
- bool b_deactivate = true;
- IAlignRow* p_row = NULL;
- int row_top_y = 0;
- if(x_GetContext()->GetMasterRow() &&
- y >= m_Renderer.GetRulerAreaHeight() + kMasterRowSpace &&
- y < vp_top - kMasterRowSpace) {
- p_row = x_GetContext()->GetMasterRow();
- row_top_y = m_Renderer.GetRulerAreaHeight() + kMasterRowSpace;
- } else if(y >= vp_top && y < h()) { // show tooltips only for rows
- int line = x_GetLineByWindowY(y);
- if(line >= 0) {
- p_row = x_GetContext()->GetRowByLine(line);
- row_top_y = x_GetContext()->GetLinePosY(line);
- }
- }
- if(p_row) {
- int i_col = m_Renderer.GetColumnIndexByX(x);
- if(i_col != -1) {
- const CGlPane& VP = x_GetContext()->GetAlignPort();
- int vp_top_y = m_Renderer.GetVPListTop() + (int) VP.GetVisibleRect().Top() - row_top_y;
- string s_tip = x_GetRowTooltip(p_row, i_col, vp_top_y);
- if(s_tip.size()) {
- b_deactivate = false;
- m_Tooltip.Activate(this, s_tip, x, y);
- }
- }
- }
- if(b_deactivate) {
- m_Tooltip.Deactivate(true);
- }
- }
- string CAlnMultiPane::x_GetRowTooltip(IAlignRow* p_row, int i_col, int vp_top_y)
- {
- CGlPane pane;
- pane.EnableOffset();
- m_Renderer.SetupPaneForRow(pane, p_row, vp_top_y);
- m_Renderer.SetupPaneForColumn(pane, i_col);
-
- EColumnType type = m_Renderer.GetColumnTypeByIndex(i_col);
- return p_row->GetTooltip(type, pane);
- }
- ///////////////////////////////////////////////////////////////////////////////
- // Handlers management
- void CAlnMultiPane::x_AddHandler(IEventHandler* handler, int area)
- {
- _ASSERT(handler && area);
- m_lsHandlers.push_back(make_pair(handler, area));
- }
- int CAlnMultiPane::x_Handlers_handle(int area,
- IEventHandler*& handler, bool ignore_curr)
- {
- int res = 0;
-
- IEventHandler* pFirst = ignore_curr ? NULL : m_pCurrHandler;
- if(pFirst) {
- handler = m_pCurrHandler;
- res = m_pCurrHandler->handle(m_Event, m_HandlerPane);
- }
-
- if(res == 0) { // not handles by pFirst - iterate through over handlers
- NON_CONST_ITERATE(THandlerList, it, m_lsHandlers) {
- handler = it->first;
- if( (it->second & area) && (handler != pFirst) ) {
- res = handler->handle(m_Event, m_HandlerPane);
- if(res) break;
- }
- }
- }
- if(res == 0) handler = NULL;
- return res;
- }
- void CAlnMultiPane::draw()
- {
- Render();
- }
- void CAlnMultiPane::Render()
- {
- //_TRACE("nnCAlnMultiPane::Render()");
- //CStopWatch sw;
- //sw.Start();
-
- m_Renderer.SetFocused(Fl::focus() == this);
- //CAlnMultiRenderer::TAreaVector areas;
- //m_Renderer.Render(areas);
- m_Renderer.Render();
- x_RenderSelection();
- x_RenderMark();
- x_RenderZoomHandler();
- //_TRACE("nEND CAlnMultiPane::Render() " << sw.Elapsed());
- }
- void CAlnMultiPane::Update()
- {
- //_TRACE("nnBEGIN CAlnMultiPane::Update() ");
- m_Renderer.Update();
- if(x_GetParent())
- x_GetParent()->OnChildResize();
- //_TRACE("nEND CAlnMultiPane::Update() ");
- }
- //
- void CAlnMultiPane::SetRulerHeight(int height)
- {
- m_Renderer.SetRulerHeight(height);
- }
- CRange<TSeqPos> CAlnMultiPane::GetSelectionLimits()
- {
- return m_SelHandler.GetSelectionLimits();
- }
- const CAlnMultiPane::TRangeColl& CAlnMultiPane::GetSelection() const
- {
- return m_SelHandler.GetSelection();
- }
- void CAlnMultiPane::SetSelection(const TRangeColl& C, bool bRedraw)
- {
- m_SelHandler.SetSelection(C, bRedraw);
- }
- void CAlnMultiPane::ResetSelection(bool bRedraw)
- {
- m_SelHandler.ResetSelection(bRedraw);
- }
- void CAlnMultiPane::MarkSelectedRows(const TRangeColl& C, bool bMark)
- {
- m_MarkHandler.MarkSelectedRows(C, bMark);
- }
- void CAlnMultiPane::UnMarkAll()
- {
- m_MarkHandler.UnMarkAll();
- }
- const CAlnMultiPane::TRowToMarkMap& CAlnMultiPane::GetMarks() const
- {
- return m_MarkHandler.GetMarks();
- }
- int CAlnMultiPane::GetAlignVPHeight() const
- {
- return GetListAreaHeight();
- }
- int CAlnMultiPane::GetAlignVPWidth() const
- {
- int iAlign = m_Renderer.GetColumnIndexByType(IAlignRow::eAlignment);
- return m_Renderer.GetColumn(iAlign).m_Width;
- }
- ////////////////////////////////////////////////////////////////////////////////
- /// protected members
- void CAlnMultiPane::x_RenderSelection()
- {
- if(x_GetParent()) {
- const CGlPane& VP = x_GetContext()->GetAlignPort();
- if(! VP.GetVisibleRect().IsEmpty())
- {
- TVPRect rc_vp = m_Renderer.GetColumnRect(IAlignRow::eAlignment);
- if(rc_vp.Width() > 0) {
- m_HandlerPane.EnableOffset();
- m_HandlerPane.SetViewport(rc_vp);
-
- TModelRect rcM = VP.GetModelLimitsRect();
- rcM.SetVert(0, 1);
- m_HandlerPane.SetModelLimitsRect(rcM);
- TModelRect rcV = VP.GetVisibleRect();
- rcV.SetVert(0, 1);
- m_HandlerPane.SetVisibleRect(rcV);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- m_SelHandler.Render(m_HandlerPane);
-
- glDisable(GL_BLEND);
- }
- }
- }
- }
- void CAlnMultiPane::x_RenderMark()
- {
- if(x_GetParent()) {
- const CGlPane& VP = x_GetContext()->GetAlignPort();
-
- TVPRect rc_vp = m_Renderer.GetColumnRect(IAlignRow::eAlignment);
- if(rc_vp.Width() > 0) {
- rc_vp.SetTop(m_Renderer.GetVPListTop());
- m_HandlerPane.SetViewport(rc_vp);
-
- TModelRect rcM = VP.GetModelLimitsRect();
- m_HandlerPane.SetModelLimitsRect(rcM);
- TModelRect rcV = VP.GetVisibleRect();
- rcV.SetBottom(rcV.Top() + rc_vp.Height());
- m_HandlerPane.SetVisibleRect(rcV);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- m_MarkHandler.Render(m_HandlerPane);
- glDisable(GL_BLEND);
- }
- }
- }
- void CAlnMultiPane::x_RenderZoomHandler()
- {
- if(x_GetParent()) {
- TVPRect rc_vp = m_Renderer.GetColumnRect(IAlignRow::eAlignment);
- if(rc_vp.Width() > 0) {
- m_HandlerPane.SetViewport(rc_vp);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- m_MouseZoomHandler.Render(m_HandlerPane);
-
- glDisable(GL_BLEND);
- }
- }
- }
- int CAlnMultiPane::x_GetLineByWindowY(int WinY) const
- {
- int vpY = WinY - m_Renderer.GetListTop();
- int OffsetY = (int) x_GetContext()->GetAlignPort().GetVisibleRect().Top();
- return x_GetContext()->GetLineByModelY(vpY + OffsetY);
- }
- TVPRect CAlnMultiPane::x_GetLineRect(int Index)
- {
- int Top = 0, H = 0;
- if(x_GetParent() && Index >= 0) {
- int OffsetY = (int) x_GetContext()->GetAlignPort().GetVisibleRect().Top();
- Top = x_GetContext()->GetLinePosY(Index) - OffsetY;
- H = x_GetContext()->GetLineHeight(Index);
- }
- return TVPRect(0, Top + H -1, w()-1, Top);
- }
- ////////////////////////////////////////////////////////////////////////////////
- // ISelListView implementation
- void CAlnMultiPane::SLV_SetModel(TSelListModel* pModel)
- {
- m_pModel = pModel;
- }
- void CAlnMultiPane::SLV_UpdateItems(const TIndexVector& v_indexes)
- {
- bool bRedraw = false;
- TVPRect rcVisible(0, 0, w() - 1, h() - 1);
- for( size_t i = 0; i < v_indexes.size() && ! bRedraw; i++ ) {
- int index = v_indexes[i];
- TVPRect rcItem = x_GetLineRect(index);
- bRedraw = rcItem.Intersects(rcVisible);
- }
- if(bRedraw)
- redraw();
- x_NotifyParent(IAlnMultiPaneParent::eRowSelChanged);
- }
- void CAlnMultiPane::SLV_UpdateRange(int iFirstItem, int iLastItem)
- {
- if(iLastItem >= iFirstItem) {
- TVPRect rcFirst = x_GetLineRect(iFirstItem);
- TVPRect rcLast = x_GetLineRect(iLastItem);
- rcFirst.CombineWith(rcLast);
- TVPRect rcVisible(0, 0, w() - 1, h() - 1);
-
- if(rcFirst.Intersects(rcVisible))
- redraw();
- } else redraw();
- x_NotifyParent(IAlnMultiPaneParent::eRowSelChanged);
- }
- ////////////////////////////////////////////////////////////////////////////////
- /// CSelListController extension
- CAlnMultiPane::TSelListModel* CAlnMultiPane::SLC_GetModel()
- {
- return x_GetModel();
- }
- int CAlnMultiPane::SLC_GetHeight()
- {
- return h();
- }
- int CAlnMultiPane::SLC_GetLineByWindowY(int WinY, bool b_clip)
- {
- int h = m_Renderer.GetRulerAreaHeight() + m_Renderer.GetMasterAreaHeight();
- if(! b_clip || WinY >= h) {
- return x_GetLineByWindowY(WinY);
- } else return -1;
- }
- void CAlnMultiPane::SLC_VertScrollToMakeVisible(int Index)
- {
- // not implemented
- }
- ////////////////////////////////////////////////////////////////////////////////
- /// ISelHandlerHost implementation
- void CAlnMultiPane::SHH_Redraw()
- {
- redraw();
- }
- TModelUnit CAlnMultiPane::SHH_GetModelByWindow(int z, EOrientation orient)
- {
- switch(orient) {
- case eHorz: return m_HandlerPane.UnProjectX(z);
- case eVert: return m_HandlerPane.UnProjectY(h() - z);
- default: _ASSERT(false); return -1;
- }
- }
- TVPUnit CAlnMultiPane::SHH_GetWindowByModel(TModelUnit z, EOrientation orient)
- {
- switch(orient) {
- case eHorz: return m_HandlerPane.ProjectX(z);
- case eVert: return h() - m_HandlerPane.ProjectY(z);
- default: _ASSERT(false); return -1;
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- /// IAlnMarkHandlerHost implementation
- const IAlnMultiDataSource* CAlnMultiPane::MHH_GetAlnDS() const
- {
- return x_GetParent()->GetDataSource();
- }
- const CAlnMultiPane::TSelListModel* CAlnMultiPane::MHH_GetSelListModel() const
- {
- return x_GetModel();
- }
- CAlnMultiPane::TNumrow CAlnMultiPane::MHH_GetRowByLine(int Index) const
- {
- return x_GetParent()->GetRowNumByLine(Index);
- }
- int CAlnMultiPane::MHH_GetLineByRowNum(TNumrow Row) const
- {
- return x_GetParent()->GetLineByRowNum(Row);
- }
- int CAlnMultiPane::MHH_GetLineByWindowY(int Y) const
- {
- return x_GetLineByWindowY(Y);
- }
- int CAlnMultiPane::MHH_GetLinePosY(int Index) const
- {
- return x_GetContext()->GetLinePosY(Index);
- }
- int CAlnMultiPane::MHH_GetLineHeight(int Index) const
- {
- return x_GetContext()->GetLineHeight(Index);
- }
- ///### refactor ??
- TModelUnit CAlnMultiPane::MHH_GetSeqPosByX(int X) const
- {
- return m_HandlerPane.UnProjectX(X);
- }
- void CAlnMultiPane::MHH_Redraw()
- {
- redraw();
- }
- TModelUnit CAlnMultiPane::MZHH_GetScale(EScaleType type)
- {
- const CGlPane& port = x_GetContext()->GetAlignPort();
- switch(type) {
- case eCurrent: return port.GetScaleX();
- case eMin: return port.GetMinScaleX();
- case eMax: return port.GetZoomAllScaleX();
- default: _ASSERT(false); return -1;
- }
- }
- void CAlnMultiPane::MZHH_SetScale(TModelUnit scale, const TModelPoint& point)
- {
- x_GetParent()->OnSetScaleX(scale, point);
- }
- void CAlnMultiPane::MZHH_ZoomRect(const TModelRect& rc)
- {
- x_GetParent()->OnZoomRect(rc);
- }
- void CAlnMultiPane::MZHH_Scroll(TModelUnit d_x, TModelUnit d_y)
- {
- x_GetParent()->OnScroll(d_x, d_y);
- }
- TVPUnit CAlnMultiPane::MZHH_GetVPPosByY(int y) const
- {
- return h() - 1 - y;
- }
- void CAlnMultiPane::MZHH_Redraw(void)
- {
- redraw();
- }
- void CAlnMultiPane::ARH_OnRowChanged(IAlignRow* p_row)
- {
- x_GetParent()->OnRowChanged(p_row);
- }
- TVPPoint CAlnMultiPane::ARH_GetVPMousePos()
- {
- int y = h() - 1 - Fl::event_y();
- int x = Fl::event_x();
- return TVPPoint(x, y);
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: alnmulti_pane.cpp,v $
- * Revision 1000.6 2004/06/01 21:07:09 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.42
- *
- * Revision 1.42 2004/05/21 22:27:52 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.41 2004/05/10 17:46:35 yazhuk
- * Addressed GCC warnings
- *
- * Revision 1.40 2004/04/22 17:10:34 yazhuk
- * Fixed rendering of focus state
- *
- * Revision 1.39 2004/04/06 16:05:24 yazhuk
- * Clean-up
- *
- * Revision 1.38 2004/04/06 13:34:50 dicuccio
- * Commented unused iteration over HTML active areas
- *
- * Revision 1.37 2004/04/05 14:50:05 yazhuk
- * Zoom from keyboard
- *
- * Revision 1.36 2004/04/02 16:39:13 yazhuk
- * Implemented parent notification about changes in selection
- *
- * Revision 1.35 2004/03/29 19:06:24 yazhuk
- * Added GetRenderer(), implemented CHTMLActiveArea-s generation
- *
- * Revision 1.34 2004/03/25 13:05:49 dicuccio
- * Use _TRACE() instead of cout
- *
- * Revision 1.33 2004/03/17 20:13:18 yazhuk
- * Added SetContext(), modified SetWidget()
- *
- * Revision 1.32 2004/03/09 21:02:59 yazhuk
- * Replaced some of the calls to x_GetParent() with x_GetContext(); cleaned-up
- *
- * Revision 1.31 2004/03/08 15:41:32 yazhuk
- * Moved rendering to CAlnMultiRenderer class.
- *
- * Revision 1.30 2004/03/02 15:12:45 yazhuk
- * Expanded "Icons" column
- *
- * Revision 1.29 2004/02/18 02:17:34 ucko
- * Portability fix: don't try to use the return value of map<>::erase(),
- * which yields void in many implementations.
- *
- * Revision 1.28 2004/02/17 15:19:24 yazhuk
- * Support for graphics caching
- *
- * Revision 1.27 2004/01/15 20:14:46 yazhuk
- * Fixed bug in focus handling; added new argument to SLC_GetLineByWindowY
- *
- * Revision 1.26 2004/01/08 19:43:24 yazhuk
- * Refactored and improved tooltips support
- *
- * Revision 1.25 2003/12/29 23:21:27 yazhuk
- * Implemented tooltips support using CTooltip
- *
- * Revision 1.24 2003/12/22 16:24:27 yazhuk
- * Added SetRulerHeight(), clean-up
- *
- * Revision 1.23 2003/12/18 21:22:42 yazhuk
- * Updated code to support template ISelListModel
- *
- * Revision 1.22 2003/12/10 17:10:04 yazhuk
- * Updated IMouseZoomHandlerHost implementation.
- * Basic support for popup menus.
- *
- * Revision 1.21 2003/12/08 15:15:18 yazhuk
- * Removed x_RenderContent(). Implemented workaround for OpenGL precision problems.
- *
- * Revision 1.20 2003/12/01 17:00:22 yazhuk
- * Refactored event handling - introduced CGUIEvent, updated
- * ISelHandlerHost implementation.
- *
- * Revision 1.19 2003/11/24 20:32:22 friedman
- * Commented out check for Fl:damage() == 0
- *
- * Revision 1.18 2003/11/24 15:15:27 dicuccio
- * Added check for Fl::damage() = 0
- *
- * Revision 1.17 2003/11/18 17:58:08 yazhuk
- * Fixed GCC warnings
- *
- * Revision 1.16 2003/11/17 21:20:10 yazhuk
- * Fixed spelling errors, renamed GetScale() to MZHH_GetScale()
- *
- * Revision 1.15 2003/11/03 16:55:54 yazhuk
- * Implemented IAlignRowHost interface and handling events by IAlignRow
- * objects. Added x_SetupPaneForRow(), x_SetupPaneForColumn() functions.
- *
- * Revision 1.14 2003/10/29 23:33:16 yazhuk
- * Migrated to new classes, did a lot of refactoring
- *
- * Revision 1.13 2003/10/20 15:50:28 yazhuk
- * Implemented generalized event handling using IEventHandler. Added CMouseZoomHandler.
- *
- * Revision 1.12 2003/10/15 21:26:38 yazhuk
- * Migrated from using CAlnVec to accessing data via "generic" interface in CAlignDataSource.
- *
- * Revision 1.11 2003/10/10 19:02:52 yazhuk
- * Changed inheritance from CAlnMultiEditPane to CGlCanvas2d
- *
- * Revision 1.10 2003/09/29 17:00:09 dicuccio
- * fl.H -> Fl.H
- *
- * Revision 1.9 2003/09/29 15:53:42 dicuccio
- * Reordered #include statements
- *
- * Revision 1.8 2003/09/29 13:42:39 yazhuk
- * Added "SeqEnd" column, implemented GetMarks()
- *
- * Revision 1.7 2003/09/23 21:05:20 yazhuk
- * Added support for Marks, implemented mouse event handling functions, added x_RenderRow function
- *
- * Revision 1.6 2003/09/15 13:39:18 yazhuk
- * SColumn::m_UserData compilation fix
- *
- * Revision 1.5 2003/09/10 21:49:47 yazhuk
- * GCC compilation fixes
- *
- * Revision 1.4 2003/09/10 20:43:05 yazhuk
- * Merged 4 Pane classes into CAlnMultiPane class. Introduced notion of Columns.
- *
- * Revision 1.3 2003/09/08 16:25:10 yazhuk
- * Modified IAlignParent function calls
- *
- * Revision 1.2 2003/09/02 16:53:57 yazhuk
- * GCC compilation fixes
- *
- * Revision 1.1 2003/08/28 18:25:28 yazhuk
- * Initial revision
- *
- * ===========================================================================
- */