[comp.lang.c] GEM/AES/VDI 'C' Sample Code Needed!!

covertr@gtephx.UUCP (Richard E. Covert) (06/07/89)

I am cross-posting this request to comp.lang.c in the slight chance that
some Atari ST C programmers might see it!!

I am trying to add a nice GEM interface to some UNIX style C programs that
I am writing and I seem to have run into a hurdle. I am having a hard time
getting used to using GEM/AES/VDI code and especially various Resource
Editors.

	I am using Mark Williams C version 3.09, which comes with its own
Resource Editor. I also bought the Kuma Resource Editor, and the Michtron
WERCS Resource Editor.

	As an example of where I am stuck I want to display a bar that fills
from left to right as I process data. The bar can be in a blank screen of its
own, but it would be nice to have a text displayed with it.

	Now, would I use a RSC editor to create the dialog box with the bar and
the text?? If so, how do I create it with the above RSC editors?? I see that
the RSC editors create a RSC and a H file. The H file contrains the 'C' variable
names for the different objects created with the RSC editor. MWC has the standard
GEM/AES/VDI libs to load the RSC file. I am just having a difficult time using the
various RSC editors to create the bar and text objects. It seems that the bar and the
text objects are children of the FORM (dialog) . 

	Also, the old TOS (1.0, 1.2) don't allow for a text string to be shown
with a file selector when fsel_input() is used. I do have a sample function written
that places a banner (one line of text) immediately above the file selector
dialog box. I am willing to post that code if anyone wants to see it.

	I guess what I am saying is that I have no difficulty inwriting standard
UNIX C programs, but I am having some trouble adding the nice GEM interfaces to
it once the UNIX version is done.

	One more thing, does anyone have any routines to add sound to C programs??
There was a program called G.I.S.T. available for the ST awhile ago, but the binaries
won't work with my current MWC C compiler. Also, does anyone have any routines
to add graphics, such as a nice entry screen, to a program?? and what drawing programs
do you use to create the screens??

	I would like to see some commented C code, perferably for MWC though I could
use Laser C as well, for the AES/VDI problems that I am having. And does anyone have
any ideas of how to learn to use the darn RSC Editors??

I can be reached on GEnie as R.COVERT1 or on USENET at gtephx!covertr.

P.S.
	Do the various public domain disks from CURRENT NOTES or Accusoft
contain actual C AES/VDI sample code?? I have tried d/ling C source code
from GEnie, but most of it doesn't use a GEM interface. And I haven't seen
ANY C source on USENET that uses a GEM interface. Oh well, the weekend is
only 3 days away and then I can study my books again!!!

Richard (Slightly Confused) Covert

obryan@gumby.cc.wmich.edu (Mark O'Bryan) (06/15/89)

In article <43b0b64c.14a1f@gtephx.UUCP>, covertr@gtephx.UUCP (Richard E. Covert) writes:
> 
> 	As an example of where I am stuck I want to display a bar that fills
> from left to right as I process data. The bar can be in a blank screen of its
> own, but it would be nice to have a text displayed with it.
> 
> 	Now, would I use a RSC editor to create the dialog box with the bar and
> the text?? If so, how do I create it with the above RSC editors?? I see that

Doing "gauges" is pretty easy, once you know how.  To start off, you make
your dialog box by dragging out a "box" type and setting it to a 2-pixel
border with the "outline" attribute turned on.  Stretch it so it's big enuf
to hold all the stuff you want inside.  For your labels, drag down a STRING
object (unless you want to get fancy with sizes or colors, then you need a
TEXT object), then click on it and edit it to say what you want.

For the gauge itself, you'll need two nested boxes.  Drag out one "box"
object and make it the size and shape you want for the full gauge.  Pick
the fill color/pattern to correspond to whatever you want for "empty".
Then grab another "box" and drop it inside of the first one.  Slide it
up until it's flush with the upper left corner of the container, then
resize it until it's as tall as the container and maybe half as wide.
Set the fill color/pattern to contrast and indicate "full".  Give this
box a name, like "bar" maybe.  Then you can access the width field of
the bar object, initially making it 0, and increasing it (and doing a
ReDraw) as the bar widens.

You'll also want to access the width field of the containing "gauge"
object, to see what the maximum width should be, and so you can grow
your bar at the proper proportional rate.

-- 
Mark T. O'Bryan                 Internet:  obryan@gumby.cc.wmich.edu
Western Michigan University
Kalamazoo, MI  49008