Jump to content

Should Tab or TabItem notify?


Recommended Posts

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!
Link to comment
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. :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...