System s Rmn `D|D| to handle buttondown show item 2 of objects of self hide item 3 of objects of self send mybuttondown to self to handle buttonup show item 3 of objects of self hide item 2 of objects of self set focus to item 1 of objects of item 3 of objects of self --!!! send mybuttonup to self to handle mybuttonup --put your buttonup script here to handle mybuttondown --put your buttondown script here to handle buttondown show item 2 of objects of parent of self hide self forward to handle buttonup show target hide item 2 of objects of parent of self set focus to item 1 of parent of target to handle buttondown system btarget set btarget to target show item 2 of objects of parent of parent of btarget hide parent of btarget forward to handle buttonup system btarget show parent of btarget hide item 2 of objects of parent of parent of btarget set focus to item 1 of parent of btarget forward 0,50.1875,0 0,100,0 0,50.1875,0 group group animatescript to handle buttondown system btarget set btarget to target show item 2 of objects of parent of parent of btarget hide parent of btarget forward to handle buttonup system btarget show parent of btarget hide item 2 of objects of parent of parent of btarget set focus to item 1 of objects of parent of btarget forward to handle buttondoubleclick system btarget set btarget to target show item 2 of objects of parent of parent of btarget hide parent of btarget forward 4appname toolbook temp activateinstance author enterbook reader activateinstance enterbook reader sizetopage appname uniquename of this book appname toolbook appname author sizetopage reader sizetopage activateinstance appname syswindowhandle appname uniquename of this book appname toolbook appname smallbounds "littlebounds 75,129,565,350 155,383,491,479 155,383,491,479 &171,392,507,488 enterbook Draw 3D button L b animatescript2 e"Draw 3D uttondoubleclick rightbuttondoubleclick enterbook rightbuttondoubleclick button enterbook Draw 3D button system bob,x,y,ra,ul,ur,ll,lr,fa,a,b,c,ga,gb,fa,fb,s,bg,boblayer,animatescript,ts;set bob to s;set x to bounds of bob;set y to bounds of bob;set syslockscreen to true;draw rectangle from (items 1 to 2 of x) to (items 3 to 4 of x);set ra to selection;set fillcolor of ra to "0,75.3125,0";increment item 1 of x by 30;increment item 2 of x by 30;decrement item 3 of x by 15;decrement item 4 of x by 15;set ul to items 1 to 2 of x;set ur to item 3 of x & "," & item 2 of x;set ll to item 1 of x & "," & item 4 of x;set lr to items 3 to 4 of x;draw button from ul to (items 3 to 4 of y);set fa to selection;set highlight of fa to false;set fillcolor of fa to "0,75.3125,0";set borderstyle of fa to "none";set fontsize of fa to fontsize of bob;set fontface of fa to fontface of bob;set fontstyle of fa to fontstyle of bob;set caption of fa to caption of bob;draw angledline from ((item 1 of ll - 15) &"," & (item 2 of ll)) to ((item 1 of ul - 15)&","&(item 2 of ul-15)) to ((item 1 of ur+15)&","&(item 2 of ur - 15));set a to selection;set strokecolor of a to "0,50.1875,0";set linestyle of a to 1;select fa;extend select a;send group;set ga to selection;draw button from (items 1 to 2 of y) to (items 3 to 4 of y);set fb to selection;set highlight of fb to false;set fillcolor of fb to "0,75.3125,0";set borderstyle of fb to "rectangle";set fontsize of fb to fontsize of bob;set fontface of fb to fontface of bob;set name of fb to name of bob;set fontstyle of fb to fontstyle of bob;set caption of fb to caption of bob;draw angledline from ll to lr to ur;set a to selection;set linestyle of a to 2;set strokecolor of a to "0,50.1875,0";draw angledline from ll to ul to ur;set b to selection;set strokecolor of b to white;set linestyle of b to 2;draw angledline from ll to lr to (item 1 of ur&","&item 2 of ur -20);set c to selection;set linestyle of c to 1;set strokecolor of c to "0,50.1875,0";select fb;extend select a;extend select b;extend select c;send group;set gb to selection;select ra;extend select ga;extend select gb;send group;set bg to selection;set script of selection to script of bob;hide item 2 of objects of selection;set animatescript to "to handle buttondown;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end" & crlf &"to handle buttonup;system btarget;show parent of btarget;hide item 2 of objects of parent of parent of btarget;set ts to syssuspend;set syssuspend to false;set focus to item 1 of objects of parent of btarget;set syssuspend to ts;forward;end"&crlf&"to handle buttondoubleclick;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end";set script of gb to animatescript;select bob;set boblayer to layer of bob;set name of bg to name of bob;send clear;set layer of bg to boblayer &ubleclick;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end";set script of gb to animatescript;select bob;set boblayer to layer of bob;set name of bg to name of bob;send clear;set layer of bg to boblayer 8,o target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end" & crlf &"to handle buttonup;system btarget;show parent of btarget;hide item 2 of objects of parent of parent of btarget;set focus to item 1 of objects of parent of btarget;forward;end"&crlf&"to handle buttondoubleclick;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end" system gb,animatescript;set script of gb to animatescript system bob;select bob send clear system gb,animatescript;set script of gb to animatescript system bob;select bob send clear e"Draw 3D enterbook enterbook Draw 3D button System 195,377,531,473 -- Joseph Brick -- 2/91 4appname toolbook temp activateinstance author enterbook reader activateinstance enterbook reader sizetopage appname uniquename of this book appname toolbook appname author sizetopage reader sizetopage activateinstance appname syswindowhandle appname uniquename of this book appname toolbook appname 155,182,491,319 &to selection;set highlight of fb to false;set fillcolor of fb to "0,75.3125,0";set borderstyle of fb to "rectangle";set fontsize of fb to fontsize of bob;set fontface of fb to fontface of bob;set name of fb to name of bob;set fontstyle of fb to fontstyle of bob;set caption of fb to caption of bob;draw angledline from ll to lr to ur;set a to selection;set linestyle of a to 2;set strokecolor of a to "0,50.1875,0";draw angledline from ll to ul to ur;set b to selection;set strokecolor of b to white;set linestyle of b to 2;draw angledline from ll to lr to (item 1 of ur&","&item 2 of ur -20);set c to selection;set linestyle of c to 1;set strokecolor of c to "0,50.1875,0";select fb;extend select a;extend select b;extend select c;send group;set gb to selection;select ra;extend select ga;extend select gb;send group;set bg to selection;set script of selection to script of bob;hide item 2 of objects of selection;set animatescript to "to handle buttondown;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end" & crlf &"to handle buttonup;system btarget;show parent of btarget;hide item 2 of objects of parent of parent of btarget;set ts to syssuspend;set syssuspend to false;set focus to item 1 of objects of parent of btarget;set syssuspend to ts;forward;end"&crlf&"to handle buttondoubleclick;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end";set script of gb to animatescript;select bob;set boblayer to layer of bob;set name of bg to name of bob;send clear;set layer of bg to boblayer activateinstance author enterbook reader activateinstance enterbook reader sizetopage appname uniquename of this book appname toolbook appname author sizetopage reader sizetopage activateinstance appname syswindowhandle appname uniquename of this book appname toolbook appname P2of this book appname appname toolbook author sizetopage reader sizetopage activateinstance syswindowhandle appname toolbook appname `D|D| `D|D| `D|D| activateinstance author enterbook reader activateinstance enterbook reader sizetopage appname uniquename of this book appname toolbook appname author sizetopage reader sizetopage activateinstance appname syswindowhandle appname toolbook appname x0 of objects of parent of btarget;forward;end"&crlf&"to handle buttondoubleclick;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end";set script of gb to animatescript;select bob;set boblayer to layer of bob;set name of bg to name of bob;send clear;set layer of bg to boblayer |6doit2 system bob,x,y,ra,ul,ur,ll,lr,fa,a,b,c,ga,gb,fa,fb,s,bg,boblayer,animatescript,ts;set bob to s;set x to bounds of bob;set y to bounds of bob;set syslockscreen to true;draw rectangle from (items 1 to 2 of x) to (items 3 to 4 of x);set ra to selection;set fillcolor of ra to "0,75.3125,0";increment item 1 of x by 30;increment item 2 of x by 30;decrement item 3 of x by 15;decrement item 4 of x by 15;set ul to items 1 to 2 of x;set ur to item 3 of x & "," & item 2 of x;set ll to item 1 of x & "," & item 4 of x;set lr to items 3 to 4 of x;draw button from ul to (items 3 to 4 of y);set fa to selection;set highlight of fa to false;set fillcolor of fa to "0,75.3125,0";set borderstyle of fa to "none";set fontsize of fa to fontsize of bob;set fontface of fa to fontface of bob;set fontstyle of fa to fontstyle of bob;set caption of fa to caption of bob;draw angledline from ((item 1 of ll - 15) &"," & (item 2 of ll)) to ((item 1 of ul - 15)&","&(item 2 of ul-15)) to ((item 1 of ur+15)&","&(item 2 of ur - 15));set a to selection;set strokecolor of a to "0,50.1875,0";set linestyle of a to 1;select fa;extend select a;send group;set ga to selection;draw button from (items 1 to 2 of y) to (items 3 to 4 of y);set fb to selection;set highlight of fb to false;set fillcolor of fb to "0,75.3125,0";set borderstyle of fb to "rectangle";set fontsize of fb to fontsize of bob;set fontface of fb to fontface of bob;set name of fb to name of bob;set fontstyle of fb to fontstyle of bob;set caption of fb to caption of bob;draw angledline from ll to lr to ur;set a to selection;set linestyle of a to 2;set strokecolor of a to "0,50.1875,0";draw angledline from ll to ul to ur;set b to selection;set strokecolor of b to white;set linestyle of b to 2;draw angledline from ll to lr to (item 1 of ur&","&item 2 of ur -20);set c to selection;set linestyle of c to 1;set strokecolor of c to "0,50.1875,0";select fb;extend select a;extend select b;extend select c;send group;set gb to selection;select ra;extend select ga;extend select gb;send group;set bg to selection;set script of selection to script of bob;hide item 2 of objects of selection;set animatescript to "to handle buttondown;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end buttondown"&crlf&"to handle buttonup loc;system btarget;set mp to objectfrompoint(loc);show parent of btarget;hide item 2 of objects of parent of parent of btarget;set ts to syssuspend;set syssuspend to false;set focus to item 1 of objects of parent of btarget;set syssuspend to ts;if mp is not null and parent of mp = item 2 of objects of parent of parent of btarget;forward;end;clear btarget;end buttonup"&crlf&"to handle buttondoubleclick;system btarget;set btarget to target;show item 2 of objects of parent of parent of btarget;hide parent of btarget;forward;end buttondoubleclick"&crlf&"to handle buttonstilldown loc;system btarget;if btarget is null;break;end;set mp to objectfrompoint(loc);if visible of item 2 of objects of parent of parent of btarget;if mp is null or parent of mp <> item 2 of objects of parent of parent of btarget;show parent of btarget;hide item 2 of objects of parent of parent of btarget;set ts to syssuspend;set syssuspend to false;set focus to item 1 of objects of parent of btarget;set syssuspend to ts;forward;end;else;if mp is not null and parent of mp = parent of btarget and mp <> item 4 of objects of parent of btarget and mp <> item 2 of objects of parent of btarget;show item 2 of objects of parent of parent of btarget;hide parent of btarget;end;end;end";set script of gb to animatescript;select bob;set boblayer to layer of bob;set name of bg to name of bob;send clear;set layer of bg to boblayer Gloc,s,c littlebounds help 7200,2880 buttonup buttonup author littlebounds sizetopage 4btarget; Gloc; objectfrompoint( mp = mp <> mp = mp <> mp <> buttonup buttondown buttondoubleclick buttonstilldown buttondown btarget buttonup btarget buttondoubleclick btarget buttonstilldown btarget activateinstance 4appname toolbook " && s bobsdad s = " "&& s B"allowcancel" = doit doit2 X"user" gsetactivewindow( showwindow( >wh,1) buttonup buttonup activateinstance buttonup appname selection parent of button system s;set s to allowcancel doit2 setactivewindow showwindow syswindowhandle setactivewindow showwindow bobsdad toolbook appname Convert to 3-D 4btarget; Gloc; objectfrompoint( mp = mp <> mp = mp <> mp <> buttonup buttondown buttondoubleclick buttonstilldown buttondown btarget buttonup btarget buttondoubleclick btarget buttonstilldown btarget Convert to 3-D Allowcancel Allow cancel mybuttondown --!!! mybuttonup your buttonup buttondown mybuttonup mybuttondown buttondown Hmybuttondown buttonup mybuttonup mybuttonup mybuttondown Button Button Button Button appname X"tbkfile.dll" fileExists( 4appname ("Enter the ToolBook 8containing B." \ c".") ".TBK" && "does xexist." toolbook 0.exe" && buttonup buttonup tbkfile.dll fileExists appname Enter the name of the ToolBook book containing the button. appname fileExists does not exist. appname syswindowhandle appname toolbook.exe appname toolbook appname Book name Overview This book converts buttons in an existing book to "3-D" buttons without changing the action assigned to the original button. If you check the "Allow cancel" button, the 3-D button that gets created will not execute your buttonUp handler if the user moves the mouse pointer away from the button before releasing the mouse button. How to get started Ensure that both this book and your book are running at the same time. If the name of your book does not already appear in the field labeled "Book name," enter the name of your book. Arrange your ToolBook sessions in such a way that you have access to the "Convert to 3-D" button as you view your book. How to convert a button Before converting a button in your book, first set it to the desired size and give it the appropriate caption. To change the button, select it in the Author mode, and then press the "Convert to 3-D" button in this book. You can change several buttons at once by selecting many of them before pressing the "Convert to 3-D" button. If you select an object that is not a button, that object will be ignored. This book makes no attempt to convert buttons that are part of a group. Notes This book converts buttons by drawing and grouping several objects. It assigns the script, fontsize, fontface, fontstyle, caption and name of your original button to the new group, and then deletes the original button. The conversion process does not attempt to deal with any user-defined properties that your old button might have held. If you are using the "Allow cancel" option, be aware that only the buttonUp message gets cancelled (by moving the mouse cursor away from the button before releasing). The buttonDown and buttonDoubleClick messages are always sent. This book was intended for VGA use only. Windows 3-D buttons are different in EGA. If any of your buttons call up a dialog box (by using the "request" or "ask" commands, for example), be sure to use a buttonUp handler. If you call a dialog box with a buttonDown handler, the buttonUp message will be eaten by the dialog box, and you'll end up with a 3-D button that is stuck in the down position. Since the script of your old button is now in the group script for the 3-D button, you can easily edit the script. If you wish to change the caption, do not ungroup the button. Select the group, bring up the command window, and enter the command set caption of selection to "whatever" Do not attempt to resize a 3-D button once it has been created. These buttons are not designed to resize gracefully. Since your original button does get deleted, you should make a backup of your book before you make any conversions... "6UX8 "help" 4896,1008 littlebounds buttonup buttonup littlebounds 4btarget; uttondown buttonup buttondown buttondoubleclick buttondown btarget buttonup btarget buttondoubleclick btarget "b(7@ B `5@ & +"bTaR