Invisible/Hidden Dialog Buttons

By Yoinx on Feb 09, 2005

This is a simple example of how you can make invisible/hidden dialog buttons. Kinda pointless in my opinion but somone asked me how to do it, so I figured someone else might get some use out of it.

;##################################
;## Hidden Dialog Button Example ##
;##        By Yoinx              ##
;##################################
alias test {
  dialog -m test test
}
dialog test {
  title "test"
  size -1 -1 105 50
  option dbu
  text "|||||||||||||", 1, 37 20 26 8
}
on *:dialog:test:dclick:0: {
  ;$inrect(x,y,x,y,w,h
  ;74,42 is the top left corner of the text box.
  ;50 is the width of the text and 10 is the height.
  if ( $inrect($mouse.x,$mouse.y,74,42,50,10) ) {
    echo -s You double clicked within the box.
    ;this is where you would put the commands you want to be
    ;executed by this hidden box instead of the echo.
    ;Also, you do not need the id or any other item in this space.
    ;I have included it simply for the example.
  }
}
;# You should uncomment this section when you want to find your start position.
;on *:dialog:test:sclick:0: {
;  ;This is just a simple event to give you the x,y postition 
;  ;of the point you want tostart your box at. 
;  Echo -s X Pos: $mouse.x Y  Pos: $mouse.y
;}

Comments

Sign in to comment.
Yoinx   -  Jul 04, 2005

it\'s been awhile since I\'ve checked the comments on any of my snippets. But, the point of this would mostly be a simple way to turn an image into a button (which mirc does\'nt have built-in support for)

 Respond  
pony   -  Mar 13, 2005

this way your not doing the comand again then dclick instead you use right click and left click

 Respond  
pony   -  Mar 13, 2005

this i have found to work better then dclick on *:dialog:test:rclick:0:

 Respond  
BlueFire   -  Feb 10, 2005

Yoinx, yea maybe i misunderstood the way this snippet works... u should put more to-the-point example... but im not really interested of the invisible button as i would prefer button where i can see it... probably more advanced user could find it much useful, as to me its kinda useless... no offense though as this is how i see it...

 Respond  
Yoinx   -  Feb 10, 2005

Bluefire, no offense but I really dont think you understand the point of the snippet. It has nothing to do with the dialog\'s position. It turns areas of the dialog into \'buttons\' (you can specify double click or single click). Hence if you wanted a text id to change when you click on it (without using a button) you could specify the area of that text field. Being that its an example is why it echoes the coordinates (I commented that out for the sclick....). I can change the code to give you a better example but this is an example not a ready to use snippet. If you want, I can put some examples that dont use the echo if that would help you. If you wanted to get the dialogs coordinates you would use $dialog(name).x/y which has nothing to do with the point of this snippet.

 Respond  
Yoinx   -  Feb 10, 2005

Bluefire, no offense but I really dont think you understand the point of the snippet. It has nothing to do with the dialog\'s position. It turns areas of the dialog into \'buttons\' (you can specify double click or single click). Hence if you wanted a text id to change when you click on it (without using a button) you could specify the area of that text field. Being that its an example is why it echoes the coordinates (I commented that out for the sclick....). I can change the code to give you a better example but this is an example not a ready to use snippet. If you want, I can put some examples that dont use the echo if that would help you. If you wanted to get the dialogs coordinates you would use $dialog(name).x/y which has nothing to do with the point of this snippet.

 Respond  
BlueFire   -  Feb 10, 2005

yea i agree, it is not completely useless... someone might find it useful... would be handy if someone wanna code position-saver in order to initiated on dialog on the last position... :)

 Respond  
splatted   -  Feb 09, 2005

it\'s not completely useless if you can think of the potential uses. I\'ve seen this sort of setup whereby positioning the mouse over different areas of the dialog, would actually change the text at the foot of the dialog giving HELP information on what each button was for.. I think tat\'s trivia does something like that from memory

 Respond  
Yoinx   -  Feb 09, 2005

btw, the point of it, is to be able to execute commands when the mouse is double clicked with a certain area of the dialog without the need to have a button/id there. Again though, I think its pointless. So I\'m just pointing out the idea of what it should do.

 Respond  
Yoinx   -  Feb 09, 2005

no, you need to use the on dialog dclick event and nest your commands within the if. Maybe I should have been more specific in the description.... The echoes are just for example/setup.

 Respond  
BlueFire   -  Feb 09, 2005

At first, i thought there is a \"hidden\" dialog button... this dialog only has 1 text and 0 dialog button so \"Hidden Dialog Button\" doesnt really matched this dialog example... i would called it \"Mouse Positioner\" or something about echo-ing the position of mouse\'s x & y... yea i agree with you coz it is pointless... :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.