Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Aufzählungszeichen in TRxRichEdit (https://www.delphipraxis.net/19059-aufzaehlungszeichen-trxrichedit.html)

Markus K. 28. Mär 2004 16:17


Aufzählungszeichen in TRxRichEdit
 
Hallo,
ich möchte in einer RxRichEdit-Konponente Aufzählungzeichen einfügen, welches ich so bewerkstelligt habe.
Delphi-Quellcode:
myForm[Ziffer].REHaupt.Paragraph.Numbering:=nsArabicNumbers
Allerdings geht die Aufzählung bei Null los. Welche Einstellungen muss ich verändern, damit die Aufzählung bei 1 los geht?

TSchüß Markus

toms 28. Mär 2004 16:55

Re: Aufzählungszeichen in TRxRichEdit
 
Hi,

Das TRxRichEdit.Paragraph hat leider nicht alle Members von TParaFormat2 gekapselt.
So lässt sich nicht das wNumberingStart von PARAFORMAT2 nicht direkt setzen.
Musst es so machen:


Delphi-Quellcode:
var
  fmt: TParaformat2;
begin
  FillChar(fmt, SizeOf(fmt), 0);
  fmt.cbSize := SizeOf(fmt);
  fmt.dwMask := PFM_NUMBERING or PFM_NUMBERINGSTART or PFM_NUMBERINGSTYLE or
                PFM_NUMBERINGTAB;
  fmt.wNumbering := 2;
  fmt.wNumberingStart := 1;
  fmt.wNumberingStyle := $0;
  RxRichEdit1.Perform(EM_SETPARAFORMAT, 0, lParam(@fmt));
end;

Hier der Vollständigkeit halber weitere Members von PARAFORMAT2 und deren Erklärungen:

Delphi-Quellcode:
uses
  RichEdit;

procedure TForm1.Button1Click(Sender: TObject);
var
  fmt: TParaformat2;
begin
  FillChar(fmt, SizeOf(fmt), 0);
  fmt.cbSize := SizeOf(fmt);
  // The PARAFORMAT2 structure is used to set the numbering style.
  // This is done through the following structure members:
  fmt.dwMask := PFM_NUMBERING or PFM_NUMBERINGSTART or PFM_NUMBERINGSTYLE or
                PFM_NUMBERINGTAB;
      // Set the following values (bitwise-or them together) to identify
      // which of the remaining structure members are valid:
      // PFM_NUMBERING, PFM_NUMBERINGSTART, PFM_NUMBERINGSTYLE, and PFM_NUMBERINGTAB
  fmt.wNumbering := 2;
      //0 no numbering or bullets
      //1 (PFN_BULLET) uses bullet character
      //2 Uses Arabic numbers (1, 2, 3, ...).
      //3 Uses lowercase letters (a, b, c, ...).
      //4 Uses uppercase letters (A, B, C, ...).
      //5 Uses lowercase Roman numerals (i, ii, iii, ...).
      //6 Uses uppercase Roman numerals (I, II, III, ...).
      //7 Uses a sequence of characters beginning with the Unicode
      //  character specified by the wNumberingStart member.
  fmt.wNumberingStart := 1;
      //  Starting value for numbering.
  fmt.wNumberingStyle := $200;
      // Styles for numbering:
      // 0 : Follows the number with a right parenthesis. 1)
      // $100 : Encloses the number in parentheses.      (1)
      // $200 : Follows the number with a period.         1.
      // $300 : Displays only the number.                 1 
      // $400 : Continues a numbered list without applying the next number or bullet.
      // $8000 : Starts a new number with wNumberingStart.
  fmt.wNumberingTab := 1440 div 4;
  // Minimum space between a paragraph number and the paragraph text, in twips

  RichEdit1.Perform(EM_SETPARAFORMAT, 0, lParam(@fmt));
end;

Markus K. 28. Mär 2004 17:00

Re: Aufzählungszeichen in TRxRichEdit
 
Hallo toms,
Vielen Dank!!! :thuimb: Habe es so auch in meinem Quelltext zustehen, habe aber PFM_NUMBERINGSTART unter dwMask nicht angegeben, das war es, nun gehts.
So ist es dann richtig.
Delphi-Quellcode:
Einstellung.cbSize := SizeOf(Einstellung);
Einstellung.dwMask := PFM_NUMBERINGSTART;
Einstellung.wNumberingStart := 1;
myForm[Ziffer].REHaupt.Perform(EM_SETPARAFORMAT, 0, lParam(@Einstellung));
Tschüß Markus


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz