Tabbar

From Team Developer SqlWindows Wiki
Jump to: navigation, search

TabBar control

This control was introduced in TD 5.1


Contents


Pointer2.png Tabbar: drill down to child objects Pointer.png

The Tabbar object which was introduced in TD5.1 is the modern replacement of the old QuickTabs.
The internal structure of the Tabbar is completely different compared to the old object.

The child objects which are part of the Tab pages are now created on separate windows.
Using a spy tool you can inspect the Tabbar window structure:

TabBarStructure.png

So to discover the child objects on a Tabbar you have to follow this structure to drill down:

TabBar->TabPage->TabChild


This is the code how to drill down:

! On the form, more than one Tabbar could be present, loop over them
Set hWndTabBar = SalGetFirstChild( hWndForm, TYPE_TabBar )
While hWndTabBar
   ! How many Tabpages?
   Set nMaxPages = SalTabPageCount( hWndTabBar )
   Set nCountPages = 0
   While nCountPages < nMaxPages
      ! Get the window handle of the Tabpage
      Set hWndTabPage = SalTabGetPageWindow ( hWndTabBar, nCountPages )
      If hWndTabPage
         ! Get the first child and loop through the childs
         Set hWndTabChild = SalGetFirstChild( hWndTabPage, TYPE_Any )
         While hWndTabChild != hWndNULL
            Set hWndTabChild = SalGetNextChild( hWndTabChild, TYPE_Any )
      Set nCountPages = nCountPages + 1
   Set hWndTabBar = SalGetNextChild( hWndTabBar, TYPE_TabBar )


Here you can download a sample:
Down.png WIKI_TabBar_DiscoverChilds.zip


TabBarDiscoverChilds.png