corgano Posted May 2, 2009 Share Posted May 2, 2009 (edited) Attched is the script.It uses For loops to make a 26 by 21 grid of pic controls, they are all gray.When you click a controll it makes it black.How do i make it so you can chold down the mouse button and make it change all the tiles the mouse moves over?*EDIT*I DO NOT mean draging the windowSorry if i explaned it bad, please see the script.~corgano Edited May 2, 2009 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
Mat Posted May 2, 2009 Share Posted May 2, 2009 look at the helpfile. it won't bite. look at the appendix under GUI control styles, and WS_ParentDrag. AutoIt Project Listing Link to comment Share on other sites More sharing options...
corgano Posted May 2, 2009 Author Share Posted May 2, 2009 look at the helpfile. it won't bite.look at the appendix under GUI control styles, and WS_ParentDrag.This is NOT what i ment. I know how to use WA_ParentDragYou click a pic, it will turn blackYou hold dowin the mouse button and move it over the pic controls, how do i make it make all controlls you move over turn black? 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
corgano Posted May 2, 2009 Author Share Posted May 2, 2009 (edited) I found out how to use this method: $MousePos = GUIGetCursorInfo($Form1) While $MousePos[2] = 1 For $x = 1 To 26 For $y = 1 To 21 If $MousePos[4] = $Tile[$x][$y] Then While $MousePos[4] = $Tile[$x][$y];while mouse is over the button GUICtrlSetImage($Tile[$x][$y],@ScriptDir & "\1.bmp") $MousePos = GUIGetCursorInfo($Form1) WEnd EndIf Next Next WEnd The problem is when i use it in the script and move over the borders at the edge it freases my program. Anyone have any idea how to fix it? new script \/ Edited May 2, 2009 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
Mat Posted May 2, 2009 Share Posted May 2, 2009 (edited) sorry my bad. (You still can't spell it though. ) Probably a while loop started when mouse button is pressed. While down If mouse goes over control then black WEnd possibly look at the mousehover udf by marfdaman and pressdetect by someone else (can't find who. its a while since i used it.) MDiesel Yep, you got there without me!! see, why post if you can work it out yourself. I'm guessing you acn solve the problem by checking @Error after the first function. your new script doesn't work as you want it too. Edited May 2, 2009 by mdiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
corgano Posted May 2, 2009 Author Share Posted May 2, 2009 (edited) sorry my bad. (You still can't spell it though. )Probably a while loop started when mouse button is pressed.While downIf mouse goes over control then blackWEndpossibly look at the mousehover udf by marfdaman and pressdetect by someone else (can't find who. its a while since i used it.)MDieselLOL I beat you to it!The first script used (I think) the same mouse over you were talking about.The second script uses a while mousedown loop (see previous post)The problem now is when you move the mouse over the black border while drawing it frezes. How do i fix it? Edited May 2, 2009 by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
Mat Posted May 2, 2009 Share Posted May 2, 2009 (edited) You gotta consider what you have after the while loop. the loop ends when $mousepos[2] <> 1, but you need to add another bit saying: While $MousePos[2] = 1 And $mousepos[0] < GUIVert And $mousepos[1] < GUIHor (You will have to input the length) so: while mouse primary button is down and mouse is in the GUI. simple.ish. Edited May 2, 2009 by mdiesel AutoIt Project Listing 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