Sign in to follow this  
Followers 0
fxg4758

GUICtrlOnHover in _AnyGui

1 post in this topic

Merry Christmas for All.

Can someone tell me what is wrong with this code?

When i make with a Gui, the function PrimaryDown_Proc($iCtrlID) works well. But, when i put in a _AnyGUI_AddChild or

_AnyGUI_Create/_AnyGUI_AddTab, the "_Hover_Func", "_Leave_Hover_Func" works well, but the function PrimaryDown_Proc($iCtrlID) never works. Can someone help me? Regards!

$ct = NET_ControlGetHandleByName("", "", "Test")

$ctl = _AnyGUI_AddChild ("", 0,0,790,60, $ct)

$varTab = GUICtrlCreateTab(0, 0, 790, 60)

$optbarFile = IniReadSectionNames("search.ini")

If Not IsArray($optbarFile) Then Return

_ArraySort($optbarFile)

For $z = 1 To $optbarFile[0]

$optbarAreas = IniReadSectionNames($optbarFile[$z])

If Not IsArray($optbarAreas) Then Exit

_ArraySort($optbarAreas)

Local $varTabItem[uBound($optbarAreas)], $Button[uBound($optbarAreas)]

$varTabItem = GUICtrlCreateTabItem(StringTrimRight($optbarFile[$z],4))

For $x = 1 To $optbarAreas[0]

If @error Then ContinueLoop

$X_Coord = 5 + (($x - 1) * 65)

$Button = GUICtrlCreateButton($optbarAreas[$x], $X_Coord, 25, 60, 30)

_GUICtrl_OnHoverRegister(1, "_Hover_Func", "_Leave_Hover_Func", "PrimaryDown_Proc")

GUICtrlSetBkColor(-1, $Btn_Color)

Next

GUISetState()

Next

GUICtrlCreateTabItem("")

_GUICtrlTab_SetCurFocus($varTab, 0)

Func PrimaryDown_Proc($iCtrlID)

Switch $iCtrlID

Case $iCtrlID

MsgBox(0, "", _GUICtrlTab_GetItemText($varTab, _GUICtrlTab_GetCurFocus($varTab)) & " - " & GUICtrlRead($iCtrlID), 2)

EndSwitch

EndFunc

Func _Hover_Func($iCtrlID)

GUICtrlSetBkColor($iCtrlID, $Hover_Color)

EndFunc

Func _Leave_Hover_Func($iCtrlID)

GUICtrlSetBkColor($iCtrlID, $Btn_Color)

EndFunc

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