]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/flatnotebook.py
Prevent seg fault for older GTK+
[wxWidgets.git] / wxPython / wx / lib / flatnotebook.py
index a5daebcdeba3c18781ad1809989ab5c13e3e58ec..214f6821c387a58af0f49dd9297917b1c7dc096b 100644 (file)
@@ -11,7 +11,7 @@
 # Python Code By:
 #
 # Andrea Gavana, @ 02 Oct 2006
 # Python Code By:
 #
 # Andrea Gavana, @ 02 Oct 2006
-# Latest Revision: 12 Oct 2006, 20.00 GMT
+# Latest Revision: 28 Jun 2007, 21.00 GMT
 #
 #
 # For All Kind Of Problems, Requests Of Enhancements And Bug Reports, Please
 #
 #
 # For All Kind Of Problems, Requests Of Enhancements And Bug Reports, Please
@@ -37,7 +37,7 @@ Some features:
   - The scrolling is done for bulks of tabs (so, the scrolling is faster and better)
   - The buttons area is never overdrawn by tabs (unlike many other implementations I saw)
   - It is a generic control
   - The scrolling is done for bulks of tabs (so, the scrolling is faster and better)
   - The buttons area is never overdrawn by tabs (unlike many other implementations I saw)
   - It is a generic control
-  - Currently there are 4 differnt styles - VC8, VC 71, Standard and Fancy
+  - Currently there are 5 differnt styles - VC8, VC 71, Standard, Fancy and Firefox 2;
   - Mouse middle click can be used to close tabs
   - A function to add right click menu for tabs (simple as SetRightClickMenu)
   - All styles has bottom style as well (they can be drawn in the bottom of screen)
   - Mouse middle click can be used to close tabs
   - A function to add right click menu for tabs (simple as SetRightClickMenu)
   - All styles has bottom style as well (they can be drawn in the bottom of screen)
@@ -58,9 +58,9 @@ License And Version:
 
 FlatNotebook Is Freeware And Distributed Under The wxPython License. 
 
 
 FlatNotebook Is Freeware And Distributed Under The wxPython License. 
 
-Latest Revision: Andrea Gavana @ 12 Oct 2006, 20.00 GMT
+Latest Revision: Andrea Gavana @ 28 Jun 2007, 21.00 GMT
 
 
-Version 2.0.
+Version 2.2.
 
 @undocumented: FNB_HEIGHT_SPACER, VERTICAL_BORDER_PADDING, VC8_SHAPE_LEN,
     wxEVT*, left_arrow_*, right_arrow*, x_button*, down_arrow*,
 
 @undocumented: FNB_HEIGHT_SPACER, VERTICAL_BORDER_PADDING, VC8_SHAPE_LEN,
     wxEVT*, left_arrow_*, right_arrow*, x_button*, down_arrow*,
@@ -123,6 +123,10 @@ FNB_NODRAG = 128
 FNB_VC8 = 256
 """Use Visual Studio 2005 (VC8) style for tabs"""
 
 FNB_VC8 = 256
 """Use Visual Studio 2005 (VC8) style for tabs"""
 
+# Firefox 2 tabs style
+FNB_FF2 = 131072
+"""Use Firefox 2 style for tabs"""
+
 # Place 'X' on a tab
 FNB_X_ON_TAB = 512
 """Place 'X' close button on the active tab"""
 # Place 'X' on a tab
 FNB_X_ON_TAB = 512
 """Place 'X' close button on the active tab"""
@@ -716,6 +720,61 @@ def PaintStraightGradientBox(dc, rect, startColor, endColor, vertical=True):
     dc.SetBrush(savedBrush)
 
 
     dc.SetBrush(savedBrush)
 
 
+
+# -----------------------------------------------------------------------------
+# Util functions
+# -----------------------------------------------------------------------------
+
+def DrawButton(dc, rect, focus, upperTabs):
+
+    # Define the rounded rectangle base on the given rect
+    # we need an array of 9 points for it
+    regPts = [wx.Point() for indx in xrange(9)]
+
+    if focus:
+        if upperTabs:
+            leftPt = wx.Point(rect.x, rect.y + (rect.height / 10)*8)
+            rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 10)*8)
+        else:
+            leftPt = wx.Point(rect.x, rect.y + (rect.height / 10)*5)
+            rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 10)*5)
+    else:
+        leftPt = wx.Point(rect.x, rect.y + (rect.height / 2))
+        rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 2))
+
+    # Define the top region
+    top = wx.RectPP(rect.GetTopLeft(), rightPt)
+    bottom = wx.RectPP(leftPt, rect.GetBottomRight())
+
+    topStartColor = wx.WHITE
+
+    if not focus:
+        topStartColor = LightColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE), 50)
+
+    topEndColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)
+    bottomStartColor = topEndColor
+    bottomEndColor = topEndColor
+
+    # Incase we use bottom tabs, switch the colors
+    if upperTabs:
+        if focus:
+            PaintStraightGradientBox(dc, top, topStartColor, topEndColor)
+            PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor)
+        else:
+            PaintStraightGradientBox(dc, top, topEndColor , topStartColor)
+            PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor)
+
+    else:
+        if focus:
+            PaintStraightGradientBox(dc, bottom, topEndColor, bottomEndColor)
+            PaintStraightGradientBox(dc, top,topStartColor,  topStartColor)
+        else:
+            PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor)
+            PaintStraightGradientBox(dc, top, topEndColor, topStartColor)
+    
+    dc.SetBrush(wx.TRANSPARENT_BRUSH)
+
+
 # ---------------------------------------------------------------------------- #
 # Class FNBDropSource
 # Gives Some Custom UI Feedback during the DnD Operations
 # ---------------------------------------------------------------------------- #
 # Class FNBDropSource
 # Gives Some Custom UI Feedback during the DnD Operations
@@ -833,6 +892,7 @@ class PageInfo:
         self._region = wx.Region()
         self._xRect = wx.Rect()
         self._color = None
         self._region = wx.Region()
         self._xRect = wx.Rect()
         self._color = None
+        self._hasFocus = False
 
 
     def SetCaption(self, value):
 
 
     def SetCaption(self, value):
@@ -901,7 +961,7 @@ class PageInfo:
         return self._bEnabled 
 
 
         return self._bEnabled 
 
 
-    def Enable(self, enabled):
+    def EnableTab(self, enabled):
         """ Sets the tab enabled or disabled. """
 
         self._bEnabled = enabled 
         """ Sets the tab enabled or disabled. """
 
         self._bEnabled = enabled 
@@ -1148,7 +1208,7 @@ class TabNavigatorWindow(wx.Dialog):
     def OnItemSelected(self, event):
         """Handles the wx.EVT_LISTBOX_DCLICK event for the wx.ListBox inside L{TabNavigatorWindow}. """
 
     def OnItemSelected(self, event):
         """Handles the wx.EVT_LISTBOX_DCLICK event for the wx.ListBox inside L{TabNavigatorWindow}. """
 
-       self.CloseDialog()
+        self.CloseDialog()
 
 
     def CloseDialog(self):
 
 
     def CloseDialog(self):
@@ -1224,6 +1284,13 @@ class FNBRenderer:
         self._rightBgBmp = wx.EmptyBitmap(16, 14)
         self._tabHeight = None
 
         self._rightBgBmp = wx.EmptyBitmap(16, 14)
         self._tabHeight = None
 
+        if wx.Platform == "__WXMAC__":
+            self._focusPen = wx.Pen(wx.BLACK, 1, wx.SOLID)
+        else:
+            self._focusPen = wx.Pen(wx.BLACK, 1, wx.USER_DASH)
+            self._focusPen.SetDashes([1, 1])
+            self._focusPen.SetCap(wx.CAP_BUTT)
+
 
     def GetLeftButtonPos(self, pageContainer):
         """ Returns the left button position in the navigation area. """
 
     def GetLeftButtonPos(self, pageContainer):
         """ Returns the left button position in the navigation area. """
@@ -1400,7 +1467,7 @@ class FNBRenderer:
 
         # erase old bitmap
         posx = self.GetDropArrowButtonPos(pc)
 
         # erase old bitmap
         posx = self.GetDropArrowButtonPos(pc)
-        dc.DrawBitmap(self._xBgBmp, posx, 6)
+        dc.DrawBitmap(self._rightBgBmp, posx, 6)
 
         # Draw the new bitmap
         dc.DrawBitmap(downBmp, posx, 6, True)
 
         # Draw the new bitmap
         dc.DrawBitmap(downBmp, posx, 6, True)
@@ -1481,7 +1548,7 @@ class FNBRenderer:
         return bmp
 
 
         return bmp
 
 
-    def DrawTabsLine(self, pageContainer, dc):
+    def DrawTabsLine(self, pageContainer, dc, selTabX1=-1, selTabX2=-1):
         """ Draws a line over the tabs. """
 
         pc = pageContainer
         """ Draws a line over the tabs. """
 
         pc = pageContainer
@@ -1489,38 +1556,70 @@ class FNBRenderer:
         clntRect = pc.GetClientRect()
         clientRect3 = wx.Rect(0, 0, clntRect.width, clntRect.height)
 
         clntRect = pc.GetClientRect()
         clientRect3 = wx.Rect(0, 0, clntRect.width, clntRect.height)
 
-        if pc.HasFlag(FNB_BOTTOM):
-        
-            clientRect = wx.Rect(0, 2, clntRect.width, clntRect.height - 2)
-            clientRect2 = wx.Rect(0, 1, clntRect.width, clntRect.height - 1)
-        
-        else:
-        
-            clientRect = wx.Rect(0, 0, clntRect.width, clntRect.height - 2)
-            clientRect2 = wx.Rect(0, 0, clntRect.width, clntRect.height - 1)
-        
-        dc.SetBrush(wx.TRANSPARENT_BRUSH)
-        dc.SetPen(wx.Pen(pc.GetSingleLineBorderColour()))
-        dc.DrawRectangleRect(clientRect2)
-        dc.DrawRectangleRect(clientRect3)
+        if pc.HasFlag(FNB_FF2):
+            if not pc.HasFlag(FNB_BOTTOM):
+                fillColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)
+            else:
+                fillColor = wx.WHITE
 
 
-        dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
-        dc.DrawRectangleRect(clientRect)
+            dc.SetPen(wx.Pen(fillColor))
 
 
-        if not pc.HasFlag(FNB_TABS_BORDER_SIMPLE):
-        
-            dc.SetPen(wx.Pen((pc.HasFlag(FNB_VC71) and [wx.Colour(247, 243, 233)] or [pc._tabAreaColor])[0]))
-            dc.DrawLine(0, 0, 0, clientRect.height+1)
+            if pc.HasFlag(FNB_BOTTOM):
+
+                dc.DrawLine(1, 0, clntRect.width-1, 0)
+                dc.DrawLine(1, 1, clntRect.width-1, 1)
+
+                dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
+                dc.DrawLine(1, 2, clntRect.width-1, 2)
+
+                dc.SetPen(wx.Pen(fillColor))
+                dc.DrawLine(selTabX1 + 2, 2, selTabX2 - 1, 2)
+                
+            else:
+                
+                dc.DrawLine(1, clntRect.height, clntRect.width-1, clntRect.height)
+                dc.DrawLine(1, clntRect.height-1, clntRect.width-1, clntRect.height-1)
+
+                dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
+                dc.DrawLine(1, clntRect.height-2, clntRect.width-1, clntRect.height-2)
+
+                dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)))
+                dc.DrawLine(selTabX1 + 2, clntRect.height-2, selTabX2-1, clntRect.height-2)
+
+        else:
             
             if pc.HasFlag(FNB_BOTTOM):
             
             
             if pc.HasFlag(FNB_BOTTOM):
             
-                dc.DrawLine(0, clientRect.height+1, clientRect.width, clientRect.height+1)
+                clientRect = wx.Rect(0, 2, clntRect.width, clntRect.height - 2)
+                clientRect2 = wx.Rect(0, 1, clntRect.width, clntRect.height - 1)
             
             else:
             
             else:
+            
+                clientRect = wx.Rect(0, 0, clntRect.width, clntRect.height - 2)
+                clientRect2 = wx.Rect(0, 0, clntRect.width, clntRect.height - 1)
+            
+            dc.SetBrush(wx.TRANSPARENT_BRUSH)
+            dc.SetPen(wx.Pen(pc.GetSingleLineBorderColour()))
+            dc.DrawRectangleRect(clientRect2)
+            dc.DrawRectangleRect(clientRect3)
+
+            dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
+            dc.DrawRectangleRect(clientRect)
+
+            if not pc.HasFlag(FNB_TABS_BORDER_SIMPLE):
+            
+                dc.SetPen(wx.Pen((pc.HasFlag(FNB_VC71) and [wx.Colour(247, 243, 233)] or [pc._tabAreaColor])[0]))
+                dc.DrawLine(0, 0, 0, clientRect.height+1)
+                
+                if pc.HasFlag(FNB_BOTTOM):
                 
                 
-                dc.DrawLine(0, 0, clientRect.width, 0)
+                    dc.DrawLine(0, clientRect.height+1, clientRect.width, clientRect.height+1)
                 
                 
-            dc.DrawLine(clientRect.width - 1, 0, clientRect.width - 1, clientRect.height+1)
+                else:
+                    
+                    dc.DrawLine(0, 0, clientRect.width, 0)
+                    
+                dc.DrawLine(clientRect.width - 1, 0, clientRect.width - 1, clientRect.height+1)
 
 
     def CalcTabWidth(self, pageContainer, tabIdx, tabHeight):
 
 
     def CalcTabWidth(self, pageContainer, tabIdx, tabHeight):
@@ -1650,7 +1749,12 @@ class FNBRenderer:
         else:
             colr = (pc.HasFlag(FNB_VC71) and [wx.Colour(247, 243, 233)] or [pc.GetBackgroundColour()])[0]
             dc.SetPen(wx.Pen(colr))
         else:
             colr = (pc.HasFlag(FNB_VC71) and [wx.Colour(247, 243, 233)] or [pc.GetBackgroundColour()])[0]
             dc.SetPen(wx.Pen(colr))
-        
+
+        if pc.HasFlag(FNB_FF2):
+            lightFactor = (pc.HasFlag(FNB_BACKGROUND_GRADIENT) and [70] or [0])[0]
+            PaintStraightGradientBox(dc, pc.GetClientRect(), pc._tabAreaColor, LightColour(pc._tabAreaColor, lightFactor))
+            dc.SetBrush(wx.TRANSPARENT_BRUSH)
+
         dc.DrawRectangle(0, 0, size.x, size.y)
 
         # Take 3 bitmaps for the background for the buttons
         dc.DrawRectangle(0, 0, size.x, size.y)
 
         # Take 3 bitmaps for the background for the buttons
@@ -1683,7 +1787,9 @@ class FNBRenderer:
         # We always draw the bottom/upper line of the tabs
         # regradless the style
         dc.SetPen(borderPen)
         # We always draw the bottom/upper line of the tabs
         # regradless the style
         dc.SetPen(borderPen)
-        self.DrawTabsLine(pc, dc)
+
+        if not pc.HasFlag(FNB_FF2):
+            self.DrawTabsLine(pc, dc)
 
         # Restore the pen
         dc.SetPen(borderPen)
 
         # Restore the pen
         dc.SetPen(borderPen)
@@ -1727,10 +1833,13 @@ class FNBRenderer:
         #----------------------------------------------------------
         # Go over and draw the visible tabs
         #----------------------------------------------------------
         #----------------------------------------------------------
         # Go over and draw the visible tabs
         #----------------------------------------------------------
+        x1 = x2 = -1
         for i in xrange(pc._nFrom, len(pc._pagesInfoVec)):
         
             dc.SetPen(borderPen)
         for i in xrange(pc._nFrom, len(pc._pagesInfoVec)):
         
             dc.SetPen(borderPen)
-            dc.SetBrush((i==pc.GetSelection() and [selBrush] or [noselBrush])[0])
+
+            if not pc.HasFlag(FNB_FF2):
+                dc.SetBrush((i==pc.GetSelection() and [selBrush] or [noselBrush])[0])
 
             # Now set the font to the correct font
             dc.SetFont((i==pc.GetSelection() and [boldFont] or [normalFont])[0])
 
             # Now set the font to the correct font
             dc.SetFont((i==pc.GetSelection() and [boldFont] or [normalFont])[0])
@@ -1759,6 +1868,10 @@ class FNBRenderer:
             # Draw the tab (border, text, image & 'x' on tab)
             self.DrawTab(pc, dc, posx, i, tabWidth, tabHeight, pc._nTabXButtonStatus)
 
             # Draw the tab (border, text, image & 'x' on tab)
             self.DrawTab(pc, dc, posx, i, tabWidth, tabHeight, pc._nTabXButtonStatus)
 
+            if pc.GetSelection() == i:
+                x1 = posx
+                x2 = posx + tabWidth + 2
+
             # Restore the text forground
             dc.SetTextForeground(pc._activeTextColor)
 
             # Restore the text forground
             dc.SetTextForeground(pc._activeTextColor)
 
@@ -1767,6 +1880,8 @@ class FNBRenderer:
 
             pc._pagesInfoVec[i].SetPosition(wx.Point(posx, posy))
             pc._pagesInfoVec[i].SetSize(wx.Size(tabWidth, tabHeight))
 
             pc._pagesInfoVec[i].SetPosition(wx.Point(posx, posy))
             pc._pagesInfoVec[i].SetSize(wx.Size(tabWidth, tabHeight))
+            self.DrawFocusRectangle(dc, pc, pc._pagesInfoVec[i])
+
             posx += tabWidth
         
         # Update all tabs that can not fit into the screen as non-visible
             posx += tabWidth
         
         # Update all tabs that can not fit into the screen as non-visible
@@ -1781,6 +1896,28 @@ class FNBRenderer:
         self.DrawX(pc, dc)
         self.DrawDropDownArrow(pc, dc)
 
         self.DrawX(pc, dc)
         self.DrawDropDownArrow(pc, dc)
 
+        if pc.HasFlag(FNB_FF2):
+            self.DrawTabsLine(pc, dc, x1, x2)
+
+
+    def DrawFocusRectangle(self, dc, pageContainer, page):
+        """ Draws a focus rectangle like the native Notebooks. """
+        
+        if not page._hasFocus:
+            return
+
+        tabPos = page.GetPosition()
+        if pageContainer.GetParent().GetWindowStyleFlag() & FNB_VC8:
+            vc8ShapeLen = self.CalcTabHeight(pageContainer) - VERTICAL_BORDER_PADDING - 2
+            tabPos.x += vc8ShapeLen
+            
+        rect = wx.RectPS(tabPos, page.GetSize())
+        rect = wx.Rect(rect.x+2, rect.y+2, rect.width-4, rect.height-8)
+        
+        dc.SetBrush(wx.TRANSPARENT_BRUSH)
+        dc.SetPen(self._focusPen)
+        dc.DrawRoundedRectangleRect(rect, 2)
+        
 
     def DrawDragHint(self, pc, tabIdx):
         """
 
     def DrawDragHint(self, pc, tabIdx):
         """
@@ -1846,16 +1983,12 @@ class FNBRendererMgr:
         self._renderers.update({FNB_VC71: FNBRendererVC71()})
         self._renderers.update({FNB_FANCY_TABS: FNBRendererFancy()})
         self._renderers.update({FNB_VC8: FNBRendererVC8()})
         self._renderers.update({FNB_VC71: FNBRendererVC71()})
         self._renderers.update({FNB_FANCY_TABS: FNBRendererFancy()})
         self._renderers.update({FNB_VC8: FNBRendererVC8()})
+        self._renderers.update({FNB_FF2: FNBRendererFirefox2()})
 
 
     def GetRenderer(self, style):
         """ Returns the current renderer based on the style selected. """
 
 
 
     def GetRenderer(self, style):
         """ Returns the current renderer based on the style selected. """
 
-        # since we dont have a style for default tabs, we 
-        # test for all others - FIXME: add style for default tabs
-        if not style & FNB_VC71 and not style & FNB_VC8 and not style & FNB_FANCY_TABS:
-            return self._renderers[-1]
-
         if style & FNB_VC71:
             return self._renderers[FNB_VC71]
 
         if style & FNB_VC71:
             return self._renderers[FNB_VC71]
 
@@ -1865,6 +1998,9 @@ class FNBRendererMgr:
         if style & FNB_VC8:
             return self._renderers[FNB_VC8]
 
         if style & FNB_VC8:
             return self._renderers[FNB_VC8]
 
+        if style & FNB_FF2:
+            return self._renderers[FNB_FF2]
+
         # the default is to return the default renderer
         return self._renderers[-1]
 
         # the default is to return the default renderer
         return self._renderers[-1]
 
@@ -1992,6 +2128,106 @@ class FNBRendererDefault(FNBRenderer):
             self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)            
         
 
             self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)            
         
 
+#------------------------------------------
+# Firefox2 renderer 
+#------------------------------------------
+class FNBRendererFirefox2(FNBRenderer):
+    """
+    This class handles the drawing of tabs using the I{Firefox 2} renderer.
+    """
+    
+    def __init__(self):
+        """ Default class constructor. """
+
+        FNBRenderer.__init__(self)
+
+        
+    def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
+        """ Draws a tab using the I{Firefox 2} style. """
+
+        borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
+        pc = pageContainer
+
+        tabPoints = [wx.Point() for indx in xrange(7)]
+        tabPoints[0].x = posx + 2
+        tabPoints[0].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0]
+
+        tabPoints[1].x = tabPoints[0].x
+        tabPoints[1].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
+
+        tabPoints[2].x = tabPoints[1].x+2
+        tabPoints[2].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
+
+        tabPoints[3].x = posx + tabWidth - 2
+        tabPoints[3].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
+
+        tabPoints[4].x = tabPoints[3].x + 2
+        tabPoints[4].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
+
+        tabPoints[5].x = tabPoints[4].x
+        tabPoints[5].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0]
+
+        tabPoints[6].x = tabPoints[0].x
+        tabPoints[6].y = tabPoints[0].y
+
+        #------------------------------------
+        # Paint the tab with gradient
+        #------------------------------------
+        rr = wx.RectPP(tabPoints[2], tabPoints[5])
+        DrawButton(dc, rr, pc.GetSelection() == tabIdx , not pc.HasFlag(FNB_BOTTOM))
+
+        dc.SetBrush(wx.TRANSPARENT_BRUSH)
+        dc.SetPen(borderPen)
+
+        # Draw the tab as rounded rectangle
+        dc.DrawPolygon(tabPoints)
+
+        # -----------------------------------
+        # Text and image drawing
+        # -----------------------------------
+
+        # The width of the images are 16 pixels
+        padding = pc.GetParent().GetPadding()
+        shapePoints = int(tabHeight*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))
+        hasImage = pc._pagesInfoVec[tabIdx].GetImageIndex() != -1
+        imageYCoord = (pc.HasFlag(FNB_BOTTOM) and [6] or [8])[0]
+
+        if hasImage:
+            textOffset = 2*padding + 16 + shapePoints/2 
+        else:
+            textOffset = padding + shapePoints/2
+            
+        textOffset += 2
+
+        if tabIdx != pc.GetSelection():
+        
+            # Set the text background to be like the vertical lines
+            dc.SetTextForeground(pc._pParent.GetNonActiveTabTextColour())
+
+        if hasImage:
+            imageXOffset = textOffset - 16 - padding
+            pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc,
+                               posx + imageXOffset, imageYCoord,
+                               wx.IMAGELIST_DRAW_TRANSPARENT, True)
+        
+        dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
+
+        # draw 'x' on tab (if enabled)
+        if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
+        
+            textWidth, textHeight = dc.GetTextExtent(pc.GetPageText(tabIdx))
+            tabCloseButtonXCoord = posx + textOffset + textWidth + 1
+
+            # take a bitmap from the position of the 'x' button (the x on tab button)
+            # this bitmap will be used later to delete old buttons
+            tabCloseButtonYCoord = imageYCoord
+            x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16)
+            self._tabXBgBmp = self._GetBitmap(dc, x_rect, self._tabXBgBmp)
+
+            # Draw the tab
+            self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
+        
+
 #------------------------------------------------------------------
 # Visual studio 7.1 
 #------------------------------------------------------------------
 #------------------------------------------------------------------
 # Visual studio 7.1 
 #------------------------------------------------------------------
@@ -2529,6 +2765,8 @@ class FNBRendererVC8(FNBRenderer):
             # Draw the tab
             self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
 
             # Draw the tab
             self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
 
+        self.DrawFocusRectangle(dc, pc, pc._pagesInfoVec[tabIdx])
+
 
     def FillVC8GradientColour(self, pageContainer, dc, tabPoints, bSelectedTab, tabIdx):
         """ Fills a tab with a gradient shading. """
 
     def FillVC8GradientColour(self, pageContainer, dc, tabPoints, bSelectedTab, tabIdx):
         """ Fills a tab with a gradient shading. """
@@ -2768,7 +3006,7 @@ class FNBRendererVC8(FNBRenderer):
 # Class FlatNotebook
 # ---------------------------------------------------------------------------- #
 
 # Class FlatNotebook
 # ---------------------------------------------------------------------------- #
 
-class FlatNotebook(wx.Panel):
+class FlatNotebook(wx.PyPanel):
     """
     Display one or more windows in a notebook.
     
     """
     Display one or more windows in a notebook.
     
@@ -2804,7 +3042,7 @@ class FlatNotebook(wx.Panel):
         self._windows = []
         self._popupWin = None
 
         self._windows = []
         self._popupWin = None
 
-        wx.Panel.__init__(self, parent, id, pos, size, style)
+        wx.PyPanel.__init__(self, parent, id, pos, size, style)
         
         self._pages = PageContainer(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, style)
 
         
         self._pages = PageContainer(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, style)
 
@@ -2852,6 +3090,24 @@ class FlatNotebook(wx.Panel):
         self.SetDropTarget(self._pDropTarget)
 
 
         self.SetDropTarget(self._pDropTarget)
 
 
+    def DoGetBestSize(self):
+        """ Overrides DoGetBestSize to handle sizers nicely. """
+
+        if not self._windows:
+            # Something is better than nothing... no pages!
+            return wx.Size(20, 20)
+
+        maxWidth = maxHeight = 0
+        tabHeight = self.GetPageBestSize().height
+
+        for win in self._windows:
+            # Loop over all the windows to get their best size
+            width, height = win.GetBestSize()
+            maxWidth, maxHeight = max(maxWidth, width), max(maxHeight, height)
+
+        return wx.Size(maxWidth, maxHeight+tabHeight)
+    
+
     def SetActiveTabTextColour(self, textColour):
         """ Sets the text colour for the active tab. """
 
     def SetActiveTabTextColour(self, textColour):
         """ Sets the text colour for the active tab. """
 
@@ -3146,6 +3402,7 @@ class FlatNotebook(wx.Panel):
 
         self._pages.DoDeletePage(page)
         self.Refresh()
 
         self._pages.DoDeletePage(page)
         self.Refresh()
+        self.Update()  
 
         # Fire a closed event
         closedEvent = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CLOSED, self.GetId())
 
         # Fire a closed event
         closedEvent = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CLOSED, self.GetId())
@@ -3243,11 +3500,9 @@ class FlatNotebook(wx.Panel):
             else:
                 # change pages
                 self.AdvanceSelection(event.GetDirection())
             else:
                 # change pages
                 self.AdvanceSelection(event.GetDirection())
+
         else:
         else:
-            # pass to the parent
-            if self.GetParent():
-                event.SetCurrentFocus(self)
-                self.GetParent().ProcessEvent(event)
+            event.Skip()
             
 
     def GetPageShapeAngle(self, page_index):
             
 
     def GetPageShapeAngle(self, page_index):
@@ -3323,7 +3578,7 @@ class FlatNotebook(wx.Panel):
     def SetWindowStyleFlag(self, style):
         """ Sets the L{FlatNotebook} window style flags. """
             
     def SetWindowStyleFlag(self, style):
         """ Sets the L{FlatNotebook} window style flags. """
             
-        wx.Panel.SetWindowStyleFlag(self, style)
+        wx.PyPanel.SetWindowStyleFlag(self, style)
         renderer = self._pages._mgr.GetRenderer(self.GetWindowStyleFlag())
         renderer._tabHeight = None
 
         renderer = self._pages._mgr.GetRenderer(self.GetWindowStyleFlag())
         renderer._tabHeight = None
 
@@ -3465,14 +3720,14 @@ class FlatNotebook(wx.Panel):
         return self._pages.GetEnabled(page)
 
 
         return self._pages.GetEnabled(page)
 
 
-    def Enable(self, page, enabled=True):
+    def EnableTab(self, page, enabled=True):
         """ Enables or disables a tab. """
 
         if page >= len(self._windows):
             return
 
         self._windows[page].Enable(enabled)
         """ Enables or disables a tab. """
 
         if page >= len(self._windows):
             return
 
         self._windows[page].Enable(enabled)
-        self._pages.Enable(page, enabled)
+        self._pages.EnableTab(page, enabled)
 
 
     def GetNonActiveTabTextColour(self):
 
 
     def GetNonActiveTabTextColour(self):
@@ -3545,7 +3800,7 @@ class PageContainer(wx.Panel):
         self._colorFrom = wx.WHITE
         self._activeTabColor = wx.WHITE
         self._activeTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNTEXT)
         self._colorFrom = wx.WHITE
         self._activeTabColor = wx.WHITE
         self._activeTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNTEXT)
-        self._nonActiveTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)
+        self._nonActiveTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNTEXT)
         self._tabAreaColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE)
 
         self._nFrom = 0
         self._tabAreaColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE)
 
         self._nFrom = 0
@@ -3564,7 +3819,7 @@ class PageContainer(wx.Panel):
         tabHeight = height + FNB_HEIGHT_SPACER # We use 10 pixels as padding
 
         wx.Panel.__init__(self, parent, id, pos, wx.Size(size.x, tabHeight),
         tabHeight = height + FNB_HEIGHT_SPACER # We use 10 pixels as padding
 
         wx.Panel.__init__(self, parent, id, pos, wx.Size(size.x, tabHeight),
-                          style|wx.NO_BORDER|wx.NO_FULL_REPAINT_ON_RESIZE)
+                          style|wx.NO_BORDER|wx.NO_FULL_REPAINT_ON_RESIZE|wx.WANTS_CHARS)
 
         self._pDropTarget = FNBDropTarget(self)
         self.SetDropTarget(self._pDropTarget)
 
         self._pDropTarget = FNBDropTarget(self)
         self.SetDropTarget(self._pDropTarget)
@@ -3581,7 +3836,10 @@ class PageContainer(wx.Panel):
         self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
         self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnterWindow)
         self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick)
         self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
         self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnterWindow)
         self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick)
-
+        self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
+        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
+        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
+        
 
     def OnEraseBackground(self, event):
         """ Handles the wx.EVT_ERASE_BACKGROUND event for L{PageContainer} (does nothing)."""
 
     def OnEraseBackground(self, event):
         """ Handles the wx.EVT_ERASE_BACKGROUND event for L{PageContainer} (does nothing)."""
@@ -3758,58 +4016,60 @@ class PageContainer(wx.Panel):
                     self.FireEvent(tabIdx)
 
 
                     self.FireEvent(tabIdx)
 
 
-    def OnLeftUp(self, event):
-        """ Handles the wx.EVT_LEFT_UP events for L{PageContainer}. """
+    def RotateLeft(self):
 
 
-        # forget the zone that was initially clicked
-        self._nLeftClickZone = FNB_NOWHERE
+        if self._nFrom == 0:
+            return
 
 
-        where, tabIdx = self.HitTest(event.GetPosition())
-        
-        if where == FNB_LEFT_ARROW:
-            
-            if self._nFrom == 0:
-                return
+        # Make sure that the button was pressed before
+        if self._nLeftButtonStatus != FNB_BTN_PRESSED:
+            return
 
 
-            # Make sure that the button was pressed before
-            if self._nLeftButtonStatus != FNB_BTN_PRESSED:
-                return
+        self._nLeftButtonStatus = FNB_BTN_HOVER
 
 
-            self._nLeftButtonStatus = FNB_BTN_HOVER
+        # We scroll left with bulks of 5
+        scrollLeft = self.GetNumTabsCanScrollLeft()
 
 
-            # We scroll left with bulks of 5
-            scrollLeft = self.GetNumTabsCanScrollLeft()
+        self._nFrom -= scrollLeft
+        if self._nFrom < 0:
+            self._nFrom = 0
 
 
-            self._nFrom -= scrollLeft
-            if self._nFrom < 0:
-                self._nFrom = 0
+        self.Refresh()
 
 
-            self.Refresh()
-            
-        elif where == FNB_RIGHT_ARROW:
-            
-            if self._nFrom >= len(self._pagesInfoVec) - 1:
-                return
 
 
-            # Make sure that the button was pressed before
-            if self._nRightButtonStatus != FNB_BTN_PRESSED:
-                return
+    def RotateRight(self):
 
 
-            self._nRightButtonStatus = FNB_BTN_HOVER
+        if self._nFrom >= len(self._pagesInfoVec) - 1:
+            return
 
 
-            # Check if the right most tab is visible, if it is
-            # don't rotate right anymore
-            if self._pagesInfoVec[-1].GetPosition() != wx.Point(-1, -1):
-                return
+        # Make sure that the button was pressed before
+        if self._nRightButtonStatus != FNB_BTN_PRESSED:
+            return
 
 
-            lastVisibleTab = self.GetLastVisibleTab()
-            if lastVisibleTab < 0:
-                # Probably the screen is too small for displaying even a single
-                # tab, in this case we do nothing
-                return
+        self._nRightButtonStatus = FNB_BTN_HOVER
 
 
-            self._nFrom += self.GetNumOfVisibleTabs()
-            self.Refresh()
+        # Check if the right most tab is visible, if it is
+        # don't rotate right anymore
+        if self._pagesInfoVec[len(self._pagesInfoVec)-1].GetPosition() != wx.Point(-1, -1):
+            return
+
+        self._nFrom += 1
+        self.Refresh()
+
+
+    def OnLeftUp(self, event):
+        """ Handles the wx.EVT_LEFT_UP events for L{PageContainer}. """
+
+        # forget the zone that was initially clicked
+        self._nLeftClickZone = FNB_NOWHERE
+
+        where, tabIdx = self.HitTest(event.GetPosition())
+        
+        if where == FNB_LEFT_ARROW:
+            self.RotateLeft()
+            
+        elif where == FNB_RIGHT_ARROW:
+            self.RotateRight()
             
         elif where == FNB_X:
             
             
         elif where == FNB_X:
             
@@ -3846,6 +4106,8 @@ class PageContainer(wx.Panel):
 
             self.PopupTabsMenu()
 
 
             self.PopupTabsMenu()
 
+        event.Skip()
+        
 
     def HitTest(self, pt):
         """
 
     def HitTest(self, pt):
         """
@@ -4144,7 +4406,7 @@ class PageContainer(wx.Panel):
                 dc = wx.ClientDC(self)
                 
                 if bRedrawX:
                 dc = wx.ClientDC(self)
                 
                 if bRedrawX:
-                
+                                
                     render.DrawX(self, dc)
                 
                 if bRedrawLeft:
                     render.DrawX(self, dc)
                 
                 if bRedrawLeft:
@@ -4157,7 +4419,7 @@ class PageContainer(wx.Panel):
                 
                 if bRedrawTabX:
                 
                 
                 if bRedrawTabX:
                 
-                    render.DrawTabX(self, dc, self._pagesInfoVec[tabIdx].GetXRect(), tabIdx, self._nTabXButtonStatus)
+                    self.Refresh()
 
                 if bRedrawDropArrow:
 
 
                 if bRedrawDropArrow:
 
@@ -4185,66 +4447,10 @@ class PageContainer(wx.Panel):
     def GetNumTabsCanScrollLeft(self):
         """ Returns the number of tabs than can be scrolled left. """
 
     def GetNumTabsCanScrollLeft(self):
         """ Returns the number of tabs than can be scrolled left. """
 
-        # Reserved area for the buttons (<>x)
-        rect = self.GetClientRect()
-        clientWidth = rect.width
-        posx = self._pParent._nPadding
-        numTabs = 0
-        pom = 0
-        
-        # In case we have error prevent crash
-        if self._nFrom < 0:
-            return 0
-
-        dc = wx.ClientDC(self)
-
-        style = self.GetParent().GetWindowStyleFlag()
-        render = self._mgr.GetRenderer(style)
-        
-        for ii in xrange(self._nFrom, -1, -1):
-
-            boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)        
-            boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
-            dc.SetFont(boldFont)
-
-            height = dc.GetCharHeight()
-
-            tabHeight = height + FNB_HEIGHT_SPACER # We use 6 pixels as padding
-            if style & FNB_VC71:
-                tabHeight = (style & FNB_BOTTOM and [tabHeight - 4] or [tabHeight])[0]
-            elif style & FNB_FANCY_TABS:
-                tabHeight = (style & FNB_BOTTOM and [tabHeight - 3] or [tabHeight])[0]
-
-            width, pom = dc.GetTextExtent(self.GetPageText(ii))
-            if style != FNB_VC71:
-                shapePoints = int(tabHeight*math.tan(float(self._pagesInfoVec[ii].GetTabAngle())/180.0*math.pi))
-            else:
-                shapePoints = 0
-
-            tabWidth = 2*self._pParent._nPadding + width
-            
-            if not (style & FNB_VC71):
-                # Default style
-                tabWidth += 2*shapePoints
-
-            hasImage = self._ImageList != None and self._pagesInfoVec[ii].GetImageIndex() != -1
-
-            # For VC71 style, we only add the icon size (16 pixels)
-            if hasImage:
-            
-                if not self.IsDefaultTabs():
-                    tabWidth += 16 + self._pParent._nPadding
-                else:
-                    # Default style
-                    tabWidth += 16 + self._pParent._nPadding + shapePoints/2
-            
-            if posx + tabWidth + render.GetButtonsAreaLength(self) >= clientWidth:
-                break
+        if self._nFrom - 1 >= 0:
+            return 1
 
 
-            numTabs = numTabs + 1
-            posx += tabWidth
-        
-        return numTabs
+        return 0
 
 
     def IsDefaultTabs(self):
 
 
     def IsDefaultTabs(self):
@@ -4507,13 +4713,13 @@ class PageContainer(wx.Panel):
         return self._pagesInfoVec[page].GetEnabled()
 
 
         return self._pagesInfoVec[page].GetEnabled()
 
 
-    def Enable(self, page, enabled=True):
+    def EnableTab(self, page, enabled=True):
         """ Enables or disables a tab. """
 
         if page >= len(self._pagesInfoVec):
             return
         
         """ Enables or disables a tab. """
 
         if page >= len(self._pagesInfoVec):
             return
         
-        self._pagesInfoVec[page].Enable(enabled)
+        self._pagesInfoVec[page].EnableTab(enabled)
         
 
     def GetSingleLineBorderColour(self):
         
 
     def GetSingleLineBorderColour(self):
@@ -4553,10 +4759,16 @@ class PageContainer(wx.Panel):
     def OnLeftDClick(self, event):
         """ Handles the wx.EVT_LEFT_DCLICK event for L{PageContainer}. """
 
     def OnLeftDClick(self, event):
         """ Handles the wx.EVT_LEFT_DCLICK event for L{PageContainer}. """
 
-        if self.HasFlag(FNB_DCLICK_CLOSES_TABS):
+        where, tabIdx = self.HitTest(event.GetPosition())
+        
+        if where == FNB_RIGHT_ARROW:
+            self.RotateRight()
+
+        elif where == FNB_LEFT_ARROW:
+            self.RotateLeft()
+
+        elif self.HasFlag(FNB_DCLICK_CLOSES_TABS):
         
         
-            where, tabIdx = self.HitTest(event.GetPosition())
-            
             if where == FNB_TAB:
                 self.DeletePage(tabIdx)
         
             if where == FNB_TAB:
                 self.DeletePage(tabIdx)
         
@@ -4565,6 +4777,57 @@ class PageContainer(wx.Panel):
             event.Skip()
         
 
             event.Skip()
         
 
+    def OnSetFocus(self, event):
+        """ Handles the wx.EVT_SET_FOCUS event for L{PageContainer}. """
+
+        if self._iActivePage < 0:
+            event.Skip()
+            return
+
+        self.SetFocusedPage(self._iActivePage)
+
+
+    def OnKillFocus(self, event):
+        """ Handles the wx.EVT_KILL_FOCUS event for L{PageContainer}. """
+
+        self.SetFocusedPage()
+
+
+    def OnKeyDown(self, event):
+        """
+        When the PageContainer has the focus tabs can be changed with
+        the left/right arrow keys.
+        """
+        key = event.GetKeyCode()
+        print key
+        if key == wx.WXK_LEFT:
+            self.GetParent().AdvanceSelection(False)
+        elif key == wx.WXK_RIGHT:
+            self.GetParent().AdvanceSelection(True)
+        elif key == wx.WXK_TAB:
+            flags = 0
+            if not event.ShiftDown(): flags |= wx.NavigationKeyEvent.IsForward
+            if event.CmdDown():       flags |= wx.NavigationKeyEvent.WinChange
+            self.Navigate(flags)
+        else:
+            event.Skip()
+
+            
+    def SetFocusedPage(self, pageIndex=-1):
+        """
+        Sets/Unsets the focus on the appropriate page.
+        If pageIndex is defaulted, we have lost focus and no focus indicator is drawn.
+        """
+
+        for indx, page in enumerate(self._pagesInfoVec):
+            if indx == pageIndex:
+                page._hasFocus = True
+            else:
+                page._hasFocus = False
+            
+        self.Refresh()
+                
+
     def PopupTabsMenu(self):
         """ Pops up the menu activated with the drop down arrow in the navigation area. """
 
     def PopupTabsMenu(self):
         """ Pops up the menu activated with the drop down arrow in the navigation area. """
 
@@ -4572,15 +4835,16 @@ class PageContainer(wx.Panel):
 
         for i in xrange(len(self._pagesInfoVec)):
             pi = self._pagesInfoVec[i]
 
         for i in xrange(len(self._pagesInfoVec)):
             pi = self._pagesInfoVec[i]
-            item = wx.MenuItem(popupMenu, i, pi.GetCaption(), pi.GetCaption(), wx.ITEM_NORMAL)
+            item = wx.MenuItem(popupMenu, i+1, pi.GetCaption(), pi.GetCaption(), wx.ITEM_NORMAL)
             self.Bind(wx.EVT_MENU, self.OnTabMenuSelection, item)
 
             self.Bind(wx.EVT_MENU, self.OnTabMenuSelection, item)
 
-            # This code is commented, since there is an alignment problem with wx2.6.3 & Menus
-            # if self.TabHasImage(ii):
-            #   item.SetBitmaps( (*m_ImageList)[pi.GetImageIndex()] );
+            # There is an alignment problem with wx2.6.3 & Menus so only use
+            # images for versions above 2.6.3
+            if wx.VERSION > (2, 6, 3, 0) and self.TabHasImage(i):
+                item.SetBitmap(self.GetImageList().GetBitmap(pi.GetImageIndex()))
 
             popupMenu.AppendItem(item)
 
             popupMenu.AppendItem(item)
-            item.Enable(pi.GetEnabled())
+            item.EnableTab(pi.GetEnabled())
             
         self.PopupMenu(popupMenu)
 
             
         self.PopupMenu(popupMenu)
 
@@ -4588,7 +4852,7 @@ class PageContainer(wx.Panel):
     def OnTabMenuSelection(self, event):
         """ Handles the wx.EVT_MENU event for L{PageContainer}. """
 
     def OnTabMenuSelection(self, event):
         """ Handles the wx.EVT_MENU event for L{PageContainer}. """
 
-        selection = event.GetId()
+        selection = event.GetId() - 1
         self.FireEvent(selection)
 
 
         self.FireEvent(selection)
 
 
@@ -4618,6 +4882,7 @@ class PageContainer(wx.Panel):
             event.SetEventType(wxEVT_FLATNOTEBOOK_PAGE_CHANGED)
             event.SetOldSelection(oldSelection)
             self.GetParent().GetEventHandler().ProcessEvent(event)
             event.SetEventType(wxEVT_FLATNOTEBOOK_PAGE_CHANGED)
             event.SetOldSelection(oldSelection)
             self.GetParent().GetEventHandler().ProcessEvent(event)
+            self.SetFocus()
             
 
     def SetImageList(self, imglist):
             
 
     def SetImageList(self, imglist):
@@ -4672,3 +4937,4 @@ class PageContainer(wx.Panel):
         where, tabIdx = self.HitTest(client_pt)
         self._mgr.GetRenderer(self.GetParent().GetWindowStyleFlag()).DrawDragHint(self, tabIdx)
 
         where, tabIdx = self.HitTest(client_pt)
         self._mgr.GetRenderer(self.GetParent().GetWindowStyleFlag()).DrawDragHint(self, tabIdx)
 
+