Sign in to follow this  
Followers 0
CyberSlug

Should Tab or TabItem notify?

4 posts in this topic

I think this was mentioned this before, but anyway: When a tabitem is clicked, the notification ID is for the main tab control itself.

Additionally, GuiCtrlRead on the tab returns the tabitem INDEX instead of the tabitem ID.....

I think the direct tabitem ID would be more useful...

#include <GuiConstants.au3>

GuiCreate("Example")

$tab = GuiCtrlCreateTab(80, 80, 300, 200)
$t1 = GuiCtrlCreateTabItem("one")
    GuiCtrlCreateButton("example button", 200, 200)
$t2 = GuiCtrlCreateTabItem("two")
$t3 = GuiCtrlCreateTabItem("three")
GuiCtrlCreateTabItem('')

GuiCtrlCreateLabel("TabItem ID's:  " & $t1 & ", " & $t2 & ", " & $t3, 10, 10)
GuiSetState()

While 1
    $msg = GUIGetMsg()
    ToolTip($msg, 0, 0)
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $tab Then
        MsgBox(4096,"Tab clicked", "Tad index is " & GuiCtrlRead($tab)) 
    EndIf
WEnd

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites



Presently the correspondance between index and id is not done due to the fact that if a tabitem is deleted a renumbering occurs.

I left to the programmer the responsability to do that.

I agree it can be a good idea if not too costly. :)

Share this post


Link to post
Share on other sites

I had a use for it to notify the other day, but I worked around it. I think it would have made it alot easier though if it did notify.

red

Share this post


Link to post
Share on other sites

Found the idea use OPT("GUIEventCompatibilityMode",2) and 3.1.1.4

:)

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  
Followers 0