Пару вопросов по текстовому редактору в делфи

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by aydar, 1 Apr 2011.

  1. aydar

    aydar Member

    Joined:
    12 Nov 2009
    Messages:
    259
    Likes Received:
    6
    Reputations:
    -2
    Вообщем у меня не получаеться сделать выравнивание по ширине, подсчет стр.

    по ширине пробую так (зы у меня мемо1 это ричедит :) )

    Code:
    procedure TForm1.ToolButton15Click(Sender: TObject);
    const
      TO_ADVANCEDTYPOGRAPHY         = $0001;
      TO_SIMPLELINEBREAK            = $0002;
      EM_SETTYPOGRAPHYOPTIONS       = $04CA;
      PFA_JUSTIFY                   = $0004;
      // Rich Edit 2.0: Paragraphs are justified. This value is included for compatibility with TOM interfaces; rich edit controls earlier than Rich Edit 3.0 display the text aligned with the left margin.
      PFA_FULL_INTERWORD            = $0005;
      // Paragraphs are justified by expanding the blanks alone.
    var
      lParagraph: TParaFormat2;
    begin
      ZeroMemory(@lParagraph, SizeOf(TParaFormat2));
      lParagraph.cbSize := SizeOf(TParaFormat2);
      lParagraph.dwMask := PFM_ALIGNMENT;
      lParagraph.wAlignment := PFA_JUSTIFY;
      SendMessage(memo1.Handle, EM_SETTYPOGRAPHYOPTIONS,
        TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY);
      SendMessage(memo1.Handle, EM_SETPARAFORMAT, 0, Integer(@lParagraph));
    end;
    
    а стр в ричедит я хз как посчитать.
     
  2. Cock3r

    Cock3r New Member

    Joined:
    19 Jan 2011
    Messages:
    14
    Likes Received:
    3
    Reputations:
    0

    стр - строки?
    RichEdit.Lines.Count
     
  3. aydar

    aydar Member

    Joined:
    12 Nov 2009
    Messages:
    259
    Likes Received:
    6
    Reputations:
    -2
    Страниц
     
Loading...