home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / e / amiga_e / src / tools / easygui / easygui.doc next >
INI File  |  1992-09-02  |  5KB  |  154 lines

  1. [sorry folks, I have been working on this just before the release
  2.  deadline, and it's far from finished. blame it on bad timing :-).
  3.  Anyway, for the more adventurous amongst you all, go ahead and
  4.  try it! but be warned that things will change, and that things
  5.  don't work yet as the should (or don't work at all). below are
  6.  some bit'n'pieces of documentation I had lying around, and at the
  7.  end you will see what's missing...]
  8.  
  9.  
  10.                           Introducing the new:
  11.  
  12.                              E A S Y G U I
  13.  
  14.      An interface builder for E, with the following highlights:
  15.  
  16.     - It's totally Font-Sensitive
  17.     - It's Resizable
  18.     - It's Self-Organising, i.e. it arranges gadgets
  19.     - It's more StyleGuide compliant than your granny
  20.     - It's Fast and Flexible
  21.     - It's relatively small, needs no extra external libraries
  22.     - And above all: It's extremely easy to use!!!
  23.  
  24.  
  25. EasyGUI takes the form a module file that needs to be included into your
  26. E source. The most simple form of constructing a GUI consist of calling
  27. the function easygui() with a (possibly nested) E list which describes
  28. your GUI. just to show how Easy, try this source:
  29.  
  30.     MODULE 'tools/EasyGUI'
  31.     PROC main() IS easygui('um,...',[BUTTON,0,'Ok!'])
  32.  
  33. This'll open a window with just one gadget in it, and wait for the
  34. user to push it. If easygui() can't get what it wants, it'll start
  35. throwing around exceptions, so we'll probably need an exception
  36. handler to be able to inform the user properly (see below).
  37.  
  38. The first arg of easygui() is the window title, the second one is the
  39. GUI description. The form of these desciptions is quite simple: It's a
  40. list with as first element the type of gadget, the second is called an
  41. action value (more later), and the rest is gadget-specific.
  42.  
  43. To be able to build GUI's outof more components than just one gadget,
  44. one can group gadgets with a ROW and a COL list:
  45.  
  46. [COL,
  47.   [BUTTON,1,'Ok'],
  48.   [BUTTON,0,'Cancel']
  49. ]
  50.  
  51. This'll create a new group, consisting of two gadgets next to eachother.
  52. COL and ROW groups are like a single gadget, i.e. you can easily put them
  53. into other groups, to create GUI's of infinite complexity.
  54. For example, try this source:
  55.  
  56. ------------------------
  57. sofar for the documentation I was typing. more infos:
  58.  
  59. groupings:
  60.  
  61. ROWS,EQROWS,COLS,EQCOLS,BEVEL
  62.  
  63. gadgets etc.
  64. general format: [NAME,action,text,...]
  65. in {}: which direction it may resize.
  66. * = not implemented or things missing.
  67.  
  68. [BUTTON,action,intext]
  69. buttonaction(info)
  70.  
  71. [CHECK,action,righttext,checkedbool,lefttextbool]
  72. checkaction(info,checkedbool)
  73.  
  74. *[INTEGER,action,lefttext,num]
  75. integeraction(info,newnum) {x}
  76.  
  77. *[LISTV,action,textabove,xsize,xsize,execlist,readbool,selected]   (selected: 0=none, 1=read, 2=strgad)
  78. listviewaction(info,num_selected) {x,y}
  79.  
  80. [MX,action,righttext,nil_term_elist,lefttextbool]
  81. mxaction(info,num_selected)
  82.  
  83. *[CYCLE,action,lefttext,nil_term_elist]
  84. cycleaction(info,num_selected)
  85.  
  86. *[PALETTE,action,lefttext,depth,relx,rely]
  87. paletteaction(info,colour) {x,y}
  88.  
  89. *[SCROLL,action,isvert,total,top,visible]
  90. scolleraction(info,curtop) {x|y}
  91.  
  92. *[SLIDE,action,lefttext,isvert,min,max,cur]    -> has leveldisplay??
  93. slideraction(info,cur) {x|y}
  94.  
  95. [STR,action,lefttext,initial,maxchars,relsize]
  96. stringaction(info,newstring) {x}
  97.  
  98. *[TEXT,text,lefttext,borderbool] {x}
  99.  
  100. *[NUM,int,lefttext,borderbool] {x}
  101.  
  102. *[RENDER,actionr,actionp,x,y]               -> in fontunits
  103. renderrefresh(x,y,xs,ys)
  104. renderpress(x,y)                           -> relative to topcorner
  105.  
  106. *[RENDERFIXED,actionr,actionp,x,y]          -> in pixels
  107. renderfixedrefresh(x,y)
  108. renderfixedpress(x,y)
  109.  
  110. [SBUTTON] {x}            -> same as button.
  111.  
  112.  
  113. actioncodes:
  114. - an integer in the range 0..999
  115.   dogui() will close all and exit with this code
  116. - a ptr to a procedure to perform an action. the type of procedure
  117.   (i.e. #of args) differs with each gadget. After calling the procedure,
  118.   dogui() will normally continue with this gui, unless the procedure
  119.   returns FALSE.
  120.  
  121.  
  122. exceptions raised:
  123.  
  124. "MEM"   -- no mem
  125. "GUI"   -- for things like CreateGadgetA, OpenWindowTagList etc.
  126. "GT"    -- couldn't open gadtools.library
  127. "DF"    -- same for diskfont
  128. "Egui"  -- a design error: most probably handed over a list to dogui()
  129.            that was either to long or too short
  130. <other> -- Raise()ed by own function
  131.  
  132.  
  133. example of usage of other three function (= definition easygui())
  134.  
  135.  
  136. PROC easygui(windowtitle,gui,info=NIL,screen=NIL,prefs=0,textattr=NIL) HANDLE
  137.   DEF gh=NIL:PTR TO guihandle,res=-1
  138.   gh:=guiinit(windowtitle,gui,info,screen,prefs,textattr)
  139.   WHILE res<0
  140.     Wait(gh.sig)
  141.     res:=guimessage(gh)
  142.   ENDWHILE
  143. EXCEPT DO
  144.   cleangui(gh)
  145.   IF exception THEN ReThrow()
  146. ENDPROC res
  147.  
  148.  
  149.  
  150. things not done:
  151. - it uses the systemfont instead of the screenfont for now
  152. - doesn't try smaller font if gui doesn't fit
  153. and many smaller probs...
  154.