EdFormat.sgm 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!-- $XConsortium: EdFormat.sgm /main/5 1996/08/30 12:59:13 rws $ -->
  2. <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
  3. <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
  4. <!-- (c) Copyright 1995 International Business Machines Corp. -->
  5. <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
  6. <!-- (c) Copyright 1995 Novell, Inc. -->
  7. <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
  8. <!-- (c) Copyright 1995 Hitachi. -->
  9. <![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCSA.MAN24.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCSA.MAN24.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>DtEditorFormat</RefEntryTitle>
  13. <ManVolNum>library call</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Function>DtEditorFormat</Function></RefName>
  17. <RefPurpose>format all or part of the contents of a DtEditor widget
  18. </RefPurpose>
  19. </RefNameDiv>
  20. <!-- CDE Common Source Format, Version 1.0.0-->
  21. <!-- *************************************************************************-->
  22. <!-- ** (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
  23. <!-- ** (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
  24. <!-- ** (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
  25. <!-- ** (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
  26. <!-- ***********************************************************************-->
  27. <RefSynopsisDiv>
  28. <FuncSynopsis Remap="ANSI">
  29. <FuncSynopsisInfo>#include &lt;Dt/Editor.h>
  30. </FuncSynopsisInfo>
  31. <FuncDef>DtEditorErrorCode <Function>DtEditorFormat</Function></FuncDef>
  32. <ParamDef>Widget <Parameter>widget</Parameter></ParamDef>
  33. <ParamDef>DtEditorFormatSettings *<Parameter>formatSettings</Parameter></ParamDef>
  34. <ParamDef>unsigned int <Parameter>amountToFormat</Parameter></ParamDef>
  35. </FuncSynopsis>
  36. </RefSynopsisDiv>
  37. <RefSect1>
  38. <Title>DESCRIPTION</Title>
  39. <Para>The
  40. <Function>DtEditorFormat</Function> function formats all or part of the contents of the DtEditor widget according
  41. to the current text format settings in the Format
  42. Settings dialog.
  43. These options specify which margins and
  44. alignments (left aligned, right aligned, justified or centered)
  45. are used.
  46. Optionally, alternative settings can be passed as an argument to
  47. <Function>DtEditorFormat</Function> in a
  48. data structure.
  49. This function
  50. formats either the paragraph containing the insertion cursor
  51. or the entire contents of the DtEditor widget, depending on the value of the
  52. <Emphasis>amountToFormat</Emphasis> argument.
  53. </Para>
  54. <Para>The Format Settings dialog is displayed with
  55. &cdeman.DtEditorInvokeFormatDialog;. For a complete description of formatting and the Format Settings
  56. dialog, see
  57. <Classname>DtEditor</Classname>.</Para>
  58. <Para>The
  59. <Symbol Role="Variable">widget</Symbol> argument specifies the editor widget ID.
  60. </Para>
  61. <Para>The
  62. <Emphasis>formatSettings</Emphasis> argument specifies left margin value, right margin value and the
  63. justification style.
  64. The LeftMargin and RightMargin fields of
  65. <StructName Role="typedef">DtEditorFormatSettings</StructName> must be zero or larger.
  66. The Alignment field can have a value of
  67. <SystemItem Class="Constant">DtEDITOR_ALIGN_CENTER</SystemItem>, <SystemItem Class="Constant">DtEDITOR_ALIGN_JUSTIFY</SystemItem>, <SystemItem Class="Constant">DtEDITOR_ALIGN_LEFT</SystemItem> or
  68. <SystemItem Class="Constant">DtEDITOR_ALIGN_RIGHT</SystemItem>. If the
  69. <Emphasis>formatSettings</Emphasis> argument is
  70. <SystemItem Class="Constant">NULL</SystemItem>, <Function>DtEditorFormat</Function> uses the last format settings specified in the Format Settings dialog.
  71. </Para>
  72. <Para>When the
  73. <Emphasis>amountToFormat</Emphasis> argument is set to
  74. <SystemItem Class="Constant">DtEDITOR_FORMAT_ALL</SystemItem>, it reformats all the text in the edit window.
  75. When this argument is set to
  76. <SystemItem Class="Constant">DtEDITOR_PARAGRAPH</SystemItem>, only the paragraph
  77. containing the insertion cursor is formatted.
  78. </Para><![ %CDE.C.CDE; [<Para>For a complete definition of the DtEditor widget
  79. and its associated resources, see
  80. &cdeman.DtEditor;.</Para>]]>
  81. <Para>For a complete definition of
  82. <StructName Role="typedef">DtEditorFormatSettings</StructName>, see
  83. &cdeman.Dt.Editor.h;.</Para><![ %CDE.C.CDE; [
  84. </RefSect1>
  85. <RefSect1>
  86. <Title>RETURN VALUE</Title>
  87. <Para>Upon successful completion, the
  88. <Function>DtEditorFormat</Function> function returns
  89. <SystemItem Class="Constant">DtEDITOR_NO_ERRORS</SystemItem>; otherwise, it returns one of the following values:
  90. </Para>
  91. <VariableList>
  92. <VarListEntry>
  93. <Term>DtEDITOR_NO_TMP_FILE</Term>
  94. <ListItem>
  95. <Para>The
  96. <Function>DtEditorFormat</Function> function cannot create two temporary files in the directory returned by
  97. <Function>tmpnam</Function>3S.</Para>
  98. </ListItem>
  99. </VarListEntry>
  100. <VarListEntry>
  101. <Term>DtEDITOR_ILLEGAL_SIZE</Term>
  102. <ListItem>
  103. <Para>The left or right margin values are negative.
  104. </Para>
  105. </ListItem>
  106. </VarListEntry>
  107. <VarListEntry>
  108. <Term>DtEDITOR_INVALID_RANGE</Term>
  109. <ListItem>
  110. <Para>The
  111. <Emphasis>amountToFormat</Emphasis> argument is not recognized.
  112. </Para>
  113. </ListItem>
  114. </VarListEntry>
  115. <VarListEntry>
  116. <Term>DtEDITOR_INVALID_TYPE</Term>
  117. <ListItem>
  118. <Para>The Alignment field is not recognized.
  119. </Para>
  120. </ListItem>
  121. </VarListEntry>
  122. </VariableList>
  123. ]]>
  124. </RefSect1>
  125. <![ %CDE.C.XO; [
  126. <RefSect1>
  127. <Title>RETURN VALUE</Title>
  128. <Para>Upon successful completion, the
  129. <Function>DtEditorFormat</Function> function returns
  130. <SystemItem Class="Constant">DtEDITOR_NO_ERRORS</SystemItem>; otherwise, it returns one of the following values:
  131. </Para>
  132. <VariableList>
  133. <VarListEntry>
  134. <Term>DtEDITOR_ILLEGAL_SIZE</Term>
  135. <ListItem>
  136. <Para>The left or right margin values are negative.
  137. </Para>
  138. </ListItem>
  139. </VarListEntry>
  140. <VarListEntry>
  141. <Term>DtEDITOR_INVALID_RANGE</Term>
  142. <ListItem>
  143. <Para>The
  144. <Emphasis>amountToFormat</Emphasis> argument is not recognized.
  145. </Para>
  146. </ListItem>
  147. </VarListEntry>
  148. <VarListEntry>
  149. <Term>DtEDITOR_INVALID_TYPE</Term>
  150. <ListItem>
  151. <Para>The Alignment field is not recognized.
  152. </Para>
  153. </ListItem>
  154. </VarListEntry>
  155. </VariableList>
  156. </RefSect1>
  157. ]]>
  158. <RefSect1>
  159. <Title>SEE ALSO</Title>
  160. <Para>&cdeman.Dt.Editor.h;, &cdeman.DtEditor;, &cdeman.DtEditorInvokeFormatDialog;; <![ %CDE.C.CDE; [<Function>tmpnam</Function>3S. ]]><![ %CDE.C.XO; [<Function>tmpnam</Function> in the &str-ZK;.
  161. ]]></Para>
  162. </RefSect1>
  163. </RefEntry>
  164. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:40:24-->