Sign in to follow this  
Followers 0
Lord_Doominik

Need Help

18 posts in this topic

#1 ·  Posted (edited)

in my program there is this piece of code:

;MainGUI
$MainGUI = GUICreate("Doom Browser", 800, 600,(@DesktopWidth-800)/2, (@DesktopHeight-600)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_MAXIMIZE)
...

;Buttons
$GoPic = GUICtrlCreatePic("Images\Go.bmp", (@DesktopWidth-500)/2+505, 14, 43, 20)
$Go = GUICtrlCreateButton("Go", (@DesktopWidth-500)/2+505, 14, 43, 20, $BS_BITMAP)
GUICtrlSetImage($Go, "Images\Go.bmp")
GUICtrlSetState($Go, $GUI_HIDE)
...

While 1
    $msg = GUIGetMsg()
    $Mouse = MouseGetPos()
    Select
    ...
    Case $Mouse[0] > (@DesktopWidth-500)/2+505 And $Mouse[1] > 14 And $Mouse[0] < (@DesktopWidth-500)/2+505+43 And $Mouse[1] < 14+20
        If GUICtrlGetState($Go) = 96 Then
            GUICtrlSetState($GoPic, $GUI_HIDE)
            GUICtrlSetState($Go, $GUI_SHOW)
        EndIf
    Case $Mouse[0] > (@DesktopWidth-500)/2+505 Or $Mouse[1] < 14 Or $Mouse[0] > (@DesktopWidth-500)/2+505+43 Or $Mouse[1] > 14+2  0
        If GUICtrlGetState($Go) = 80 Then
            GUICtrlSetState($Go, $GUI_HIDE)
            GUICtrlSetState($GoPic, $GUI_SHOW)
        EndIf
    Case $msg = $Go
        LoadPage()

and since i've added the Case lines, where $Mouse[0] and $Mouse[1] are requested if theyre over the go button, i can't close the program anymore and the go button don't works right...

Edited by Lord_Doominik

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

aahhhm, no, it's inserted... i don't forgot it, cause don't wanted to copy here my empty project, which has too many lines...

thats not the reason :)... if taht was the failure in my program the program weren't able to be run.

Edited by Lord_Doominik

Share this post


Link to post
Share on other sites

I would suggust attaching source file, ppl can comment out commands and put msgbox's or consolewrites to debug where needed.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

whaaa, if i usse the debugger from scite i got 100 errors... o.O

and i know in which line the error is, but not how to fix it...

yeah, i got it without the debuggers... i don't know why, but i had to set the

Case $Mouse[0] > (@DesktopWidth-500)/2+505 And $Mouse[1] > 14 And $Mouse[0] < (@DesktopWidth-500)/2+505+43 And $Mouse[1] < 14+20
        If GUICtrlGetState($Go) = 96 Then
            GUICtrlSetState($GoPic, $GUI_HIDE)
            GUICtrlSetState($Go, $GUI_SHOW)
        EndIf
    Case $Mouse[0] > (@DesktopWidth-500)/2+505 Or $Mouse[1] < 14 Or $Mouse[0] > (@DesktopWidth-500)/2+505+43 Or $Mouse[1] > 14+2  0
        If GUICtrlGetState($Go) = 80 Then
            GUICtrlSetState($Go, $GUI_HIDE)
            GUICtrlSetState($GoPic, $GUI_SHOW)
        EndIf

lines to the end of my code...

Edited by Lord_Doominik

Share this post


Link to post
Share on other sites

this was the best i could do with it.... hope it helps

#include <GUIConstants.au3>


;MainGUI
$MainGUI = GUICreate("Doom Browser", 800, 600,(@DesktopWidth-800)/2, (@DesktopHeight-600)/2 , $WS_MAXIMIZE)


;Buttons
$GoPic = GUICtrlCreatePic("C:\Temp\Go.bmp", (@DesktopWidth-500)/2+505, 14, 43, 20)
$Go = GUICtrlCreateButton("Go", (@DesktopWidth-500)/2+505, 14, 43, 20, $BS_BITMAP)
GUICtrlSetImage($Go, "C:\Temp\Go.bmp")
;GUICtrlSetState($Go, $GUI_HIDE)

GUISetState()
While 1
    $msg = GUIGetMsg()
    
    $Mouse = MouseGetPos()
   
    
    If $Mouse[0] > (@DesktopWidth-500)/2+505 And $Mouse[1] > 35 And $Mouse[0] < (@DesktopWidth-500)/2+505+43 And $Mouse[1] < 35+20 Then
        GUICtrlSetState($GoPic, $GUI_HIDE)
        GUICtrlSetState($Go, $GUI_SHOW)
    Else
        Sleep(100)
        GUICtrlSetState($Go, $GUI_HIDE)
        GUICtrlSetState($GoPic, $GUI_SHOW)
    EndIf
  
    If $msg = $Go Then
       ;LoadPage()
        MsgBox(0,"test", " go button functions ")
    EndIf
    Sleep(100)
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Your using the wrong function :), try this (using GUIGetCursorInfo()).

$MainGUI = GUICreate("Doom Browser", 800, 600,(@DesktopWidth-800)/2, (@DesktopHeight-600)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_MAXIMIZE)

$GoPic = GUICtrlCreatePic("Images\Go.bmp", (@DesktopWidth-500)/2+505, 14, 43, 20)
$Go = GUICtrlCreateButton("Go", (@DesktopWidth-500)/2+505, 14, 43, 20, $BS_BITMAP)

GUICtrlSetImage($Go, "Images\Go.bmp")
GUICtrlSetState($Go, $GUI_HIDE)

While 1
   $Over = GUIGetCursorInfo
   $Msg = GUIGetMsg()
   Select
      Case $Over[4] = $Go
         If GUICtrlGetState($Go) = 96 Then
            GUICtrlSetState($GoPic, $GUI_HIDE)
            GUICtrlSetState($Go, $GUI_SHOW)
         ElseIf GUICtrlGetState($Go) = 80 Then
            GUICtrlSetState($Go, $GUI_HIDE)
            GUICtrlSetState($GoPic, $GUI_SHOW)
         EndIf
      Case $msg = $Go
         LoadPage()
    ;...
 ;...
;...

That's probably not 100% correct because I didn't bother testing your first code so I'm wasn't quite sure what all the @DesktopWidth / * - stuff was and the difference between the cases of < > and "And" from "Or". Look in the help file for GUIGetCursorInfo() for more information.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

ähhhm, no your function is wrong... my scritp works no fine and GUIGetCursorInfo() returns the cursor, but not the positions... you need that function if you set different cursors, like the questionmark curser or something else... and next time read the answers... i solved the problem by myself...

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

?

and since i've added the Case lines, where $Mouse[0]and $Mouse[1] are requested if theyre over the go button, i can't close the program anymore and the go button don't works right...

GUIGetCursorInfo() is the appropriate function to use in this case. As stated above, in your first post, you are looking to see if your cursor is over the 'go' button. The fourth element contain's the controlID that the cursor is currently over and will work.

As for...

returns the cursor, but not the positions... you need that function if you set different cursors, like the questionmark curser or something else... and next time read the answers... i solved the problem by myself...

1. You are wrong so please don't say my script is.

2. Did you even bother to look in the help file under GUIGetCursorInfo()? I think not, and if you did you must of forgotten your eyes.

From the help file:

Return Value

If successful, returns a two-element array that containing the cursor information:

$array[0] = X coord (horizontal)

$array[1] = Y coord (vertical)

$array[2] = Primary down (1 if pressed, 0 if not pressed)

$array[3] = Secondary down (1 if pressed, 0 if not pressed)

$array[4] = ID of the control that the cursor is hovering over (or 0 if none)

Note: "returns a two-element" should be "returns a four-element", it is a small help file type which I will submit after this post.

What was that you were saying? Thats right...

returns the cursor, but not the positions

But wait! Whats this in the help file? OMG! The function I am talking about, the one you say doesn't return the mouse postion DOES return the mouse position... interesting.

3.

you need that function if you set different cursors, like the questionmark curser or something else

You have no idea what you are taking about, the information returned from GUIGetCursorInfo() has absolutly nothing to do with setting different cursor's. I think you are getting mixed up with the MouseGetCursor() function, adding the the lack of knowledge you are showing.

And finally 4. You should be, at the very least, grateful for my assistance, not only did I assist but I also provided you with a better solution that you currently have. FYI I did read all the post's, perhap's you should study the english langauge and learn how to contruct a sentence with meaning. You did not say directly you had solved the problem, you miss led me and Valuater into thinking that there was still infact a problem at hand to be solved.

Summing up, you are an idiot. Don't critisize me or other's for helping you, the least we could do is nothing, which is what I will be doing next time. And how about you actually do some reading before posting? This would save me the time of writing the above post and stop yourself from responding like an idiot.

Goodbye.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Typically I try to avoid participating in an argument but I'd like to point a couple things out.

Lord_Doominik, you did not clearly state anywhere in this thread that you had reached a solution. Please do not suggest that people have not read something correctly -- even if it's true, no one wants to be told this. Also please remember that no one here is obligated to help you so please show respect to anyone who does take the time.

Burrup, it's probably a good idea never to insult someone's understanding of English unless you are 110% certain that they are a native English speaker. Understandably those of us for whom English is not our native language are bound to be vague, not make sense or even at times seem pushy or rude -- we should always give them the benefit of doubt.

And besides, what if we aren't exactly English professors anyway? :)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

sure i clearly said that i solved it:

whaaa, if i usse the debugger from scite i got 100 errors... o.O

and i know in which line the error is, but not how to fix it...

yeah, i got it without the debuggers... i don't know why, but i had to set the

CODE

Case $Mouse[0] > (@DesktopWidth-500)/2+505 And $Mouse[1] > 14 And $Mouse[0] < (@DesktopWidth-500)/2+505+43 And $Mouse[1] < 14+20

        If GUICtrlGetState($Go) = 96 Then

            GUICtrlSetState($GoPic, $GUI_HIDE)

            GUICtrlSetState($Go, $GUI_SHOW)

        EndIf

    Case $Mouse[0] > (@DesktopWidth-500)/2+505 Or $Mouse[1] < 14 Or $Mouse[0] > (@DesktopWidth-500)/2+505+43 Or $Mouse[1] > 14+2  0

        If GUICtrlGetState($Go) = 80 Then

            GUICtrlSetState($Go, $GUI_HIDE)

            GUICtrlSetState($GoPic, $GUI_SHOW)

        EndIf

lines to the end of my code...

This post has been edited by Lord_Doominik: Jul 14 2005, 06:35 PM

and NO i don't need that function... look at my script and oh, what's this it works without this function...

but sry, yes i was looking after the mousegetcursor() function, and not the one you mean... but i said that everything works fine now... but i edited my post, because i don't wanted to have a multipost and 4 minutes later you've posted your answer... so i guess you don't read my edited post...

but whoa... you needn't get rude and flame because my english sucks...

oh looooooool, now i've tested your v. and it don't works... oh loool... i first had to change it into this, but now the buttons don't appear... my problem had nothing to do with your solution:

While 1
    $Mouse = GUIGetCursorInfo()
    $msg = GUIGetMsg()
    Select
    Case $Mouse[4] = $Go
         If GUICtrlGetState($Go) = 96 Then
            GUICtrlSetState($GoPic, $GUI_HIDE)
            GUICtrlSetState($Go, $GUI_SHOW)
        EndIf
    Case $Mouse[4] <> $Go
        If GUICtrlGetState($Go) = 80 Then
            GUICtrlSetState($Go, $GUI_HIDE)
            GUICtrlSetState($GoPic, $GUI_SHOW)
         EndIf
    Case $msg = $Go
        LoadPage()
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $FileClose
        ExitLoop
    EndSelect
WEnd
Exit
Edited by Lord_Doominik

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

YOU DID NOT CLEARLY STATE THE PROBLEM HAD BEEN SOLVED.

whaaa, if i usse the debugger from scite i got 100 errors... o.O

and i know in which line the error is, but not how to fix it...

yeah, i got it without the debuggers... i don't know why, but i had to set the

Why is that line bold? Do you think that is the line that supports you? No. Do you realise what your post said? It says you have a problem, then 2 lines down it says you don't. What are we supposed to think? You say you edited your post but how are we supposed to know what you changed, you could have just changed a small typo. Maybe you should do what most people do and have something like "Edit:" so we know that you have infact changed something or you are giving updated information, SUCH AS THERE IS NO PROBLEM. You did not do any of this, leaving me with the impression of a problem.

I am trying to help you... do you not see that.

That's probably not 100% correct because I didn't bother testing your first code so I'm wasn't quite sure what all the @DesktopWidth / * - stuff was and the difference between the cases of < > and "And" from "Or". Look in the help file for GUIGetCursorInfo() for more information.

This is at the end of my original reply, I did not confirm that it WOULD work or that it is what you are trying to do. I am simply providing you with a BETTER solution to your problem then you have. If you are using @DesktopWidth - Hieght of Button / X * Y or similar as a method to found out if your cursor is over a button then you are an idiot.

I am over replying to your useless posts, I offered you a small idea/script that if used and modifed correctly, which obviously you can't do, it is guaranteed to be a wiser and more logical solution then your current method of 'making a hole in the wall when there is a door right next to you'.

If you don't want my help then tell me. If you were able to follow simple procedure to notify the other user when you have edited your post, we wouldn't be having this discussion.

Please let this be a lesson to you, this is the last you will hear from me on the topic.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

do you know a button called EDIT? at the end of the post is written, that the post has been edited by me on...

you don't help me you flame at me... sure, it is a better solution, if it would work... i tryed to edit the code so often, but the buttons don't show... my script worked and your don't why should i take yours...

Share this post


Link to post
Share on other sites

I can not believe that I am actaully going to reply to this again. Just when I think I've read the stupidest post ever, you go and post another one.

You are the most arrogant, idioc person I have ever met. Are you mentally retarded? Do you have some type of disabilty that prevent's you from thinking logically? You must have sub-normal IQ.

Every word you type you just make yourself look more like a fool adding to the lack of knowledge you are already showing.

do you know a button called EDIT? at the end of the post is written, that the post has been edited by me on...

<{POST_SNAPBACK}>

ARE YOU STUPID, omfg I can't comprehend how stupid you are.

You say you edited your post but how are we supposed to know what you changed, you could have just changed a small typo. Maybe you should do what most people do and have something like "Edit:" so we know that you have infact changed something or you are giving updated information, SUCH AS THERE IS NO PROBLEM. You did not do any of this, leaving me with the impression of a problem.

<{POST_SNAPBACK}>

Did you even bother to read my post! Can't you realise that I'm telling you that we had no way off telling the problem had been fixed. YOU SAY YOU EDITED YOUR POST BUT YOU COULD OF CHANGED ANYTHING, like I said before, something as small as a typo. READ, dear god READ.

If you don't want my help then tell me. If you were able to follow simple procedure to notify the other user when you have edited your post, we wouldn't be having this discussion.

Please let this be a lesson to you, this is the last you will hear from me on the topic.

<{POST_SNAPBACK}>

Obvisouly this lesson is too much for your brain capacity to handle.

you don't help me you flame at me... sure, it is a better solution, if it would work... i tryed to edit the code so often, but the buttons don't show... my script worked and your don't why should i take yours...

<{POST_SNAPBACK}>

I feel like throwing a brick at my computer screen in an attempt to release the frustration I am in. I AM helping you, at least I was trying before, and I told you, if you don't want my help, TELL ME, but then again speaking at a normal human level must be out of your league aswell. I am not telling you to take mine, WHEN DID I EVER SAY THAT! I am simply offering a better solution then you have, but again OBVIOUSLY changing a couple lines of code puts you into an epileptic fit and you can't do it.

In future, wake up the dozy peglegged hamster operating that wheel-powered brain of yours before you start typing.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

i don't need to read your posts... i dont read posts in which only is flamed...

and yes, i don't want your help anymore ok? why are you posting again and again... 3 posts above you already said that this is your last post...

omg, why do you read my answers? it's so funny to write with you, cause you get sooo angry... whats about ignoring me?

:)

-----------------------------------------------------------------------------------------------------

EDIT

-----------------------------------------------------------------------------------------------------

aaand ahem... another thing... can some admin plz close this stupid thread? thx ^^

Edited by Lord_Doominik

Share this post


Link to post
Share on other sites

It seems your fingers not only did your typing, but did your thinking too. I'll consider letting you have the last word if you guarantee it will be your last. I suggest you need Mark Twain's advice; "It is better to be silent and be thought a fool, than to speak and remove all doubt.", whoops too late...


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

It seems your fingers not only did your typing, but did your thinking too. I'll consider letting you have the last word if you guarantee it will be your last. I suggest you need Mark Twain's advice; "It is better to be silent and be thought a fool, than to speak and remove all doubt.", whoops too late...

<{POST_SNAPBACK}>

another quote i like.... "Don't argue with a fool. The spectators can't tell the difference. " i think twain said that one too, but not 100% sure on that one...

i have to say i definitely think doom got rude first with the 'next time read the answers'. definitely not something i'd ever say to someone offering any kind of advice, especially if i had as many help requests out as he does...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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