trichview.com

trichview.support




Style Is Not Assigned


Return to index


Author

Message

Joe Burton

Posted: 07/28/2002 7:24:19


Sergey,


I just upgraded from 1.25 to 1.6.36. I am using RVPrintPreview and I am

setting the Style property as I should. However,  after I do FormatPages and

exit my Preview method a call is made to GetTabOrderList(). The sequence of

calls are listed below. I end up with an error "Style is not assigned". Your

code makes two passes thru TCustomRVPrint.DrawPreview. The first time

RVStyle not nil. The second time, after you do a PagePrepaint RVStyle is

nil.


My code here

        SetHeader(FHeader1, FHeader2);

        FRVPrintEx.AssignSource(FRVPrintBuf);

        FRVPrintEx.FormatPages(rvdoAll);


Your code here calls:

procedure TCustomRichView.GetTabOrderList(List: TList);


CRVPP

procedure TCustomRVPrintPreview.Paint;

    ...

    with r do

          IntersectClipRect(canv.Handle,Left,Top,Right,Bottom);

        DrawContents(canv, r);  <==

    ...


PtblRV

procedure TCustomRVPrint.DrawPreview(pgNo: Integer; Canvas: TCanvas;

...

   rv.DrawPage(pgNo, Canvas, True, PreviewCorrection); <==

...


PtRVData

procedure TCustomPrintableRVData.DrawPage(pgNo: Integer; Canvas: TCanvas;

Preview, Correction: Boolean);

    ...

      RVStyle := GetRVStyle;   <= first time thru OK, not nil

      if RVStyle=nil then

        raise ERichViewError.Create(errStyleIsNotAssigned);


    ...

      DrawBackground;

    ...


procedure TPrintableRVData.DoPagePrepaint(Canvas: TCanvas; PageNo:Integer;

Preview, Correction: Boolean);

    ...

        Header.DrawPage(1, Canvas, Preview, Correction);

    ...


procedure TCustomPrintableRVData.DrawPage(pgNo: Integer; Canvas: TCanvas;

Preview, Correction: Boolean);

    ...

      RVStyle := GetRVStyle;    <= 2nd time thru RVStyle = nil

      if RVStyle=nil then

        raise ERichViewError.Create(errStyleIsNotAssigned);

    ...


Thanks,

Joe.





Powered by ABC Amber Outlook Express Converter