home *** CD-ROM | disk | FTP | other *** search
/ Wacky Windows Stuff... / WACKY.iso / toolbook / 3d.tbk (.txt) next >
Asymetrix ToolBook File  |  1991-02-05  |  36KB  |  390 lines

  1. System
  2. s Rmn
  3. `D|D|
  4. to handle buttondown
  5.     show item 2 of objects of self
  6.     hide item 3 of objects of self
  7.     send mybuttondown to self
  8. to handle buttonup
  9.     show item 3 of objects of self
  10.     hide item 2 of objects of self
  11.     set focus to item 1 of objects of item 3 of objects of self --!!!
  12.     send mybuttonup to self
  13. to handle mybuttonup
  14.     --put your buttonup script here
  15. to handle mybuttondown
  16.     --put your buttondown script here
  17. to handle buttondown
  18.     show item 2 of objects of parent of self
  19.     hide self
  20.     forward
  21. to handle buttonup
  22.     show target
  23.     hide item 2 of objects of parent of self
  24.     set focus to item 1 of parent of target
  25. to handle buttondown
  26.     system btarget
  27.     set btarget to target
  28.     show item 2 of objects of parent of parent of btarget
  29.     hide parent of btarget
  30.     forward
  31. to handle buttonup
  32.     system btarget
  33.     show parent of btarget
  34.     hide item 2 of objects of parent of parent of btarget
  35.     set focus to item 1 of parent of btarget
  36.     forward
  37. 0,50.1875,0
  38. 0,100,0
  39. 0,50.1875,0
  40. group
  41. group
  42. animatescript
  43. to handle buttondown
  44.     system btarget
  45.     set btarget to target
  46.     show item 2 of objects of parent of parent of btarget
  47.     hide parent of btarget
  48.     forward
  49. to handle buttonup
  50.     system btarget
  51.     show parent of btarget
  52.     hide item 2 of objects of parent of parent of btarget
  53.     set focus to item 1 of objects of parent of btarget
  54.     forward
  55. to handle buttondoubleclick
  56.     system btarget
  57.     set btarget to target
  58.     show item 2 of objects of parent of parent of btarget
  59.     hide parent of btarget
  60.     forward
  61. 4appname
  62.  toolbook
  63. temp 
  64. activateinstance
  65. author
  66. enterbook
  67. reader
  68. activateinstance
  69. enterbook
  70. reader
  71. sizetopage
  72. appname
  73. uniquename of this book
  74. appname
  75. toolbook
  76. appname
  77. author
  78. sizetopage
  79. reader
  80. sizetopage
  81. activateinstance
  82. appname
  83. syswindowhandle
  84. appname
  85. uniquename of this book
  86. appname
  87. toolbook
  88. appname
  89. smallbounds
  90. "littlebounds
  91. 75,129,565,350
  92. 155,383,491,479
  93. 155,383,491,479
  94. &171,392,507,488
  95. enterbook
  96. Draw 3D button
  97. L    b    animatescript2
  98. e"Draw 3D 
  99. uttondoubleclick
  100. rightbuttondoubleclick
  101. enterbook
  102. rightbuttondoubleclick
  103. button
  104. enterbook
  105. Draw 3D button
  106. 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
  107. &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
  108. 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"         
  109. system gb,animatescript;set script of gb to animatescript
  110. system bob;select bob
  111. send clear
  112. system gb,animatescript;set script of gb to animatescript
  113. system bob;select bob
  114. send clear
  115. e"Draw 3D 
  116. enterbook
  117. enterbook
  118. Draw 3D button
  119. System
  120. 195,377,531,473
  121. -- Joseph Brick
  122. -- 2/91
  123. 4appname
  124.  toolbook
  125. temp 
  126. activateinstance
  127. author
  128. enterbook
  129. reader
  130. activateinstance
  131. enterbook
  132. reader
  133. sizetopage
  134. appname
  135. uniquename of this book
  136. appname
  137. toolbook
  138. appname
  139. author
  140. sizetopage
  141. reader
  142. sizetopage
  143. activateinstance
  144. appname
  145. syswindowhandle
  146. appname
  147. uniquename of this book
  148. appname
  149. toolbook
  150. appname
  151. 155,182,491,319
  152. &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
  153. activateinstance
  154. author
  155. enterbook
  156. reader
  157. activateinstance
  158. enterbook
  159. reader
  160. sizetopage
  161. appname
  162. uniquename of this book
  163. appname
  164. toolbook
  165. appname
  166. author
  167. sizetopage
  168. reader
  169. sizetopage
  170. activateinstance
  171. appname
  172. syswindowhandle
  173. appname
  174. uniquename of this book
  175. appname
  176. toolbook
  177. appname
  178. P2of this book
  179. appname
  180. appname
  181. toolbook
  182. author
  183. sizetopage
  184. reader
  185. sizetopage
  186. activateinstance
  187. syswindowhandle
  188. appname
  189. toolbook
  190. appname
  191. `D|D|
  192. `D|D|
  193. `D|D|
  194. activateinstance
  195. author
  196. enterbook
  197. reader
  198. activateinstance
  199. enterbook
  200. reader
  201. sizetopage
  202. appname
  203. uniquename of this book
  204. appname
  205. toolbook
  206. appname
  207. author
  208. sizetopage
  209. reader
  210. sizetopage
  211. activateinstance
  212. appname
  213. syswindowhandle
  214. appname
  215. toolbook
  216. appname
  217. 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
  218. |6doit2
  219. 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
  220. Gloc,s,c
  221. littlebounds 
  222. help 
  223. 7200,2880
  224. buttonup
  225. buttonup
  226. author
  227. littlebounds
  228. sizetopage
  229. 4btarget;
  230. Gloc;
  231. objectfrompoint(
  232. mp = 
  233. mp <> 
  234. mp = 
  235. mp <> 
  236. mp <> 
  237. buttonup
  238. buttondown
  239. buttondoubleclick
  240. buttonstilldown
  241. buttondown
  242. btarget
  243. buttonup
  244. btarget
  245. buttondoubleclick
  246. btarget
  247. buttonstilldown
  248. btarget
  249. activateinstance
  250. 4appname
  251.  toolbook 
  252. " && s 
  253. bobsdad 
  254. s = "
  255. "&& s 
  256. B"allowcancel" = 
  257. doit 
  258. doit2 
  259. X"user"
  260. gsetactivewindow(
  261. showwindow(
  262. >wh,1)
  263. buttonup
  264. buttonup
  265. activateinstance
  266. buttonup
  267. appname
  268. selection
  269. parent of
  270. button
  271. system s;set s to
  272. allowcancel
  273. doit2
  274. setactivewindow
  275. showwindow
  276. syswindowhandle
  277. setactivewindow
  278. showwindow
  279. bobsdad
  280. toolbook
  281. appname
  282. Convert to 3-D
  283. 4btarget;
  284. Gloc;
  285. objectfrompoint(
  286. mp = 
  287. mp <> 
  288. mp = 
  289. mp <> 
  290. mp <> 
  291. buttonup
  292. buttondown
  293. buttondoubleclick
  294. buttonstilldown
  295. buttondown
  296. btarget
  297. buttonup
  298. btarget
  299. buttondoubleclick
  300. btarget
  301. buttonstilldown
  302. btarget
  303. Convert to 3-D
  304. Allowcancel
  305. Allow cancel
  306. mybuttondown 
  307. --!!!
  308. mybuttonup 
  309. your 
  310. buttonup
  311. buttondown
  312. mybuttonup
  313. mybuttondown
  314. buttondown
  315. Hmybuttondown
  316. buttonup
  317. mybuttonup
  318. mybuttonup
  319. mybuttondown
  320. Button
  321. Button
  322. Button
  323. Button
  324. appname
  325. X"tbkfile.dll"
  326. fileExists(
  327. 4appname
  328. ("Enter the 
  329. ToolBook 
  330. 8containing 
  331. B." \
  332. c".")
  333. ".TBK" 
  334.  && "does 
  335. xexist."
  336.  toolbook 
  337. 0.exe" && 
  338. buttonup
  339. buttonup
  340. tbkfile.dll
  341. fileExists
  342. appname
  343. Enter the name of the ToolBook book containing the button.
  344. appname
  345. fileExists
  346. does not exist.
  347. appname
  348. syswindowhandle
  349. appname
  350. toolbook.exe
  351. appname
  352. toolbook
  353. appname
  354. Book name
  355. Overview
  356. 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.
  357. How to get started
  358. 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.
  359. How to convert a button
  360. 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.
  361. Notes
  362. 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.
  363. 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.
  364. This book was intended for VGA use only.  Windows 3-D buttons are different in EGA.
  365. 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.
  366. 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"
  367. Do not attempt to resize a 3-D button once it has been created.  These buttons are not designed to resize gracefully. 
  368. Since your original button does get deleted, you should make a backup of your book before you make any conversions...
  369. "6UX8
  370. "help"
  371. 4896,1008
  372. littlebounds 
  373. buttonup
  374. buttonup
  375. littlebounds
  376. 4btarget;
  377. uttondown
  378. buttonup
  379. buttondown
  380. buttondoubleclick
  381. buttondown
  382. btarget
  383. buttonup
  384. btarget
  385. buttondoubleclick
  386. btarget
  387. "b(7@
  388. B    `5@
  389. & +"bTaR
  390.