Champak Posted August 16, 2008 Share Posted August 16, 2008 My app is set up based on onevent functions. I have a problem with two solutions; solution one I can't get to work, solution two I don't know how to get it to work. Solution 1: I have two seporate images, a small one on top of another. The smaller one on the lower half of the larger one. The problem is, even though I set up guictrlonevent pointing to different functions on each of them, only the larger on in the background registers even when I press the smaller one on the lower half of the larger one....almost as if the press of the pic is going right through it to the larger on beneath. Solution 2: I was thinking of setting it up so I just use one pic it goes to one function, but if it is pressed withing a certain area...the lower half of the image...it does one thing, and something else if it is pressed somewhere else within the image. But I don't know how exactly to do this. I assume it has something to do with getting the mouse position, but as I see it, that would only give me the x,y position instead of a rectangular area. Any help on either? Thanks. Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 16, 2008 Share Posted August 16, 2008 This may not suit your purposes but if you know the image placement on your GUI just disable the images once they're drawn, get the x,y pos of the mouse, and do a bit of math to see where it is in relation to the images. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Champak Posted August 16, 2008 Author Share Posted August 16, 2008 That wouldn't work because disabling the larger image on the background disables its own function which is needed. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 16, 2008 Share Posted August 16, 2008 (pseudo-code to place in the beginning of whatever functions run when the large image is clicked) if "mouse-y-coordinate" > "smaller-image-y-position" then Return DoSomethingElse() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 16, 2008 Share Posted August 16, 2008 (edited) This may not suit your purposes but if you know the image placement on your GUI just disable the images once they're drawn, get the x,y pos of the mouse, and do a bit of math to see where it is in relation to the images.If you disable the images you can still use the function like I suggested. If the mouse is on the portion of the larger image call that function and if it's on the smaller one call that function. Edited August 16, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Champak Posted August 16, 2008 Author Share Posted August 16, 2008 @AdmiralAlkex thanks, you helped me rethink how I was thinking about the coordinates, this is what I came up with and it is working on my test script, just have to see if it works in the real one. $this = MouseGetPos () If $this[0] > 0 And $this[0] < 147 And $this[1] > 0 And $this[1] < 147 then MsgBox(0,0,0) Else MsgBox(0,1,1) EndIf @dbzfanatic I see what you are saying now. Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 16, 2008 Share Posted August 16, 2008 Alright glad I could clarify. Hope you get it working no matter what approach you use. If you do post some code and let us know . Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 16, 2008 Share Posted August 16, 2008 @AdmiralAlkex thanks, you helped me rethink how I was thinking about the coordinates, this is what I came up with and it is working on my test script, just have to see if it works in the real one.-snipped-That was about the first time I used pseudo-code, I am glad you understood I hope it is for some use to you! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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