[comp.sys.atari.st] How do I add a window to a form?

paul@cacilj.UUCP (Paul Close) (01/08/90)

I'm trying to add a scrollbar (slider) to allow a long text description to be
partially displayed in a form.  I've written several programs using forms, but
windows are new to me.  I can figure out a kludgey way to superimpose a
window over my form, but that's about it.  I'm looking for something like the
item selector, where a scrolling window peacefully co-exists within the form.

Even if I could kludge together something that *looked* good, I'm not clear
on how to use it once it is created.  I need to use form_do to read the form,
but also need evnt_... to read the window.  How can I do both?  Do (can) I use
the G_PROGDEF type briefly mentioned in the MWC docs?  If so, how?

Finally, I can't find any functions for writing into windows.  Do I just write
to the screen inside the window?  It seems like a window is just a way of
managing a mini-screen.  I was hoping there was an object that would allow for
scrolling fields.  I also wonder about all the "home-brewed" windows I see in
applications.  They look like GEM windows, but have more buttons and fields
than GEM windows.  Is there a "window toolkit" buried in the AES or VDI
somewhere?

Questions, questions, questions.  Thanks to those who reply,
-- 
Paul Close	paul@cacilj.CTS.COM 	...!{uunet, ucsd, crash}!cacilj!paul

    The Obi-wan Kenobi method:  "Use the Source, Luke"	-Jim Fulton

RiddCJ@computer-science.birmingham.ac.UK (Chris Ridd) (01/10/90)

Paul Close asked (paraphrased):
1) how do I put a scrollbar in a form (dialog) like the file selector?
2) how do I write inside a window?

1) Well, you CAN'T put a window inside a dialog box.  What you can do though,
is simulate a window's scrollbars and features by drawing little buttons (hint
- use G_BOXCHARs for the scroll arrows) and boxes (the scrollbar background
should be a G_BOX with a fill pattern, the little moveable box (thumb) should
be a child of this object, and should also be a G_BOX, filled in white).  Play
around with a good resource editor (K-Resource or WERCS spring to mind).

All the objects should have the TOUCHEXIT flag turned on, so that a mouse click
will 'repeat'.  You'll need a little bit of code to handle all the different
click positions - on the thumb (drag the box), on the background (page the
thumb up or down), or just scrolling line by line up or down.  You don't
need to use G_PROGDEF types.

2) You can write inside a window just by writing on the screen at the proper
coordinates.  To ensure that you don't destroy the screen outside the window,
clip the VDI output to inside the window's work area.  There is no other way.
There are alas, no extra window functions inside the AES that will help you
do clever things.  You need to work hard!  After a bit, you get to admire the
work that's gone into packages like NeoDesk (custom windows) et al.

>Paul Close	paul@cacilj.CTS.COM 	...!{uunet, ucsd, crash}!cacilj!paul
>
>    The Obi-wan Kenobi method:  "Use the Source, Luke"	-Jim Fulton

   Chris

/*
 * Snail mail address:
 * Chris Ridd,                   "Wave after wave, each mightier than the last
 * School of Computer Science,  'Til last, a ninth one, gathering half the deep
 * Birmingham University,         And full of voices, slowly rose and plunged
 * UK                              Roaring, and all the wave was in a flame"
 *
 */