Sign in to follow this  
Followers 0
AustrianOak

XSkinGUICreate() conflicts with MsCreators Hovering function

7 posts in this topic

#1 ·  Posted (edited)

When using Mscreators hovering UDF and XSkinGUICreate() function i noticed that the images that were set with "hovering properties" flickered constantly when I would hold the mouse down on the images and not release it.

Note: It DID NOT flicker when hovering but when I pressed down on the image.

What's strange is everything works perfectly when I just do a GUICreate() instead of XSkinGUICreate()

I am wondering what is the fix to this and I really need help as I do not have a clue as to why XSkinGUICreate() and the hovering UDF do not "get along" with eachother. :)

Can someone help me? :P

Edited by nowagain

Share this post


Link to post
Share on other sites



Show a usable example of what you have, i will try to see what is causing the flickering.


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Here's a usable example, all you have to do is assign the variables to your own images:

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=Beta
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

#Include <XSkin.au3>
#Include <GUIConstants.au3>
#Include <Misc.au3>
#Include <WindowsConstants.au3>
#Include <GUICtrlSetOnHover_UDF.au3>


Global $Gui
Global $Clicked = False
Global $Skin_Folder = @ScriptDir & "\Skin\Test"

; Create the GUI

$Gui = XSkinGUICreate("", 215, 215, $Skin_Folder)

$Icon1 = GUICtrlCreatePic($close1, 186, 3, 23, 16)
_GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func", "PrimaryDown_Func", "PrimaryUp_Func")
$Icon2 = GUICtrlCreatePic($minimize1, 162, 3, 23, 16)
_GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func", "PrimaryDown_Func", "PrimaryUp_Func")
GUISetState()


GUISetState()

While 1 
    $msg = GUIGetMsg()

    Select
        Case $msg = $GUI_Event_Close
            Exit 0
    EndSelect

    If $Clicked Then
        $Clicked = False
        Exit
    EndIf
WEnd

Func Hover_Func($iCtrlID)
    Switch $iCtrlID
        Case $Icon1
            GUICtrlSetImage($iCtrlID, $close2)
        Case $Icon2
            GUICtrlSetImage($iCtrlID, $minimize2)
    EndSwitch
EndFunc

Func Leave_Hover_Func($iCtrlID)
    Switch $iCtrlID
        Case $Icon1
            GUICtrlSetImage($iCtrlID, $close1)
        Case $Icon2
            GUICtrlSetImage($iCtrlID, $minimize1)
    EndSwitch
EndFunc

Func PrimaryDown_Func($iCtrlID)
    Switch $iCtrlID
        Case $Icon1
            GUICtrlSetImage($iCtrlID, $close3)
        Case $Icon2
            GUICtrlSetImage($iCtrlID, $minimize3)
    EndSwitch
EndFunc

Func PrimaryUp_Func($iCtrlID)
    Switch $iCtrlID
        Case $Icon1
            GUICtrlSetImage($iCtrlID, $close1)
            $Clicked = True
        Case $Icon2
            GUICtrlSetImage($iCtrlID, $minimize1)
    EndSwitch
EndFunc

Share this post


Link to post
Share on other sites

all you have to do is assign the variables to your own images

And download the XSkin, include StaticConstants.au3, ButtonConstants.au3, rearange other includes, declare $close1..2..3 and $minimize1..2..3.

This what i call «unusable example» :).

About the flickering, it's because you set an image over and over every time the PrimaryDown_Func() is called (while you keep holding the mouse button down). You can check if the image already set...

.....
Global $iImage_1_IsSet = False
Global $iImage_2_IsSet = False

.....

Func PrimaryDown_Func($iCtrlID)
    Switch $iCtrlID
        Case $Icon1
            If Not $iImage_1_IsSet Then GUICtrlSetImage($iCtrlID, $close3)
            $iImage_1_IsSet = True
        Case $Icon2
            If Not $iImage_2_IsSet Then GUICtrlSetImage($iCtrlID, $minimize3)
            $iImage_2_IsSet = True
    EndSwitch
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Your above code works once, then it doesn't work again. When I hold my mouse down on the button and then move it off while still down, and then release it, when I move my mouse back to it, to press it down again, the image isn't set like it was the first time.

Share this post


Link to post
Share on other sites

Ok, instead of my above method, just open «GUICtrlSetOnHover_UDF.au3» and find this line (116) :

If $aCursorInfo[2] = 1 And $aHOVER_CONTROLS_ARRAY[$i][3] <> -1 Then

Now replace it with this:

If $aCursorInfo[2] = 1 And $aHOVER_CONTROLS_ARRAY[$i][3] <> -1 And $iCheck_LCEM <> $iControlGetHovered Then

But in this case the OnPrimaryDown function will be called just once, therefore while you holding mouse button down and trying to move it to the other controls, then for the new hovered control the OnPrimaryDown function will be not called, only after you release the mouse button.


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Ahh...works perfect now!

thanks for taking some time aside to help me with my problem! :)

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