IMHO.WS

IMHO.WS (https://www.imho.ws/index.php)
-   Программирование (https://www.imho.ws/forumdisplay.php?f=40)
-   -   Текстовый редактор. (https://www.imho.ws/showthread.php?t=74531)

PhoeniX 27.11.2004 19:44

Текстовый редактор.
 
Пишу текстовый редактор на Builder
Столкнулся с проблемами:
как организовать поля при печати?
как сделать предварительный просмотр?

Использую компонент RichEdit

/7y3uK 27.11.2004 19:58

Пользуйся компонентами для создания отчетностей, например Crystall Report, Quick Report (уже кстати встроен в билдер), Free Repor... ну ты понял :):) Кстати поищи, тут 100% поднималась похожая тема.

kot_ 29.11.2004 19:02

Или, используй TPrinter+TCanvas - если хочется все сделать самому. На канве рисуешь предпросмотр -на принтере печатаешь. Например так
Код:

TCanvas *pCanvas = Prn->Canvas;
 int PosVert = Vert,PosGor = 0;
  pCanvas->Brush->Color = clWhite;
  pCanvas->Font->Size = 14;
  pCanvas->Font->Color = clBlack;
  pCanvas->Font->Style=TFontStyles()<< fsBold;
  if(PosVert >= (Prn->PageHeight-BottomWidth)){
  Prn->NewPage();
  PosVert = TopWidth;
  }
  AnsiString String = InvoiceIn.GetName()+" № "+InvoiceIn.GetCode();
  if(Vert==0)PosVert = TopWidth;
  PosGor = Prn->PageWidth/2;
  PosGor -= (pCanvas->TextWidth(String)/2);

  pCanvas->TextOutA(PosGor,PosVert,String);
  if(PosVert >= (Prn->PageHeight-BottomWidth)){
  Prn->NewPage();
  PosVert = TopWidth;
  }
  PosVert += pCanvas->TextHeight(InvoiceIn.GetName()+" № "+InvoiceIn.GetName());
  pCanvas->Font->Size = 12;
  if(PosVert >= (Prn->PageHeight-BottomWidth)){
  Prn->NewPage();
  PosVert = TopWidth;
  }
  PosVert += (pCanvas->TextHeight(String)*2);

  String = "Дата: " + InvoiceIn.GetDate();
  PosGor = Prn->PageWidth/2;
  PosGor -= (pCanvas->TextWidth(String)/2);
  pCanvas->TextOutA(PosGor,PosVert,String);
  pCanvas->Font->Size = 10;
  if(PosVert >= (Prn->PageHeight-BottomWidth)){
  Prn->NewPage();
  PosVert = TopWidth;
  }
....
//И так далее.



Часовой пояс GMT +4, время: 19:59.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.