Valuater Posted May 26, 2008 Author Share Posted May 26, 2008 Champack, you could note above the discussion of $SS_CenterImage and how it is applied, I dont see how i can change the effect of the button without the current code and allow multilines of text... sorry. However, since you notice the "$Xbtn[1] = GUICtrlCreateLabel" then you can set the text without re-creating the button like this... $Button = _HoverButton ("Some text", 180, 80, 70, 15, $color) GUICtrlSetData($Button + 1, "Changed Text") 8) Link to comment Share on other sites More sharing options...
Sundance Posted July 11, 2008 Share Posted July 11, 2008 Hi, i try to make your code work for more then one theme. I discovered the following problem. When you hit one of the buttons with a quick short mouse click, the button won't turn into 'pressed' state. This is because the au3 script just check's the $msg message if the button ist clicked right before the _CheckHoverAndPressed() function will be called ?! I think there is no workaround for this ? PS: The problem stays with the modified version and also with your original code Valuater. Some hints for me? Link to comment Share on other sites More sharing options...
Sundance Posted July 11, 2008 Share Posted July 11, 2008 (edited) So, i moved the _CheckHoverAndPressed() call in the Button-Demo.au3 just behind the GUIGetMsg() and now it behaves much better... Now i have to finish the modification.. See you PS: I discovered the following bug. In the demo: when you push a button and only wait for the MessageBox to close instead of closing in manually the pushed button stays in 'pressed' mode... Edited July 11, 2008 by Sundance Link to comment Share on other sites More sharing options...
Valuater Posted August 7, 2008 Author Share Posted August 7, 2008 *** UPDATED 7/8/2008 *** ************ NEW ***************** Ver 2.0.0 __ButtonHoverTag.au3 Now you can use/add your own pics into a theme and it can work on "button release" 8) Link to comment Share on other sites More sharing options...
Christos Posted November 29, 2008 Share Posted November 29, 2008 Hi Valuater, Did I get it right, includes the new function the possibility to hold the button in the pushed status? Can you show me how I can use the __HoverWaitButtonUp function?! Thank you very much Christos Link to comment Share on other sites More sharing options...
Rental Posted November 30, 2008 Share Posted November 30, 2008 its not working for me. it has 2 errors when I use your demo. 1. when I load it and it asks for a folder and I highlight one and click ok I get the error. C:\Documents and Settings\Ours\Desktop\_ButtonHover.au3 (160) : ==> Variable used without being declared.: $Xbtn[1] = GUICtrlCreateLabel($XBtext, $XBleft, $XBtop, $XBwidth, $XBheight, $SS_NOTIFY & $SS_CENTER) $Xbtn[1] = GUICtrlCreateLabel($XBtext, $XBleft, $XBtop, $XBwidth, $XBheight, ^ ERROR 2. and when it does work it keeps popping up a msgbox that will just keep showing till the script is exited. Link to comment Share on other sites More sharing options...
Christos Posted November 30, 2008 Share Posted November 30, 2008 You have to add the #include <StaticConstants.au3> in the _ButtonHover.au3. Link to comment Share on other sites More sharing options...
grham Posted January 6, 2009 Share Posted January 6, 2009 Hello, to Valuater: I used your _ButtonHover() UDF for two of my projects and I must say it's very, very good. I like it (with XSkin and all - by the way also one of great scripts) Yesterday I got this new __ButtonHoverTag UDF and everything is OK. I have only one note for (some) people that can't get two different button "styles" to work. Why? This was my case, but only till I realized that the images for some buttons and these for other buttons had different extensions (gif - jpg). So I passed these $XBType to an Array (like the tags) and solved. Thank you for it! ... Link to comment Share on other sites More sharing options...
KenNichols Posted June 17, 2009 Share Posted June 17, 2009 (edited) Valuater, Let me start by saying I love ButtonHover and XSkin! Also thanks for Ez Track as well! If you wouldn't mind takeing a look at the attached jpg. I am having a weird issue with one of my child forms. I am not sure why it is creating a partial Button in my ListView it is the one circled in Blue Edit: If I don't run _CheckHoverAndPressed for that form It doesn't do it. Edited June 17, 2009 by KenNichols [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
Valuater Posted June 17, 2009 Author Share Posted June 17, 2009 Glad you like them... I couldn't guess by that picture, I can only test code to find errors 8) Link to comment Share on other sites More sharing options...
nguyenbason Posted June 26, 2009 Share Posted June 26, 2009 (edited) Can i set normal, over and press by resource? Because i don't want bring some folders with my program And how can do this with many button (of course different picture. Your example is same pics) Edited June 26, 2009 by nguyenbason UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
Valuater Posted June 26, 2009 Author Share Posted June 26, 2009 ButtonHover() was based on a "theme" for the Buttons, ButtonHoverTag() was designed for mutiple buttons. There are a couple of "Resource" UDF's around, however, I do not know how each use applies, you will need to do the DD on that 8) Link to comment Share on other sites More sharing options...
nguyenbason Posted June 26, 2009 Share Posted June 26, 2009 (edited) ButtonHover() was based on a "theme" for the Buttons, ButtonHoverTag() was designed for mutiple buttons. There are a couple of "Resource" UDF's around, however, I do not know how each use applies, you will need to do the DD on that 8)Ok. I modified it to use custom array resource file rather than use from directory. I have followings code expandcollapse popup;Menu buttons $RegisterButtonNormal = @TempDir & "\sonnb_RegisterButtonNormal.jpg" FileInstall("MenuButtons\RegisterButtonNormal.jpg",$RegisterButtonNormal) $RegisterButtonOver = @TempDir & "\sonnb_RegisterButtonOver.jpg" FileInstall("MenuButtons\RegisterButtonOver.jpg",$RegisterButtonOver) $RegisterButtonPress = @TempDir & "\sonnb_RegisterButtonPress.jpg" FileInstall("MenuButtons\RegisterButtonPress.jpg",$RegisterButtonPress) $ViewAlbumButtonNormal = @TempDir & "\sonnb_ViewAlbumButtonNormal.jpg" FileInstall("MenuButtons\ViewAlbumButtonNormal.jpg",$ViewAlbumButtonNormal) $ViewAlbumButtonOver = @TempDir & "\sonnb_ViewAlbumButtonOver.jpg" FileInstall("MenuButtons\ViewAlbumButtonOver.jpg",$ViewAlbumButtonOver) $ViewAlbumButtonPress = @TempDir & "\sonnb_ViewAlbumButtonPress.jpg" FileInstall("MenuButtons\ViewAlbumButtonPress.jpg",$ViewAlbumButtonPress) $ViewBlogButtonNormal = @TempDir & "\sonnb_ViewBlogButtonNormal.jpg" FileInstall("MenuButtons\ViewBlogButtonNormal.jpg",$ViewBlogButtonNormal) $ViewBlogButtonOver = @TempDir & "\sonnb_ViewBlogButtonOver.jpg" FileInstall("MenuButtons\ViewBlogButtonOver.jpg",$ViewBlogButtonOver) $ViewBlogButtonPress = @TempDir & "\sonnb_ViewBlogButtonPress.jpg" FileInstall("MenuButtons\ViewBlogButtonPress.jpg",$ViewBlogButtonPress) $Form1_1 = GUICreate("LiveVN Space new blog maker", 726, 696, -1, -1, BitOR($WS_POPUP,$DS_MODALFRAME), BitOR($WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE)) GUISetState(@SW_SHOW) Dim $XButton_Location[3] $XButton_Location[0] = $HomeButtonNormal $XButton_Location[1] = $HomeButtonOver $XButton_Location[2] = $HomeButtonPress $Button_1 = __HoverButton ("", 188, 0, 88, 36) ;$Pic4 = GUICtrlCreatePic($RegisterButtonNormal, 332, 0, 88, 36, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $XButton_Location[0] = $RegisterButtonNormal $XButton_Location[1] = $RegisterButtonOver $XButton_Location[2] = $RegisterButtonPress $Button_2 = __HoverButton ("", 332, 0, 88, 36) ;$Pic5 = GUICtrlCreatePic($ViewAlbumButtonNormal, 476, 0, 88, 36, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $XButton_Location[0] = $ViewAlbumButtonNormal $XButton_Location[1] = $ViewAlbumButtonOver $XButton_Location[2] = $ViewAlbumButtonPress $Button_3 = __HoverButton ("", 476, 0, 88, 36) ;$Pic6 = GUICtrlCreatePic($ViewBlogButtonNormal, 612, 0, 88, 36, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $XButton_Location[0] = $ViewBlogButtonNormal $XButton_Location[1] = $ViewBlogButtonOver $XButton_Location[2] = $ViewBlogButtonPress $Button_4 = __HoverButton ("", 612, 0, 88, 36) While 1 __CheckHoverAndPressed ($Form1_1) Sleep(100) WEndoÝ÷ Ù«¢+ÙÕ¹}} ¡!½ÙɹAÉÍÍ ÀÌØí}U$ôÅÕ½ÐìÅÕ½Ðì¤(1½°ÀÌØíѵÁ%°ÀÌØíѵÁ%È(ÀÌØí Ñɱ%Èô}} ½¹Ñɽ±!½ÙÈ Ä°ÀÌØí}U$¤(ÀÌØíѵÁ%¹àÈôáѹ(ÀÌØíѵÁ%ÈôÀÌØí!½ÙÉ%lÀÌØíѵÁ%¹àÉt(ÀÌØíѵÁQÈôÀÌØí!½ÙÉQlÀÌØíѵÁ%¹àÉt(%ÀÌØí Ñɱ%ÈôôÄQ¡¸(U% ÑɱMÑ%µ ÀÌØíѵÁ%È´Ä°ÀÌØía ÕÑѽ¹}1½Ñ¥½¹lÉt¤(±Í%ÀÌØí Ñɱ%ÈôôÀQ¡¸(U% ÑɱMÑ%µ ÀÌØíѵÁ%È´Ä°ÀÌØía ÕÑѽ¹}1½Ñ¥½¹lÅt¤(¹%(ÀÌØí Ñɱ%ô}} ½¹Ñɽ±!½ÙÈ À°ÀÌØí}U$¤(ÀÌØíѵÁ%¹àôáѹ(ÀÌØíѵÁ%ôÀÌØí!½ÙÉ%lÀÌØíѵÁ%¹át(ÀÌØíѵÁQôÀÌØí!½ÙÉQlÀÌØíѵÁ%¹át(%ÀÌØí Ñɱ%ôôÄQ¡¸(U% ÑɱMÑ%µ ÀÌØíѵÁ%´Ä°ÀÌØía ÕÑѽ¹}1½Ñ¥½¹lÅt¤(±Í%ÀÌØí Ñɱ%ôôÀQ¡¸(U% ÑɱMÑ%µ ÀÌØíѵÁ%´Ä°ÀÌØía ÕÑѽ¹}1½Ñ¥½¹lÁt¤(¹%)¹Õ¹ìôôÐí}} ¡!½ÙɹAÉÍÍoÝ÷ Ù«¢+ÙÕ¹}}!½ÙÉ]¥Ñ ÕÑѽ¹UÀ ¤(%ÀÌØí!½ÙÉ%lÀÌØí±½±}!%tÐìôÈQ¡¸ì±Íй½Ý¸½¹Ñɽ°%¥¹à°¥ÉÍн¹¥ÌÈ(ÀÌØíÉÐôU%Ñ ÕÉͽÉ%¹¼ ¤(%%ÍÉÉä ÀÌØíÉФ¹ÀÌØíÉÑlÑtôôÀÌØí!½ÙÉ%lÀÌØí!½ÙÉ%lÀÌØí±½±}!%utQ¡¸ì¥¹¼¥ÌÙ±¥°¹±¥Ñ¡¹½Ý¸½¹Ñɽ°(ÀÌØíѵÁQôÀÌØí!½ÙÉQlÀÌØí!½ÙÉ%lÀÌØí±½±}!%utìÐÑɽ´¥¹à(U% ÑɱMÑ%µ ÀÌØí!½ÙÉ%lÀÌØí!½ÙÉ%lÀÌØí±½±}!%ut´Ä°ÀÌØía ÕÑѽ¹}1½Ñ¥½¹lÉt¤(]¡¥±ÀÌØíÉÑlÑtôôÀÌØí!½ÙÉ%lÀÌØí!½ÙÉ%lÀÌØí±½±}!%ut¹ÀÌØíÉÑlÉtôôÄ(M±À Ô¤(ÀÌØíÉÐôU%Ñ ÕÉͽÉ%¹¼ ¤(]¹(%ÀÌØíÉÑlÉtôôÄQ¡¸IÑÕɸÄ(¹%(¹%)¹Õ¹ìôôÐí}}!½ÙÉ]¥Ñ ÕÑѽ¹UÀ When i run the code, it shows up ok but when i move mouse over buttons it only uses last XButton_Location setted images for all buttons. How can i use each XButton_Location or each button? Thanks, Edited June 26, 2009 by nguyenbason UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
Valuater Posted June 26, 2009 Author Share Posted June 26, 2009 Your BuutonHover Function is TOTAlly Different than this Func __HoverButton($XBtext, $XBleft, $XBtop, $XBwidth, $XBheight, $XBtag = "", $XBcolor = "") If Not FileExists($XButton_Location & "\") Then MsgBox(64, "Error", " $XButton_Location - was not found ", 3) Return EndIf If FileExists($XButton_Location & "\" & $XBtag & "Normal.gif") Then $XBType = ".gif" ElseIf FileExists($XButton_Location & "\" & $XBtag & "Normal.jpg") Then $XBType = ".jpg" ElseIf FileExists($XButton_Location & "\" & $XBtag & "Normal.bmp") Then $XBType = ".bmp" Else MsgBox(64, "Error", " Unknown Button file type ( not - gif, jpg, or bmp ) ", 3) Return EndIf Local $Xbtn[2] $Xbtn[0] = GUICtrlCreatePic($XButton_Location & "\" & $XBtag & "Normal" & $XBType, $XBleft, $XBtop, $XBwidth, $XBheight) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Xbtn[1] = GUICtrlCreateLabel($XBtext, $XBleft, $XBtop, $XBwidth, $XBheight, BitOR($SS_CENTERIMAGE, $SS_CENTER)) If $XBcolor <> "" Then GUICtrlSetColor(-1, $XBcolor) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) __ControlHover(2, "", $Xbtn[1], $XBtag) Return $Xbtn ; [0] = pic, [1] = label EndFunc ;==>__HoverButton What you have change has also lost the process created in that functions correctly... SORRY, I cannot go through your changing of my UDF to find your errors 8) Link to comment Share on other sites More sharing options...
nguyenbason Posted June 27, 2009 Share Posted June 27, 2009 (edited) Sorry for changing it. Just because i want to use resource files. Sorry Valuater. Nevermind on my case anymore. Edited June 27, 2009 by nguyenbason UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
nguyenbason Posted June 28, 2009 Share Posted June 28, 2009 (edited) Sorry for bump up again but the new __HoverButtonTag don't work on click (of course this time i don't modified anything, just use your example and rename functions to same with functions in __HoverButtonTag). Please check, thanks. Edit: I checked the new and old UDF. In the new UDF __HoverButton return $Xbtn while the old on return $Xbtn[0]. I tried $Xbtn[0] and it's working now. Edited June 28, 2009 by nguyenbason UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
Valuater Posted June 29, 2009 Author Share Posted June 29, 2009 (edited) Great, Glad you got it... 8) Edited June 29, 2009 by Valuater Link to comment Share on other sites More sharing options...
nguyenbason Posted June 29, 2009 Share Posted June 29, 2009 Thanks, As you can see, in windows or in website, if you click on a button and hold the mouse (still in clicking) the function will not be called until you release the mouse. And the same if you click hold and move mouse out the button. In your UDF, the function will be called immediately after user click on button. If you can improve this, i think it so greats. UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
Valuater Posted June 29, 2009 Author Share Posted June 29, 2009 Thanks, As you can see, in windows or in website, if you click on a button and hold the mouse (still in clicking) the function will not be called until you release the mouse. And the same if you click hold and move mouse out the button. In your UDF, the function will be called immediately after user click on button. If you can improve this, i think it so greats.Thats what this is... Func __HoverWaitButtonUp()8) Link to comment Share on other sites More sharing options...
nguyenbason Posted June 29, 2009 Share Posted June 29, 2009 Thats what this is... Func __HoverWaitButtonUp()8)Oh, I will try it. Thanks Valuater! UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now