home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / AWNP / AWNP-Docs / modify.doc < prev    next >
Encoding:
Text File  |  2000-12-01  |  8.9 KB  |  223 lines

  1. Modifying the GUI Window and its gadgets
  2. =========================================
  3.  
  4. See the documentation for each gadget type for information on modifying that type of gadget type. This document exlains many 'special commands' that can be used to modify the GUI in general. It also has some commands that can be used on any gadget type.
  5.  
  6. Most modify commands are replied to with either 'ok' or 'error'. If more than one gadget parameter is changed by the modify command the reply can be 'ok ok ...' .  A reply of a blank line means the modify command was not understood and was ignored.
  7.  
  8. Modify commands that change gadget parameters begin with 'id GID' Gadgets are modified with the following  line format
  9.  
  10. 'id GID parameter1[=value] parameter2[=value] parameter3[=value] ...
  11.  
  12. example 'id 2 gadgettext="new text" disable=1'
  13.  
  14. The parameters allowed depend on the type of gadget that GID refers to.
  15.  
  16. NOTE: When modifying gadgets on a clicktab page, you should add the page parameter to the modify line.
  17.  
  18. NOTE: At times you may want to modify a GUI after is is created, but BEFORE the window is opened. Use the 'NoWindow' keyword in the window definition, create the GUI as usual. When you send 'open' the window does NOT open but you do go into modify mode. Modify the GUI then send 'id 0 s 64' to open the window after it has been modified.
  19.  
  20. Modify Parameters that can be used with all gadgets
  21. (except menu, arexxhost, textattr, commodity...)
  22. ------------------------------
  23.  
  24. page="GID"
  25.  
  26.  Specify the clicktab gadget that controls the page containing the gadget to be modified. Most gadgets seem to modify fine without this being set, but it must be used for string gadgets. It should probably be used when modifying all gadgets on clicktab pages to ensure future compatability.
  27.  NOTE: you supply the Gadget ID of the clicktab, NOT the number of the page inside the clicktab.
  28.  
  29. set
  30.  
  31.  'Set' sets gadget parameters from the supplied tag list. Both 'set' and 'tags' must be used to do this.
  32.  
  33. tags="tags|data[|tag|data...]|0
  34.  
  35.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  36.  
  37. Refresh (ref)
  38.  
  39.  Refresh the entire GUI when used alone, or refresh a specific object when used with a GID.
  40.  
  41. Informational Gadget modify instructions
  42. ----------------------------------------
  43.  
  44. read
  45.  
  46.   Read must not be used with other parameters besides GID.
  47.  'id GID read' Reads the gadget specified by GID. The pipe returns the same information as when a user hits a gadget but without the leading 'gadget gid'. In the case of GID=0 read returns the windows 'left top width height' settings.
  48.  
  49. bounds
  50.  
  51.  Read the size and location of object associated with the GID. This modify command MUST be ' id GID bounds' and returns 'LEFT TOP WIDTH HEIGHT'
  52.  
  53. address
  54.  
  55.  Read the address of object associated with the GID and information about the gadget type. This modify command MUST be ' id GID address' and returns 'ADDRESS GADGETTYPE'
  56.  
  57.  An address of 0 means no object is associated with the GID.
  58.  
  59. mouse
  60.  
  61.  Get the position of the pointer. This returns the both the position relative to the window and relative to the screen.
  62.  
  63. 'windowX windowY screenX screenY'
  64.  
  65. Get="hexvalue"
  66.  
  67.  This special modify command lets you read a value associated with a gadget The pipe replies with 'ok value' when successful, a blank line if it fails.
  68.  
  69.  example 'id 3 get xxxxxxxx'
  70.  
  71.  This reads the selected color in a palette gadget (whose GID is 3).
  72.  
  73. Gadget interconnection modify
  74. -----------------------------
  75.  
  76.  This function may only be useful to programmers already familiar with interconnection who have registered CA documentation.
  77.  
  78. Target="gadget_ID"  (tar=)
  79.  
  80.  The gadget to be interconnected with.
  81.  
  82. tags="tagsource|tagdest[|tagsource|tagdest..]|0
  83.  
  84.  The list of tags for interconnection in HEX. Tags must be in pairs, and do not forget the trailing null!
  85.  
  86.  example. 'id 3 target 2  tags="5001005|5001005|0" '
  87.  
  88.  Selections made on chooser gadget 3 are connected to chooser gadget 2.
  89.  
  90.  
  91. Modify Control instructions
  92. ----------------------------
  93.  
  94.  Some modify commands do not actually modify any gadgets.
  95.  
  96. pointer
  97.  
  98.  Set the pointer for the window, if pointerdata is not specified set the pointer to default pointer. I pointer data is given see below.
  99.  
  100. pointerdata="height|width|hotx|hoty|data1|data2|..."  (pd=)
  101.  
  102.  Pointer data is the definition for a pointer. For more information see the intuition call SetPointer(). Pointerdata="" is a special case setting the pointer to a null (invisible) pointer.
  103.  
  104. specialchar="character" (sc=)
  105.  
  106.  'Character' is a single character that replaces '|', in use as a separator inside parameters like chooserlabels, tags, penmapdata, ...
  107.  
  108.  You should usually use this alone on a modify line, used inside modify commands like add node it will cause an extra 'ok' in the response line.
  109.  
  110. Quiet  (q)
  111.  
  112.  Tell the pipe not to reply to the modify commands. This is actually a toggle switch turning replies off and on. SOME modify commands are ALWAYS replied to. (addnode and getfile selected 0|1)
  113.  
  114. refresh (ref)
  115.  
  116.  Refresh the gadget referenced by GID. The refresh command can be combined with any other modify command and is always executed last. GID=0 will refresh the windows root layout, this is the best way to refresh all gadgets.
  117.  
  118.  Refresh without a GID specified will refresh the entire window, usually it is better to refresh the root class as described above.
  119.  
  120. close
  121.  
  122.  Close the CA window. Dispose of window and end the pipe connection to the GUI host.
  123.  
  124. tick=number
  125.  
  126.  End the modify conversation, Reply with a tick event after number/100 seconds.
  127.  
  128. Continue (con)
  129.  
  130.  End the modify conversation.
  131.  
  132. Modifyoff (m)
  133.  
  134.  End the modify conversation AND turn modify off. (do not start any new modify conversations). Note there will be no way to turn modify back on.
  135.  
  136. Beep=num
  137.  
  138.  Beep the display. If num =0 beep all screens , else beep the GUI's screen.
  139.  
  140.  
  141. Bubble Help
  142. ------------
  143.  
  144. Help="num"
  145.  
  146.  If num =0 turn help events off, if num!=0 then turn help events on.
  147.  
  148.  Each GUI can only show one bubble help window at a time.
  149.  
  150. bubble top=numx left=numy gt="Help Text"
  151.  
  152.  This opens a bubble showing the help text. Top and left are mouse location for the help (as sent to you in the help event you are responding to). Any previous help window will be closed.
  153.  
  154.  'bubble' sent with no parameters will close the bubble with out opening a new one.
  155.  
  156. Image Functions
  157. ----------------
  158.  
  159. FreeImage="num"  fi=
  160.  
  161.  if num=-1 Dispose of a previously defined image without using it. Else free the root bitmap image in buffer num. Be careful not to do this while images still exist that reference this root bitmap.
  162.  
  163. Draw="num" top="num" left="num" [target=GID][nozz][noclip]
  164.  
  165.  Draw an image into the gui. Num is the number of the predefined image to be drawn. You MUST set 'top' and 'left' and can also set
  166.  
  167. target=GID
  168.  
  169.  Reference (clip & offset) drawing to inside the object specified by GID. If target is not given drawing is refrenced to inside the borders of the GUI.
  170.  
  171.  nozz
  172.  
  173.  Make top and left relative to the whole window rather than the inner panel or specified target.
  174.  
  175. noclip
  176.  
  177.  Allow images to overwrite the entire window, borders and all.
  178.  
  179.  The image number relates to images you have created but not used in your GUI.
  180.  For example...
  181.  
  182.  You create an image 'bitmap fn="cat.gif"'  it is image 0.
  183.  You create another image 'bitmap fn="dog.gif"' it is image 1.
  184.  You create another image 'bitmap fn="bird.gif"' it is image 2.
  185.  
  186.  You create a BUTTON using the last image created 'button useimage', the
  187.  button used the bird image so it is no longer in the image list.
  188.  
  189.  You create another image 'bitmap fn="frog.gif"' it is image 2.
  190.  
  191.  You now have 3 images available to draw
  192.  
  193.  0 cat
  194.  1 dog
  195.  2 frog
  196.  
  197.  Drawing images DOES NOT remove images from the image list. Incorporating images directly in your GUI DOES remove images from the image list. The image number is NOT related to the buffer number in the bitmap image parameters.
  198.  
  199.  
  200. GID 0
  201. -------
  202.  
  203. GID 0 is used to specify the GUI window itself. It can be used to control certain aspects of the window. (see window docs)
  204.  
  205. Defining new gadgets during modify
  206. ------------------------------------
  207.  
  208. define
  209.  
  210.  This causes the current line to be used as a Gadget definition statement rather than modify. You can add or replace gadgets in the already opened window. You may need to send a refresh modify command to make the changes visible.
  211.  
  212. replace="GID"
  213.  
  214.  The newly defined gadget replaces the existing gadget specified by GID. The pipe tries to free the resources used by the previous gadget right away, but some memory is not freed until the pipe is closed.
  215.  
  216.  WHEN USING REPLACE DO NOT ASSUME WHAT THE RESULTING GID OF THE NEW GADGET WILL BE. The usual sequence of allocated gadget ID's is not followed. Replacing a layout group frees all gadgets in the group as well as the layout itself. Replacing a listbrowser frees its nodes.
  217.  
  218.  You MUST keep track and not try to access gadgets that no longer exist.
  219.  
  220.  It may be better to close the window and open a new one rather than using replace or define. On the other hand some pretty neat thing can be done using define and replace. ;-D
  221.  
  222.  
  223.