Jump to content
Sign in to follow this  
corgano

Controls with 2D array names and click and drag

Recommended Posts

corgano

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 window

Sorry if i explaned it bad, please see the script.

~corgano

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites
Mat

look at the helpfile. it won't bite.

look at the appendix under GUI control styles, and WS_ParentDrag.

Share this post


Link to post
Share on other sites
corgano

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_ParentDrag

You click a pic, it will turn black

You 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

Share this post


Link to post
Share on other sites
corgano

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 by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites
Mat

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 by mdiesel

Share this post


Link to post
Share on other sites
corgano

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

LOL 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 by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites
Mat

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 by mdiesel

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  

×