PlanetSquires Forums

Support Forums => General Board => Topic started by: Jean-pierre Leroy on February 01, 2016, 02:23:26 PM

Title: Two new wrappers for the Tab Control
Post by: Jean-pierre Leroy on February 01, 2016, 02:23:26 PM
Dear all,

Here are two news wrappers that I use regulary for the TabControl.

To get the child form handle of a TabControl = F(TabControl Handle, Position)

Function TabControlGetChildFormHandle(ByVal phWndControl As Dword, ByVal pPos As Byte) As Dword                                                                                                   
    Local lTCITEM As TC_ITEM
    lTCITEM.Mask = %TCIF_PARAM
    TabCtrl_GetItem(phWndControl, pPos, lTCITEM)
    Function = lTCITEM.lParam         
End Function   


To get the position in the Tabcontrol = F(TabControl Handle, Caption of the Tab))

Function TabControlGetPositionIndex(ByVal phWndControl As Dword, ByVal pTabText As String) As Long
                                                                                                   
    Local lI        As Long : lI = FF_TabControl_GetTabCount(phWndControl)
    Local lPosIndex As Long : lPosIndex = -1     
    Do       
        Decr lI
        If FF_TabControl_GetText (phWndControl, lI) = pTabText Then
            lPosIndex = lI
        End If                                     
    Loop Until lI = 0 Or lPosIndex <> -1       
    Function = lPosIndex       
End Function   


Hope that helps.

PS to Paul: feel free to add them to a new distribution/version of FireFly for PowerBASIC :-)
Title: Re: Two new wrappers for the Tab Control
Post by: Robert Rioja on March 02, 2016, 11:19:44 PM
Thank you Jean-pierre.  I can use them.
Robert