home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 18 / amigaformatcd18.iso / mui / mui_developer / autodocs / mui_text.doc < prev    next >
Text File  |  1997-03-10  |  5KB  |  182 lines

  1. TABLE OF CONTENTS
  2.  
  3. Text.mui/Text.mui
  4. Text.mui/MUIA_Text_Contents
  5. Text.mui/MUIA_Text_HiChar
  6. Text.mui/MUIA_Text_PreParse
  7. Text.mui/MUIA_Text_SetMax
  8. Text.mui/MUIA_Text_SetMin
  9. Text.mui/MUIA_Text_SetVMax
  10. Text.mui/Text.mui
  11.  
  12.     Text class allows generating objects that contain
  13.     some kind of text. You can control the outfit of
  14.     your text with some special control characters,
  15.     including italics, bold, underline and color
  16.     codes. Format codes align text either left,
  17.     centered or right, linefeeds allow multiline
  18.     text fields.
  19. Text.mui/MUIA_Text_Contents
  20.  
  21.     NAME
  22.     MUIA_Text_Contents -- (V4 ) [ISG], STRPTR
  23.  
  24.     FUNCTION
  25.     String to be displayed in a text object.
  26.  
  27.     If the string is larger than available display space,
  28.     it will be clipped. Setting MUIA_Text_Contents to NULL
  29.     results in an empty text object.
  30.  
  31.     The string is copied into a private buffer, you can destroy
  32.     the original after using this tag.
  33.  
  34.     Whenever MUI prints strings, they may contain some special
  35.     character sequences defining format, color and style of the text.
  36.  
  37.     '\n'     Start a new line. With this character you can e.g. create
  38.          multi line buttons.
  39.  
  40.     ESC -    Disable text engine, following chars will be printed
  41.              without further parsing.
  42.  
  43.     ESC u    Set the soft style to underline.
  44.  
  45.     ESC b    Set the soft style to bold.
  46.  
  47.     ESC i    Set the soft style to italic.
  48.  
  49.     ESC n    Set the soft style back to normal.
  50.  
  51.     ESC <n>  Use pen number n (2..9) as front pen. n must be a valid
  52.          DrawInfo pen as specified in "intuition/screens.h".
  53.  
  54.     ESC c    Center current (and following) line(s).
  55.          This sequence is only valid at the beginning of a
  56.          string or after a newline character.
  57.  
  58.     ESC r    Right justify current (and following) line(s).
  59.          This sequence is only valid at the beginning of a
  60.          string or after a newline character.
  61.  
  62.     ESC l    Left justify current (and following) line(s).
  63.          This sequence is only valid at the beginning of a
  64.          string or after a newline character.
  65.  
  66.     ESC I[s] Draw MUI image with specification <s>. See autodocs
  67.              of image class for image spec definition.
  68.  
  69.     Note:     These rules apply to all MUI strings, not only to
  70.          a text objects contents. You can e.g. format the
  71.              columns of a listview or include images in a cycle
  72.              gadgets entries.
  73.  
  74.     EXAMPLE
  75.     ...
  76.     MUIA_Text_Contents, "\33c\33bMUI\33n\nis magic"
  77.     ...
  78.  
  79.     would look like     |    MUI   |  <-- bold
  80.                         | is magic |  <-- normal
  81.  
  82.     SEE_ALSO
  83.     MUIA_Text_SetMin, MUIA_Text_SetMax, MUIA_Text_PreParse
  84. Text.mui/MUIA_Text_HiChar
  85.  
  86.     NAME
  87.     MUIA_Text_HiChar -- (V4 ) [I..], char
  88.  
  89.     FUNCTION
  90.     If the character given here exists in the displayed
  91.     string (no matter if upper or lower case), it will
  92.     be underlined. This makes it easy to create macros
  93.     such as KeyButton() that specify the control char
  94.     and the underline char at the same time.
  95.  
  96.     SEE ALSO
  97.     MUIA_Text_Contents, MUIA_ControlChar
  98. Text.mui/MUIA_Text_PreParse
  99.  
  100.     NAME
  101.     MUIA_Text_PreParse -- (V4 ) [ISG], STRPTR
  102.  
  103.     FUNCTION
  104.     String containing format definitions to be parsed before
  105.     the text from MUIA_Text_Contents is printed.
  106.  
  107.     Using this tag, you can easily define different formats,
  108.     colors and styles without modifying the original string.
  109.  
  110.     EXAMPLE
  111.     ...
  112.     MUIA_Text_PreParse, "\33c\33i",   // centered and italics
  113.     MUIA_Text_Contents, "foobar",
  114.     ...
  115.  
  116.     SEE_ALSO
  117.     MUIA_Text_Contents
  118. Text.mui/MUIA_Text_SetMax
  119.  
  120.     NAME
  121.     MUIA_Text_SetMax -- (V4 ) [I..], BOOL
  122.  
  123.     FUNCTION
  124.     Boolean value to indicate wether the objects maximal width
  125.     shall be calculated to fit the string given with
  126.     MUIA_Text_Contents.
  127.  
  128.     When set to FALSE, maximum width is not limited.
  129.  
  130.     For a text object that needs to be updated (e.g. some
  131.     information about your programs status) you would probably
  132.     set MUIA_Text_SetMax to FALSE to allow resizing of this
  133.     object.
  134.  
  135.     For a label for one of your gadgets, you might want to
  136.     give this tag a value of TRUE to prevent MUI from
  137.     inserting additional layout space.
  138.  
  139.     Defaults to FALSE.
  140.  
  141.     EXAMPLE
  142.     ...
  143.     TX_Status = TextObject,
  144.        RecessedFrame,
  145.        MUIA_Background   , MUII_BACKGROUND,
  146.        MUIA_Text_PreParse, "\33c",
  147.        MUIA_Text_Contents, "running...",
  148.        End,
  149.     ...
  150.     set(TX_Status,MUIA_Text_Contents,"reading...");
  151.     ...
  152.     set(TX_Status,MUIA_Text_Contents,"writing...");
  153.     ...
  154.  
  155.     SEE_ALSO
  156.     MUIA_Text_SetMin, MUIA_Text_Contents
  157. Text.mui/MUIA_Text_SetMin
  158.  
  159.     NAME
  160.     MUIA_Text_SetMin -- (V4 ) [I..], BOOL
  161.  
  162.     FUNCTION
  163.     Boolean value to indicate wether the objects minimal width
  164.     shall be calculated to fit the string given with
  165.     MUIA_Text_Contents.
  166.  
  167.     When set to FALSE, minimum width will be set to 0
  168.     and the displayed string may be clipped.
  169.  
  170.     Defaults to TRUE.
  171.  
  172.     SEE_ALSO
  173.     MUIA_Text_SetMax, MUIA_Text_Contents
  174. Text.mui/MUIA_Text_SetVMax
  175.  
  176.     NAME
  177.     MUIA_Text_SetVMax -- (V11) [I..], BOOL
  178.  
  179.     FUNCTION
  180.     Settings this to FALSE makes a TextObjects y-size unlimited.
  181.     Defaults to TRUE which means the objects height is fixed.
  182.