Jump to content

Tab questions...


Madza91
 Share

Recommended Posts

Hello everybody...

I need to detect when is left mouse button down, but on tab - with WM_NOTIFY ... Is it possible to detect that with WM_NOTIFY, and if isn't how is it possible?!

Thx...

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

Here all that i could think of for this,using the advanced GuiGetMsg() it gets that the tab is pressed and depending on the coords of the mouse is which tab it is

#include <GuiConstantsEx.au3>

GUICreate("Test1")
GUISetState(@sw_show)
$tab = GUICtrlCreateTab(10, 10,300,300)
$tab_1 = GUICtrlCreateTabItem("Tab 1")
$tab_2 = GUICtrlCreateTabItem("Tab 2")


do 
    $msg = GUIGetMsg(1)
    if $msg[0] = $tab   and $msg[3] >= 12 and $msg[3] <= 54 and $msg[4] >=12 Then
            MsgBox(0, "","Tab 1 was pressed")
    EndIf
    
    if $msg[0] = $tab   and $msg[3] >= 54 and $msg[3] <= 95  Then
        MsgBox(0, "","Tab 2 was pressed")
    EndIf
Until $msg[0] = $GUI_EVENT_CLOSE

GL, Hope this helps ya

Link to comment
Share on other sites

:mellow:

With your solution I can get only when is clicked some inactive Tab... That I can made with $TCN_SELCHANGING in Wm_Notify...

Like I said, I need to do it with Wm_Notify, and I need to detect when is mouse down over inactive and active Tab.

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Link to comment
Share on other sites

:mellow:

With your solution I can get only when is clicked some inactive Tab... That I can made with $TCN_SELCHANGING in Wm_Notify...

Like I said, I need to do it with Wm_Notify, and I need to detect when is mouse down over inactive and active Tab.

The Tab control does not received a $NM_LDOWN notifycation, therefore we have 2 ways:

1. Use a $GUI_EVENT_PRIMARYDOWN event ID and a GUIGetCursorInfo() function.

2. Subclassing the Tab control and process the WM_LBUTTONDOWN message.

Easy way:

#include <GuiConstantsEx.au3>

$hGUI = GUICreate("Test", 300, 200)

$ctlTab = GUICtrlCreateTab(10, 10, 280, 180)

$TabItem_1 = GUICtrlCreateTabItem("Item1")

$TabItem_2 = GUICtrlCreateTabItem("Item2")

GUICtrlCreateTabItem("")

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            $aPos = GUIGetCursorInfo()
            If IsArray($aPos) Then
                If $aPos[4] = $ctlTab Then ConsoleWrite("DOWN" & @LF)
            EndIf
    EndSwitch
WEnd

:(

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...