nux-1.14.0
TabView.cpp
00001 /*
00002  * Copyright 2010 Inalogic® Inc.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License, as
00006  * published by the  Free Software Foundation; either version 2.1 or 3.0
00007  * of the License.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranties of
00011  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00012  * PURPOSE.  See the applicable version of the GNU Lesser General Public
00013  * License for more details.
00014  *
00015  * You should have received a copy of both the GNU Lesser General Public
00016  * License along with this program. If not, see <http://www.gnu.org/licenses/>
00017  *
00018  * Authored by: Jay Taoko <jaytaoko@inalogic.com>
00019  *
00020  */
00021 
00022 
00023 #include "Nux.h"
00024 #include "TabView.h"
00025 #include "Layout.h"
00026 #include "HLayout.h"
00027 #include "VLayout.h"
00028 
00029 namespace nux
00030 {
00031 
00032   int TabView::TAB_BUTTON_WIDTH   = 12;
00033   int TabView::TAB_BUTTON_HEIGHT  = 20;
00034   int TabView::TAB_HEIGHT         = 24;
00035   int TabView::TAB_X_BORDER       = 4;
00036   int TabView::TAB_Y_BORDER       = 4;
00037 
00038   Color TabView::TAB_HEADER_BACKGROUND_COLOR    = Color (0xFF000000);
00039   Color TabView::TAB_BACKGROUND_COLOR           = Color (0xFF191919);
00040   Color TabView::TAB_HEADER_COLOR               = Color (0xFF333333);
00041   Color TabView::TAB_HEADER_FOCUS_COLOR         = Color (0xFF5D5D5D);
00042 
00043   TabView::TabElement::TabElement (NString TabName, Layout *TabLayout)
00044   {
00045     _index = 0;
00046     _tab_name = TabName;
00047     _tab_content_layout = TabLayout;
00048     _tab_area = new InputArea (NUX_TRACKER_LOCATION);
00049 
00050     _tab_content_layout->Reference();
00051     _tab_area->Reference();
00052   }
00053 
00054   TabView::TabElement::~TabElement()
00055   {
00056     _index = 0;
00057     _tab_content_layout->UnReference();
00058     _tab_area->UnReference();
00059   }
00060 
00061   void TabView::TabElement::SetIndex (int index)
00062   {
00063     _index = index;
00064   }
00065 
00066   int TabView::TabElement::GetIndex() const
00067   {
00068     return _index;
00069   }
00070 
00071   void TabView::TabElement::SetGeometry (const Geometry &geo)
00072   {
00073     _tab_area->SetGeometry (geo);
00074   }
00075 
00076   Geometry const& TabView::TabElement::GetGeometry() const
00077   {
00078     return _tab_area->GetGeometry();
00079   }
00080 
00081   const NString &TabView::TabElement::GetName() const
00082   {
00083     return _tab_name;
00084   }
00085 
00086   TabView::TabView (NUX_FILE_LINE_DECL)
00087     :   View (NUX_FILE_LINE_PARAM)
00088   {
00089     _scroll_right           = NULL;
00090     _scroll_left           = NULL;
00091     _visible_tab_content_layout      = NULL;
00092     _tabview_heads_layout         = NULL;
00093     _tabview_scroll_button_layout  = NULL;
00094 
00095     m_FocusTabIndex     = 0;
00096     m_TabPositionOffset = 0;
00097     m_DrawBackgroundOnPreviousGeometry = false;
00098 
00099     _tabview_heads_layout         = new HLayout (NUX_TRACKER_LOCATION);
00100     //_tabview_heads_layout->SetParentObject(this);
00101     _tabview_scroll_button_layout  = new HLayout (NUX_TRACKER_LOCATION);
00102     _tabview_scroll_button_layout->SetParentObject(this);
00103     _scroll_right           = new InputArea (NUX_TRACKER_LOCATION);
00104     _scroll_left           = new InputArea (NUX_TRACKER_LOCATION);
00105 
00106     _scroll_right->SetMinimumSize (TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
00107     _scroll_left->SetMinimumSize (TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
00108     _scroll_right->SetMaximumSize (TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
00109     _scroll_left->SetMaximumSize (TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
00110 
00111     _scroll_right->mouse_enter.connect (sigc::mem_fun (this, &TabView::RecvMouseEnter) );
00112     _scroll_right->mouse_leave.connect (sigc::mem_fun (this, &TabView::RecvMouseLeave) );
00113     _scroll_left->mouse_enter.connect (sigc::mem_fun (this, &TabView::RecvMouseEnter) );
00114     _scroll_left->mouse_leave.connect (sigc::mem_fun (this, &TabView::RecvMouseLeave) );
00115 
00116     _scroll_right->mouse_down.connect (sigc::mem_fun (this, &TabView::RecvTabRightMouseDown) );
00117     _scroll_left->mouse_down.connect (sigc::mem_fun (this, &TabView::RecvTabLeftMouseDown) );
00118     _scroll_right->mouse_up.connect (sigc::mem_fun (this, &TabView::RecvTabButtonMouseUp) );
00119     _scroll_left->mouse_up.connect (sigc::mem_fun (this, &TabView::RecvTabButtonMouseUp) );
00120 
00121     _tabview_scroll_button_layout->AddView (_scroll_left, 1, eCenter);
00122     _tabview_scroll_button_layout->AddView (_scroll_right, 1, eCenter);
00123 
00124 
00125     tabright_callback = new TimerFunctor;
00126     tabright_callback->OnTimerExpired.connect (sigc::mem_fun (this, &TabView::RecvTabRightTimerExpired) );
00127     tableft_callback = new TimerFunctor;
00128     tableft_callback->OnTimerExpired.connect (sigc::mem_fun (this, &TabView::RecvTabLeftTimerExpired) );
00129   }
00130 
00131   TabView::~TabView()
00132   {
00133     _tabview_heads_layout->UnReference();
00134     _tabview_scroll_button_layout->UnReference();
00135     RemoveCompositionLayout();
00136     delete (tabright_callback);
00137     delete (tableft_callback);
00138     
00139     std::vector<TabElement *>::iterator it;
00140 
00141     for (it = _tab_array.begin(); it != _tab_array.end(); it++)
00142     {
00143       (*it)->_tab_area->UnParentObject();
00144       (*it)->_tab_content_layout->UnParentObject();
00145       delete (*it);
00146     }
00147 
00148     _tab_array.clear();
00149   }
00150 
00151   long TabView::ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
00152   {
00153     long ret = TraverseInfo;
00154 
00155     ret = _scroll_right->OnEvent (ievent, ret, ProcessEventInfo);
00156     ret = _scroll_left->OnEvent (ievent, ret, ProcessEventInfo);
00157 
00158 //    if(_scroll_right->IsMouseOwner())
00159 //        TranslateTabLayout(-10);
00160 //    if(_scroll_left->IsMouseOwner())
00161 //        TranslateTabLayout(10);
00162 
00163     t_u32 vector_size = (t_u32) _tab_array.size();
00164 
00165     for (t_u32 i = 0; i < vector_size; i++)
00166     {
00167       ret = _tab_array[i]->_tab_area->OnEvent (ievent, ret, ProcessEventInfo);
00168     }
00169 
00170     if (_visible_tab_content_layout)
00171       ret = _visible_tab_content_layout->ProcessEvent (ievent, ret, ProcessEventInfo);
00172 
00173     ret = PostProcessEvent2 (ievent, ret, 0);
00174     return ret;
00175   }
00176 
00177   Area* TabView::FindAreaUnderMouse(const Point& mouse_position, NuxEventType event_type)
00178   {
00179     bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
00180 
00181     if(mouse_inside == false)
00182       return NULL;
00183 
00184     NUX_RETURN_VALUE_IF_TRUE(_scroll_right->TestMousePointerInclusion(mouse_position, event_type), _scroll_right);
00185     NUX_RETURN_VALUE_IF_TRUE(_scroll_left->TestMousePointerInclusion(mouse_position, event_type), _scroll_left);
00186 
00187     t_u32 vector_size = (t_u32) _tab_array.size();
00188     for(t_u32 i = 0; i < vector_size; i++)
00189     {
00190       NUX_RETURN_VALUE_IF_TRUE(_tab_array[i]->_tab_area->TestMousePointerInclusion(mouse_position, event_type), _tab_array[i]->_tab_area);
00191     }
00192 
00193     if(_visible_tab_content_layout)
00194     {
00195       nuxAssert(_visible_tab_content_layout->IsLayout());
00196       Area* found_area = _visible_tab_content_layout->FindAreaUnderMouse(mouse_position, event_type);
00197       if(found_area)
00198         return found_area;
00199     }
00200 
00201     return this;
00202   }
00203 
00204 
00205   void TabView::Draw (GraphicsEngine &GfxContext, bool force_draw)
00206   {
00207     if (m_DrawBackgroundOnPreviousGeometry)
00208     {
00209       GetPainter().PaintBackground (GfxContext, m_PreviousGeometry);
00210       m_DrawBackgroundOnPreviousGeometry = false;
00211     }
00212 
00213     GfxContext.PushClippingRectangle (GetGeometry() );
00214     Geometry base = GetGeometry();
00215 
00216     GetPainter().PushDrawShapeLayer (GfxContext, Geometry (base.x, base.y, base.GetWidth(), TAB_HEIGHT), eSHAPE_CORNER_ROUND4, TAB_HEADER_BACKGROUND_COLOR, eCornerTopLeft | eCornerTopRight);
00217 
00218     if (_visible_tab_content_layout)
00219       _visible_tab_content_layout->QueueDraw();
00220 
00221     t_u32 vector_size = (t_u32) _tab_array.size();
00222 
00223     Geometry geo = GetGeometry();
00224     Geometry clip_geo;
00225     clip_geo.SetX (geo.x);
00226     clip_geo.SetY (geo.y);
00227     clip_geo.SetWidth (geo.GetWidth() - 2 * TAB_BUTTON_WIDTH);
00228     clip_geo.SetHeight (_tabview_heads_layout->GetBaseHeight() );
00229 
00230     GfxContext.PushClippingRectangle (clip_geo);
00231 
00232     for (t_u32 i = 0; i < vector_size; i++)
00233     {
00234       Geometry tab_geo = _tab_array[i]->_tab_area->GetGeometry();
00235       const char *tab_text = _tab_array[i]->GetName().GetTCharPtr();
00236 
00237       if (_tab_array[i]->_index == m_FocusTabIndex)
00238       {
00239         tab_geo.OffsetSize (-2, 0);
00240         GetPainter().PaintShapeCorner (GfxContext, tab_geo, TAB_HEADER_FOCUS_COLOR, eSHAPE_CORNER_ROUND4, eCornerTopLeft | eCornerTopRight, false);
00241         GetPainter().PaintTextLineStatic (GfxContext, GetSysBoldFont(), tab_geo, tab_text, Color (0xFFFFFFFF), true, eAlignTextCenter);
00242       }
00243       else
00244       {
00245         tab_geo.OffsetSize (-2, 0);
00246         GetPainter().PaintShapeCorner (GfxContext, tab_geo, TAB_HEADER_COLOR, eSHAPE_CORNER_ROUND4, eCornerTopLeft | eCornerTopRight, false);
00247         GetPainter().PaintTextLineStatic (GfxContext, GetSysBoldFont(), tab_geo, tab_text, Color (0xFF000000), true, eAlignTextCenter);
00248       }
00249     }
00250 
00251     GfxContext.PopClippingRectangle();
00252 
00253     GetPainter().PaintShapeCorner (GfxContext, Geometry (base.x, base.y + TAB_HEIGHT, base.GetWidth(), base.GetHeight() - TAB_HEIGHT),
00254                                TAB_BACKGROUND_COLOR, eSHAPE_CORNER_ROUND4, eCornerBottomLeft | eCornerBottomRight, false);
00255 
00256     GetPainter().Paint2DQuadColor (GfxContext, _scroll_right->GetGeometry(), TAB_HEADER_BACKGROUND_COLOR);
00257     GeometryPositioning gp (eHACenter, eVACenter);
00258     Geometry GeoPo = ComputeGeometryPositioning (_scroll_right->GetGeometry(), GetTheme().GetImageGeometry (eTAB_RIGHT), gp);
00259 
00260     if (_scroll_right->IsMouseInside() )
00261       GetPainter().PaintShape (GfxContext, GeoPo, Color (0xFFFFFFFF), eTAB_RIGHT);
00262     else
00263       GetPainter().PaintShape (GfxContext, GeoPo, TAB_HEADER_FOCUS_COLOR, eTAB_RIGHT);
00264 
00265     GetPainter().Paint2DQuadColor (GfxContext, _scroll_left->GetGeometry(), TAB_HEADER_BACKGROUND_COLOR);
00266     gp.SetAlignment (eHACenter, eVACenter);
00267     GeoPo = ComputeGeometryPositioning (_scroll_left->GetGeometry(), GetTheme().GetImageGeometry (eTAB_LEFT), gp);
00268 
00269     if (_scroll_left->IsMouseInside() )
00270       GetPainter().PaintShape (GfxContext, GeoPo, Color (0xFFFFFFFF), eTAB_LEFT);
00271     else
00272       GetPainter().PaintShape (GfxContext, GeoPo, TAB_HEADER_FOCUS_COLOR, eTAB_LEFT);
00273 
00274     GetPainter().PopBackground();
00275     GfxContext.PopClippingRectangle();
00276   }
00277 
00278   void TabView::DrawContent (GraphicsEngine &GfxContext, bool force_draw)
00279   {
00280     Geometry base = GetGeometry();
00281 
00282     GfxContext.PushClippingRectangle (GetGeometry() );
00283     GetPainter().PushShapeLayer (GfxContext, Geometry (base.x, base.y + TAB_HEIGHT, base.GetWidth(), base.GetHeight() - TAB_HEIGHT),
00284                              eSHAPE_CORNER_ROUND4, TAB_BACKGROUND_COLOR, eCornerBottomLeft | eCornerBottomRight);
00285 
00286     if (_visible_tab_content_layout)
00287     {
00288       GfxContext.PushClippingRectangle (_visible_tab_content_layout->GetGeometry() );
00289       _visible_tab_content_layout->ProcessDraw (GfxContext, force_draw);
00290       GfxContext.PopClippingRectangle();
00291     }
00292 
00293     GetPainter().PopBackground();
00294     GfxContext.PopClippingRectangle();
00295   }
00296 
00297   void TabView::PostDraw (GraphicsEngine &GfxContext, bool force_draw)
00298   {
00299 
00300   }
00301 
00302   void TabView::PreLayoutManagement()
00303   {
00304     // Give the managed layout appropriate size and position..
00305     if (m_CompositionLayout)
00306     {
00307       Geometry layout_geo = GetGeometry();
00308       layout_geo.OffsetPosition (TAB_X_BORDER, TAB_HEIGHT);
00309       layout_geo.OffsetSize (-2 * TAB_X_BORDER, - (TAB_HEIGHT) - TAB_Y_BORDER);
00310       m_CompositionLayout->SetGeometry (layout_geo);
00311     }
00312   }
00313 
00314   long TabView::PostLayoutManagement (long LayoutResult)
00315   {
00316     // Set the geometry of the control to be the same as the managed layout.
00317     // Only the size is changed. The position of the composition layout hasn't
00318     // been changed by ComputeLayout2.
00319     if (m_CompositionLayout)
00320     {
00321       Geometry base = m_CompositionLayout->GetGeometry();
00322       base.OffsetPosition (-TAB_X_BORDER, -TAB_HEIGHT);
00323       base.OffsetSize (2 * TAB_X_BORDER, TAB_HEIGHT + TAB_Y_BORDER);
00324       Area::SetGeometry (base);
00325     }
00326 
00327     Geometry base = GetGeometry();
00328 
00329     int tab_x = m_CompositionLayout->GetGeometry().x + m_CompositionLayout->GetGeometry().GetWidth() - 2 * TAB_BUTTON_WIDTH;
00330     int tab_y = base.y;
00331 
00332     _scroll_left->SetBaseXY (tab_x, tab_y);
00333     _scroll_left->SetBaseSize (TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
00334     _scroll_right->SetBaseXY (tab_x + TAB_BUTTON_WIDTH, tab_y);
00335     _scroll_right->SetBaseSize (TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
00336 
00337     _tabview_heads_layout->SetBaseY (tab_y);
00338     _tabview_heads_layout->SetBaseHeight (TAB_HEIGHT);
00339     TranslateTabLayout (0);
00340 
00341     _tabview_scroll_button_layout->SetBaseXY (tab_x, tab_y);
00342     _tabview_scroll_button_layout->SetBaseSize (2 * TAB_BUTTON_WIDTH, TAB_HEIGHT);
00343     GetWindowThread ()->ComputeElementLayout (_tabview_scroll_button_layout);
00344 
00345     if (_visible_tab_content_layout)
00346     {
00347 //        _visible_tab_content_layout->SetGeometry(m_CompositionLayout->GetGeometry());
00348 //        GetWindowThread ()->ComputeElementLayout(_visible_tab_content_layout);
00349       _visible_tab_content_layout->QueueDraw();
00350     }
00351 
00352     return LayoutResult;
00353   }
00354 
00355   void TabView::PositionChildLayout (float offsetX, float offsetY)
00356   {
00357     if (m_CompositionLayout)
00358     {
00359       m_CompositionLayout->SetBaseX (GetBaseX() + TAB_X_BORDER);
00360       m_CompositionLayout->SetBaseY (GetBaseY() + TAB_HEIGHT);
00361       m_CompositionLayout->ComputePosition2 (offsetX, offsetY);
00362     }
00363   }
00364 
00365 
00366   void TabView::AddTab(const char *tab_name, Layout *tab_layout)
00367   {
00368     if (tab_layout == 0)
00369       return;
00370 
00371     TabElement *Tab = new TabElement (tab_name, tab_layout);
00372 
00373     Tab->SetIndex (_tab_array.size() );
00374 
00375     if (Tab->GetIndex() == 0)
00376     {
00377       m_FocusTabIndex = 0;
00378       _visible_tab_content_layout = Tab->_tab_content_layout;
00379       //_visible_tab_content_layout->SetGeometry(m_CompositionLayout->GetGeometry());
00380       SetCompositionLayout (_visible_tab_content_layout);
00381       GetWindowThread ()->ComputeElementLayout (this);
00382     }
00383 
00384     Tab->_tab_area->SetMinimumSize (6 + GetSysBoldFont()->GetStringWidth (tab_name), PRACTICAL_WIDGET_HEIGHT);
00385     Tab->_tab_area->SetMaximumSize (6 + GetSysBoldFont()->GetStringWidth (tab_name), PRACTICAL_WIDGET_HEIGHT);
00386 
00387     Tab->_tab_area->mouse_down.connect (sigc::bind ( sigc::mem_fun (this, &TabView::RecvTabMouseDown), Tab) );
00388     Tab->_tab_area->mouse_up.connect (sigc::bind ( sigc::mem_fun (this, &TabView::RecvTabMouseUp), Tab) );
00389 
00390     _tabview_heads_layout->AddView (Tab->_tab_area, 1, eCenter);
00391     GetWindowThread ()->ComputeElementLayout (_tabview_heads_layout);
00392 
00393     _tab_array.push_back (Tab);
00394   }
00395 
00396   void TabView::SetActiveTad (int index)
00397   {
00398     if (index >= (t_s32) _tab_array.size() )
00399     {
00400       m_FocusTabIndex = (t_s32) _tab_array.size() - 1;
00401     }
00402     else
00403     {
00404       m_FocusTabIndex = index;
00405     }
00406 
00407     _visible_tab_content_layout = _tab_array[m_FocusTabIndex]->_tab_content_layout;
00408 
00409     if (_visible_tab_content_layout)
00410       SetCompositionLayout (_visible_tab_content_layout);
00411 
00412     GetWindowThread ()->ComputeElementLayout (this);
00413 
00414     sigTabChanged (this);
00415     sigTabIndexChanged (m_FocusTabIndex);
00416 
00417     QueueDraw();
00418   }
00419 
00420   void TabView::TranslateLeft (int x, int y, unsigned long button_flags, unsigned long key_flags)
00421   {
00422     TranslateTabLayout (-5);
00423   }
00424 
00425   void TabView::TranslateRight (int x, int y, unsigned long button_flags, unsigned long key_flags)
00426   {
00427     TranslateTabLayout (5);
00428   }
00429 
00430   void TabView::TranslateTabLayout (int offset)
00431   {
00432 //    if((m_TabPositionOffset == 0) && (offset > 0))
00433 //        return;
00434 
00435     m_TabPositionOffset += offset;
00436     int lx = m_CompositionLayout->GetBaseX() + m_TabPositionOffset;
00437 
00438     if (lx > m_CompositionLayout->GetBaseX() )
00439     {
00440       // end of scroll left;
00441       m_TabPositionOffset = 0;
00442       lx = m_CompositionLayout->GetBaseX() + m_TabPositionOffset;
00443     }
00444 
00445     if (lx + _tabview_heads_layout->GetBaseWidth() < m_CompositionLayout->GetBaseX() +
00446         m_CompositionLayout->GetBaseWidth() - 2 * TAB_BUTTON_WIDTH)
00447     {
00448 
00449       lx = (m_CompositionLayout->GetBaseX() +
00450             m_CompositionLayout->GetBaseWidth() - 2 * TAB_BUTTON_WIDTH) - _tabview_heads_layout->GetBaseWidth();
00451 
00452 
00453       if (lx > m_CompositionLayout->GetBaseX() )
00454       {
00455         m_TabPositionOffset = 0;
00456         lx = m_CompositionLayout->GetBaseX() + m_TabPositionOffset;
00457       }
00458       else
00459         m_TabPositionOffset = - (m_CompositionLayout->GetBaseX() - lx);
00460     }
00461 
00462     _tabview_heads_layout->SetBaseX (lx);
00463     GetWindowThread ()->ComputeElementLayout (_tabview_heads_layout);
00464     QueueDraw();
00465 
00466   }
00467 
00468   void TabView::RecvTabMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags, TabElement *tab)
00469   {
00470     m_FocusTabIndex = tab->_index;
00471     _visible_tab_content_layout = tab->_tab_content_layout;
00472 
00473     if (_visible_tab_content_layout)
00474     {
00475       SetCompositionLayout (_visible_tab_content_layout);
00476     }
00477 
00478     //_visible_tab_content_layout->SetGeometry(m_CompositionLayout->GetGeometry());
00479 
00480     m_PreviousGeometry = GetGeometry();
00481 
00482     int PrevWidth = GetBaseWidth();
00483     int PrevHeight = GetBaseHeight();
00484 
00485     GetWindowThread ()->ComputeElementLayout (this, true);
00486 
00487 
00488     int NewWidth = GetBaseWidth();
00489     int NewHeight = GetBaseHeight();
00490 
00491     if ( (NewWidth != PrevWidth) ||
00492          (NewHeight != PrevHeight) )
00493     {
00494       // We need to draw the background on the previous size of the Table if its
00495       // size is set to match the content(IsSizeMatchContent) and an item is close.
00496       //m_PreviousGeometry;
00497       m_DrawBackgroundOnPreviousGeometry = true;
00498     }
00499 
00500     m_DrawBackgroundOnPreviousGeometry = true;
00501 
00502     sigTabChanged (this);
00503     sigTabIndexChanged (m_FocusTabIndex);
00504     QueueDraw();
00505   }
00506 
00507   void TabView::RecvTabMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags, TabElement *tab)
00508   {
00509 
00510   }
00511 
00512   void TabView::RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags)
00513   {
00514     QueueDraw();
00515   }
00516 
00517   void TabView::RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags)
00518   {
00519     QueueDraw();
00520   }
00521 
00522   void TabView::RecvTabRightMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
00523   {
00524     RecvTabRightTimerExpired (tabright_callback);
00525   }
00526 
00527   void TabView::RecvTabLeftMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags)
00528   {
00529     RecvTabLeftTimerExpired (tableft_callback);
00530   }
00531 
00532   void TabView::RecvTabButtonMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags)
00533   {
00534     if (m_TabRightTimerHandler.IsValid() )
00535       GetTimer().RemoveTimerHandler (m_TabRightTimerHandler);
00536 
00537     if (m_TabLeftTimerHandler.IsValid() )
00538       GetTimer().RemoveTimerHandler (m_TabLeftTimerHandler);
00539 
00540     m_TabRightTimerHandler = 0;
00541     m_TabLeftTimerHandler = 0;
00542   }
00543 
00544   void TabView::RecvTabRightTimerExpired (void *v)
00545   {
00546     TranslateTabLayout (-10);
00547     m_TabRightTimerHandler = GetTimer().AddTimerHandler (10, tabright_callback, this);
00548   }
00549 
00550   void TabView::RecvTabLeftTimerExpired (void *v)
00551   {
00552     TranslateTabLayout (10);
00553     m_TabLeftTimerHandler = GetTimer().AddTimerHandler (10, tableft_callback, this);
00554   }
00555 
00556   bool TabView::AcceptKeyNavFocus()
00557   {
00558     return false;
00559   }
00560 }
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends