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
;}
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...
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.
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.
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
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... :)