home *** CD-ROM | disk | FTP | other *** search
-
- Dear Developer,
-
- Welcome to the world of programming for the EGS retargetable,
- device-independent operating system. When you write a program for
- EGS, it can be run on any computer from an Amiga 500, to a
- SPECTRUM system, the high end 110/24 system, or other hardware in
- the marketplace which supports EGS.
-
- EGS was created and is owned by VIONA Development in Germany.
- Questions regarding development will be answered by them. I am
- including this directory in the developer's disk for two reasons.
- One, I want to share with you what I've learned through writing
- EGS-Paint, and help explain how to do things which aren't apparent
- at first glance. Due to the overwhelming response, and the need
- for developers to have access to this information now, we decided
- to put in our own demo code, along with the demo code from Viona.
- Updates can be obtained from VIONA development.
-
- Programming under EGS is fun and exciting because you can develop
- on an AGA system or something, than watch the code run on other
- hardware platforms. It is very similar to Intuition, and in fact,
- most commands look and work the same, and simply have an E_ or EI_
- or something attached to the beginning of the command. Here is a
- brief overview.
-
- Windows.
-
- EGS windows are very similar to Amiga windows in that there is an
- EI_Window structure, and an EI_NewWinodw structure. You will find,
- however, that it is usually not necessary to even bother with a
- NewWindow structure, as gadget functions will create them for you.
- EGS has SIMPLE_REFRESH, SMART_REFRESH, etc. windows and everything
- should seem familiar to you.
-
- Menus.
-
- EGS Menus are EXTREMELY EASY! See the demo code.
-
- Gadgets.
-
- Ah, there's the rub... Gadgets are very powerfull, and can get
- sort of confusing at times. The included code is designed to show
- you how to deal with sizing correctly, and in fact, if you use the
- UserWindow module I wrote, you never have to worry about how to
- open, close, or deal with resize events again. Of course, if you
- want, you can do all of that yourself, or modify the included
- code. This module is in the Public Domain. All I ask is if you
- pass it on to someone else, give them the original version, so
- they can see whats going on.
-
-
- Gadgets can be resizable (recomended) if you wish. There are two
- ways for the system to create its gadgets. First: if you don't
- have a window open for the gadgets yet, the system will look at
- your font, figure out the minimum space your gadgets will need,
- open a window for you of this size, and place your gadgets.
- Second: If you allready have a window open, the system will
- stretch the gadgets based on your setup to fit the window you've
- supplied. The system does not appreciate getting a window that the
- gadgets can's fit into, even at their minimum sizes. In fact, this
- will probably crash your system. Usually one allows EGS to create
- the window as per above, then allows the user to resize it bigger.
- (EGS will set the MinSize of the window to this Minimum size the
- gadgets can fit into, so you never need to worry about it). (If
- you want to start it out bigger than the minimum, you can run the
- function ProcessGadBoxes which calculates the minimum size and
- adds it to the NewWindow structure, then run the whole process
- again with a new window opened bigger, but with the NewWindow
- structure passed in from ProcessGadBoxes. This is a bit advanced,
- and usually not necessary but I thought I'd throw it in. I use it
- when I change the number of views inside a DrawWindow in
- EGS-Paint.)
-
- Here are some straight forward rules about resizeable gadgets that
- should clear thing up.
-
- 1.
- To have a resizeable window with gadgets, you must have a HorizBox
- or a VertiBox somewhere. These define how gadgets are to be
- stretched. For instance, if you were to create three gadgets and
- place them inside a vertibox, they will appear in a column and
- only stretch vertically. If the same three gadgets were created
- inside a Horiz Box, they would be place left to right, and would
- only stretch horizontally. Seems simple enough so far. Just
- remember this rule, its a good basic starting place.
-
- 2.
- The way this all works, is that the system looks at the available
- space inside the window where the gadgets are to be placed. It
- then adds things to it from top to bottom in hierarchy until
- everything is placed. Here's the catch. Horiz and Verti Boxes can
- also stretch.
-
- For instance:
- Lets create a window with a gadget list like this.
-
- VERTIBOX
- gadget 1
- gadget 2
- gadget 3
-
- This is easy. We get the following window, regargdless of size.
-
- +_________________________________________--
- | Gadget 1 |
- |__________________________________________|
- | Gadget 2 |
- |__________________________________________|
- | Gadget 3 |
- |__________________________________________|
-
-
- Note the gadgets will stretch out to fit the window. (The text
- does not get any bigger or smaller).
- (SEE Example1_SOURCE and PROGRAM).
-
- Now try this one.
-
- HORIZBOX
- VERTIBOX
- gadget 1
- gadget 2
- VERTIBOX
- gadget 3
- gadget 4
-
- Now the system must share the horizontal space of the window with
- two Vertical Boxes. It will divide the window in half and give the
- first VertiBox the left side, and the second the right. (You can
- change the priority of boxes and gadgets, thus changing this rule,
- like letting one gadget take over whil the other gadget stays at
- its minimum size given the current font. I'll talk on this
- later...) We end up with this.
-
- +_________________________________________--
- | Gadget 1 | Gadget 3 |
- |__________________________________________|
- | Gadget 2 | Gadget 4 |
- |__________________________________________|
-
- Make sense?
- (SEE Example2_SOURCE and PROGRAM).
-
- Next...
-
- VERTIBOX
- gadget 1
- HORIZBOX
- gadget 2
- gadget 3
- VERTIBOX
- gadget 4
- gadget 5
-
-
- Here we go...
-
- +_________________________________________--
- | |
- | |
- | Gadget 1 |
- |__________________________________________|
- | | | Gadget 4 |
- | Gadget 2 | Gadget 3 |________________|
- | | | Gadget 5 |
- |___________|_____________|________________|
-
- (SEE Example3_SOURCE and PROGRAM).
-
- Note that gadget 1 is able to stretch horizontally, even though it
- is inside a VertiBox. This is beacause there is also a Horiz Box
- inside the VertiBox and it needs the space.
-
- Note also that gadgets 2 and 3 are as tall as the combination of
- the height of gadgets 4 and 5. They too are allowed to stretch
- vertically even though they are inside a horiz box, beacuse
- gadgets 4 and 5 need the space.
-
- Finally note that gadget 1 is as tall as the combination of the
- hieght of gadgets 4 and 5. This is because the VertiBox is sharing
- window height between two items: gadget 1, and the horiz box which
- contains 3,4 and 5. See how this can get a little confusing? You
- get used to it however, and EGS always follows the same rules.
- This is a very powerfull gadget system!
-
-
- change : 30 Dec 1993 (mvk)
-