Jump to content
Sign in to follow this  
Mungo

GUICtrlSetTip problem - wrong tip message in child GUI when tabs used in parent and child GUI?

Recommended Posts

Mungo

Maybe someone can help ...

I use tabs on my parent (main) GUI and on a child (pop-up) GUI. I also use GUICtrlSetTip descriptions for the tab items on both GUIs.

The tips are displayed correctly for the parent GUI tab items but not for the child GUI tab items. The mouse over on the child GUI tab items produces the same tip messages as for the parent GUI tab items for as many (number of) tabs and tips also found in the main GUI (the first 2). This applies regardless whether tip messages are defined for tab items in the child GUI or not.

If the number of tab items with tips in the child GUI (3 tab items) is larger than in the main GUI (2 tab items), then defined tip messages are displayed correctly for those tab items (numbers) larger (in this case the 3rd tab item).

Thanks

A two GUI example below

#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Global $main_gui, $pop_gui

main_gui()

Func main_gui()
    $main_gui = GUICreate ("Gui Main - TABs and tips", 400, 400, -1, -1, -1, -1, 0)

    GUICtrlCreateTab(10, 10, 200, 100)
    GUICtrlCreateTabItem("Main Tab 01")
    GUICtrlSetTip(-1, "TAB Main 1")
    GUICtrlCreateLabel("Mouse over tab name to see tips ...", 20, 50, 200, 20)

    GUICtrlCreateTabItem("Main Tab 02")
    GUICtrlSetTip(-1, "TAB Main 2")
    GUICtrlCreateLabel("Mouse over tab name to see tips ...", 20, 50, 200, 20)

    GUICtrlCreateTabItem("")

    Local $exit = GUICtrlCreateButton("Exit", 110, 360, 80, 20)
    Local $pop  = GUICtrlCreateButton("Pop-up", 210, 360, 80, 20)
    GUISetState(@SW_SHOW)

    While 1
    Local $msg_pop = GUIGetMsg()
        Select
            Case $msg_pop = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg_pop = $exit
                ExitLoop
            Case $msg_pop = $pop
               pop_gui()
        EndSelect
    WEnd
    GUIDelete()
EndFunc


Func pop_gui()
    $pop_gui = GUICreate ("Gui Pop-up - TABs and tips", 300, 300,-1, -1, -1, -1, $main_gui)

    GUICtrlCreateTab(10, 10, 280, 100)
    GUICtrlCreateTabItem("Pop-up Tab 01")
    GUICtrlCreateLabel("Mouse over tab name to see tips ...", 20, 50, 200, 20)

    GUICtrlCreateTabItem("Pop-up Tab 02")
    GUICtrlSetTip(-1, "TAB Pop-up 2")
    GUICtrlCreateLabel("Mouse over tab name to see tips ...", 20, 50, 200, 20)

    GUICtrlCreateTabItem("Pop-up Tab 03")
    GUICtrlSetTip(-1, "TAB Pop-up 3")
    GUICtrlCreateLabel("Mouse over tab name to see tips ...", 20, 50, 200, 20)

    GUICtrlCreateTabItem("")

    Local $exit = GUICtrlCreateButton("Exit", 110, 260, 80, 20)
    GUISetState(@SW_SHOW)

     While 1
    Local $msg_pop = GUIGetMsg()
        Select
            Case $msg_pop = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg_pop = $exit
                ExitLoop
        EndSelect
     WEnd
     GUIDelete()
EndFunc

Share this post


Link to post
Share on other sites
Melba23

Mungo,

I can certainly reproduce the problem, so it is not just you. ;)

AutoIt deals with Tabs, along with some other more complex controls such as TreeViews, in a strange manner. The TabItems, although given a ControlID, are not really separate elements - if you try to access their handle you will find that there is not one associated with them. AutoIt manages them through its internal systems, but you cannot access them directly. So I can well imagine that AutoIt gets confused when tooltips are set for the TabItems. :(>

I suggest you open a Trac ticket and see if Jon can do something internally. In the meantime I will have a look at whether you can mimic the behaviour by using _GUICtrlTab_HitTest. ;)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


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
Sign in to follow this  

×