Jump to content

_GUIToolTip_Create for the text of the tabs


Go to solution Solved by odaylton,

Recommended Posts

Text translated from Portuguese by google - please apologize for any errors

 

First I have to thank the development team for product quality and the ease with which it is possible to develop tools with AutoIt.

I love being able to put a ToolTip in the form fields I create

However, I am not able to create a ToolTip on the text of the tab titles

I believe the reason is that I can't find the Tab text area Handle

Id exists but it is not possible to set the handle using GUICtrlGetHandle

as warned in the help

   

 

 

Local $TabItenID1 = GUICtrlCreateTabItem("tab0")
    ; how to get the Handle????
    ; como obter o Handle????
    Local $TabItenlHandle1 = GUICtrlGetHandle($TabItenID1) ;<<<<<<<<????
    ;I know it doesn't work and I would like to know how to fix it.
    ; sei que não funciona e gostaria de saber como resolver isso
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra no TAB1", $TabItenlHandle1)

I would like to get the Tabs Text Handle to have a different comment about each tab

#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
#include <GuiToolTip.au3>

#include <MsgBoxConstants.au3>


Example()

Func Example()
    Local $hGUI, $hTool, $hTab

    $hGUI = GUICreate("My GUI Tab", 250, 150) ; will create a dialog box that when displayed is centered
    Local $hToolTip1 = _GUIToolTip_Create($hGUI, BitOR($_TT_ghTTDefaultStyle, $TTS_BALLOON)) ; balloon style tooltip
    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    Local $idTab = GUICtrlCreateTab(10, 10, 200, 100)
    $hTab = GUICtrlGetHandle($idTab)
    ; Get/Set tooltip ????
    ; $hTool = _GUIToolTip_Create($hTab)
    ; _GUICtrlTab_SetToolTips($hTab, $hTool); <<<<????
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra na area  TAB", $hTab)
    
    
    Local $TabItenID1 = GUICtrlCreateTabItem("tab0")
    ; how to get the Handle????
    ; como obter o Handle????
    Local $TabItenlHandle1 = GUICtrlGetHandle($TabItenID1) ;<<<<<<<<????
    ;I know it doesn't work and I would like to know how to fix it.
    ; sei que não funciona e gostaria de saber como resolver isso
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra no TAB1", $TabItenlHandle1)
    
    Local $LabelID1 = GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    Local $LabelHandle1 = GUICtrlGetHandle($LabelID1)
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra no label", $LabelHandle1)
    
    Local $InputID1 = GUICtrlCreateInput("default", 80, 50, 70, 20)
    Local $InputHandle1 = GUICtrlGetHandle($InputID1)
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra no InputBox", $InputHandle1)
    
    Local $TabItenID2 = GUICtrlCreateTabItem("tab----1")
    ; how to get the Handle????
    ; como obter o Handle????
    Local $TabItenlHandle2 = GUICtrlGetHandle($TabItenID2) ;<<<<<<<<????
    ;I know it doesn't work and I would like to know how to fix it.
    ; sei que não funciona e gostaria de saber como resolver isso
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra no TAB2", $TabItenlHandle2)
    ;...
    Local $LabelID2 = GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    Local $LabelHandle2 = GUICtrlGetHandle($LabelID2)
    _GUIToolTip_AddTool($hToolTip1, $hGUI, "Mostra no label", $LabelHandle2)

    GUICtrlCreateTabItem("") ; end tabitem definition

    GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20)

    GUISetState(@SW_SHOW)
    
    Local $idMsg
    ; Loop until the user exits.
    While 1
        $idMsg = GUIGetMsg()

        If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop
        If $idMsg = $idTab Then
            ; display the clicked tab
            WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($idTab))
        EndIf
    WEnd
EndFunc   ;==>Example

 

Thank you for your attention

Edited by odaylton
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...