Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
163
Добавлен:
11.05.2015
Размер:
4.73 Mб
Скачать

Example

The following procedure illustrates the wOnNextPageBtnClick Event:

procedure TForm1.Crpe1wOnNextPageBtnClick(WindowHandle: Integer; var Cancel: Boolean);

begin

with Memo1.Lines do begin

Add('wOnNextPageBtnClick Event:'); Add(' - Next Page Button clicked ');

Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add('');

end; end;

wOnPreviousPageBtnClick

wOnPreviousPageBtnClick takes place after the PreviousPage button on the Preview Window button bar is clicked, but before going to the previous page. This event passes the following variables:

WindowHandle

The Handle to the current Preview Window.

 

 

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

Declaration

property wOnPreviousPageBtnClick: TCrpeGeneralPrintWindowEvent;

Type

TCrpeGeneralPrintWindowEvent = procedure(WindowHandle: HWnd; var Cancel: Boolean) of object;

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnPreviousPageBtnClick Event:

procedure TForm1.Crpe1wOnPreviousPageBtnClick(WindowHandle: Integer; var Cancel: Boolean);

begin

with Memo1.Lines do

VCL Reference

188

begin

Add('wOnPreviousPageBtnClick Event:'); Add(' - Previous Page Button clicked ');

Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add('');

end; end;

wOnPrintBtnClick

wOnPrintBtnClick takes place after the Print button on the Preview Window button bar is clicked, but before the printing process starts. This event passes the following variables:

WindowHandle

The Handle to the current Preview Window.

 

 

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

 

 

Declaration

property wOnPrintBtnClick: TCrpeGeneralPrintWindowEvent;

Type

TCrpeGeneralPrintWindowEvent = procedure(WindowHandle: HWnd; var Cancel: Boolean) of object;

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnPrintBtnClick Event:

procedure TForm1.Crpe1wOnPrintBtnClick(WindowHandle: Integer; var Cancel: Boolean);

begin

with Memo1.Lines do begin

Add('wOnPrintBtnClick Event:'); Add(' - Print Button clicked ');

Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add('');

end; end;

VCL Reference

189

wOnPrintSetupBtnClick

wOnPrintSetupBtnClick takes place after the PrintSetup button on the Preview Window button bar is clicked, but before showing the Print Setup dialog box. This event passes the following variables:

WindowHandle

The Handle to the current Preview Window.

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

 

 

Declaration

property wOnPrintSetupBtnClick: TCrpeGeneralPrintWindowEvent;

Type

TCrpeGeneralPrintWindowEvent = procedure(WindowHandle: HWnd; var Cancel: Boolean) of object;

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnPrintSetupBtnClick Event:

procedure TForm1.Crpe1wOnPrintSetupBtnClick(WindowHandle: Integer; var Cancel: Boolean);

begin

with Memo1.Lines do begin

Add('wOnPrintSetupBtnClick Event:'); Add(' - Print Setup Button clicked ');

Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add('');

end; end;

VCL Reference

190

wOnReadingRecords

wOnReadingRecords takes place during a reading of the database or regenerating saved data process. It is triggered after a specified amount of time, not after reading every Record. This event passes the following variables:

Cancelled

Indicates whether the reading Records is canceled.

 

 

RecordsRead

Indicates how many Records have been read so far.

 

 

RecordsSelected

Indicates how many Records have been selected so far.

 

 

Done

Indicates whether reading Records is finished.

Cancel

A variable that can be set to True to cancel the normal Preview Window

 

response to the Event.

 

 

Declaration

property wOnReadingRecords: TCrpeReadingRecordsEvent;

Type

TCrpeReadingRecordsEvent = procedure(Cancelled: boolean; RecordsRead: longint; RecordsSelected: longint; Done: boolean; var Cancel: boolean) of object;

Remarks

You must be using Crystal 6.0 or higher to use Window Events.

Example

The following procedure illustrates the wOnReadingRecords Event:

procedure TForm1.Crpe1wOnReadingRecords(Cancelled: Boolean; RecordsRead, RecordsSelected: Integer; Done: Boolean; var Cancel: Boolean);

begin

with Memo1.Lines do begin

Add('wOnReadingRecords Event:');

Add(' - Reading Records Event triggered ');

Add(' - WindowHandle: ' + IntToStr(WindowHandle));

Add(' - Records Read: ' + IntToStr(RecordsRead));

Add(' - Records Selected: ' + IntToStr(RecordsSelected)); Add(' - Cancelled: ' + BooleanToStr(Cancelled));

Add(' - Done: ' + BooleanToStr(Done)); Add('');

end; end;

VCL Reference

191

Соседние файлы в папке crystal