Re: Help! Drawing in Wingz/Hyperscript in a dialog box
Posted in 1994
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL
raymond.bowers@wdn.com (Raymond Bowers) writes: > I need help with Wingz 1.1, specifically writing something in Hyperscript. > I have a dialog box with several buttons in it. Now I need to add an >new customized button what looks like a submarine. Nothing fancy, basically >a simple circle, with a small rectangle on the top and two little triangles >coming off the rectangle to the sides . . . > I've been programming in Hyperscript now for two years, but I have never >had to do drawing in a dialog box, and I need help. > Before trying to draw a submarine, I had tried adding arrow heads to some >lines in a dialog box. I created a button, got rid of its border and fill, >and attached the following script to it: > script "on repaint >square window (1, 1) (10, 10) >line width 50 >fill bg Black() >fill fg Black() >fill pattern 19 >move ( 1, 10) >draw (10, 5) >draw ( 1, 1) >draw ( 1, 10) >move ( 3, 7) >draw ( 6, 5) >draw ( 3, 3) >end repaint" > Not pretty, but it made a simple filled arrow head for me. I had thought >there was a way to tell Hyperscript to add the arrow head automatically, but >I couldn't figure it out. I realize there are some things that work in a >sheet but not in a dialog box. Figured this was one of them . . . > So anyways, am I doing this right? Do I have to fit ALL of the commands >to draw in the thing in a single 255 character script attached to the >button!?!?!? Or is there an easier way?!?!?! You are correct. Custom buttons are drawn within a repaint event handler on their script. In Wingz 1.1, strings are limited to 255 characters, and hence scripts attached to dialog boxes, controls, and menuitems are limited to 255 characters (sinc you use a HyperScript string). > Help! Please! The commands provided to draw stuff in a dialog box >are not fun! If anyone knows just what I need to do to make the circle, >I will take it from there! This 255 character limit may cause problems. >If all else fails, I could just make the sub out of several small graphics >and put an invisiable button over the whole thing when I am done. I don't >really care how kludgy the whole thing is, looks are more important at >this point - my sanity as well as the code's readability and elegance are not >a priority. What platform are you running under? If you are on Windows or UNIX Motif (Sun, HP, IBM), I would highly recommend upgrading to HyperScript Tools. HSTools is a significant upgrade from Wingz 1.1a; it adds hundreds of new commands and functions, user-interface painters for dialog boxes, menus, and portfolios ("screens"), spreadsheet improvements, an interactive debugger, embedded SQL, etc...... HSTools provides a number of improvements for what you're trying to do. For example, you can read a bitmap file into a picture library, and use a single command: DRAW PICTURE in your repaint event. HSTools also lets you specify scripts that are longer than 255 characters by supplying multiple strings. >Thanks! >raymond.bowers@wdn.com Paul Christensen Sr. CSE, Informix Software Somerset, NJ