DTEDITORFORMAT(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

okay so bestie, this is DtEditorFormat, and the manual name is library call. it’s giving β€œformat my editor text, please” energy, and we’re about to go through the whole page. πŸ’…βœ¨

πŸ’– NAME πŸ’–

DtEditorFormat β€” format all or part of the contents of a DtEditor widget. periodt. 🫢

✨ SYNOPSIS ✨

#include &<Dt/Editor.h>
DtEditorErrorCode DtEditorFormat(
Widget widget,
DtEditorFormatSettings *formatSettings,
unsigned int amountToFormat);

🌸 DESCRIPTION 🌸

okay so DtEditorFormat formats all or part of the contents of the DtEditor widget according to the current text format settings in the Format Settings dialog. these options specify which margins and alignments (left aligned, right aligned, justified or centered) are used. optionally, alternative settings can be passed as an argument to DtEditorFormat in a data structure. this function formats either the paragraph containing the insertion cursor or the entire contents of the DtEditor widget, depending on the value of the amountToFormat argument. πŸ¦‹

the Format Settings dialog is displayed with DtEditorInvokeFormatDialog(3). for a complete description of formatting and the Format Settings dialog, see DtEditor.

quick arg check, bestie: ✨

  • widget β€” specifies the editor widget ID. πŸ‘‘
  • formatSettings β€” specifies left margin value, right margin value and the justification style. the LeftMargin and RightMargin fields of DtEditorFormatSettings must be zero or larger. the Alignment field can have a value of DtEDITOR_ALIGN_CENTER, DtEDITOR_ALIGN_JUSTIFY, DtEDITOR_ALIGN_LEFT or DtEDITOR_ALIGN_RIGHT. if the formatSettings argument is NULL, DtEditorFormat uses the last format settings specified in the Format Settings dialog. πŸŽ€
  • amountToFormat β€” when the amountToFormat argument is set to DtEDITOR_FORMAT_ALL, it reformats all the text in the edit window. when this argument is set to DtEDITOR_PARAGRAPH, only the paragraph containing the insertion cursor is formatted. πŸ’…

for a complete definition of the DtEditor widget and its associated resources, see DtEditor(3).

for a complete definition of DtEditorFormatSettings, see Dt/Editor.h - DtEditor(5). 🌈

πŸŽ€ RETURN VALUE πŸŽ€

upon successful completion, the DtEditorFormat function returns DtEDITOR_NO_ERRORS; otherwise, it returns one of the following values:

  • DtEDITOR_NO_TMP_FILE β€” the DtEditorFormat function cannot create two temporary files in the directory returned by tmpnam3S. 😭
  • DtEDITOR_ILLEGAL_SIZE β€” the left or right margin values are negative. πŸ’€
  • DtEDITOR_INVALID_RANGE β€” the amountToFormat argument is not recognized. πŸ™ˆ
  • DtEDITOR_INVALID_TYPE β€” the Alignment field is not recognized. ⭐

πŸ”— SEE ALSO πŸ”—

the whole squad, no cap:


that’s the whole page, bestie β€” DtEditorFormat, library call, signing off from the footer with no separate source/version/date line to hype up. πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from