Print Preview D5 Installation

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Print Preview D5 Installation

Postby Morozov » February 17th, 2009, 10:21 pm

Print Preview v5.12 can't be installed on Delphi 5: as I understand, because TCustomListView.ItemIndex is absent in Delphi 5.

I had to download and install Print Preview v4.75 from Torry.net; it didn't contain such problem.
Thank you for the useful component!
Morozov
Member
Member
 
Posts: 3
Joined: February 17th, 2009, 5:22 pm

Re: Print Preview D5 Installation

Postby Kambiz » February 18th, 2009, 12:59 am

Sorry for this inconvenience. Since I lost my old hard disk, I don't have older versions of Delphi to check the components against them.

To use version 5.12 in Delphi 5, add the two following methods to the Preview.pas unit:

Code: Select all
function TThumbnailPreview.GetItemIndex: Integer;
begin
  Result := -1;
  if inherited Selected <> nil then
    Result := inherited Selected.Index;
end;

procedure TThumbnailPreview.SetItemIndex(Value: Integer);
begin
  if Value >= 0 then
    Items[Value].Selected := True
  else if inherited Selected <> nil then
    inherited Selected.Selected := False;
end;

then, add these lines to the private section of the TThumbnailPreview class:

Code: Select all
function GetItemIndex: Integer;
procedure SetItemIndex(Value: Integer);

And, add the following line in the public section of that class:

Code: Select all
property ItemIndex: Integer read GetItemIndex write SetItemIndex;

Thanks for informing me about this problem.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Re: Print Preview D5 Installation

Postby Morozov » February 18th, 2009, 12:10 pm

Thank you for the fast reply. Other problems with the installation of Print Preview on Delphi 5:

TCustomListView.IsCustomDrawn is absent in D5, so there is no need to "override" it (this directive must be removed);
TCustomListView.DeleteSelected is absent in D5, so there is no need to "override" it (the directive must be removed);

TCustomListView.ClearSelection is absent in D5 (error in TThumbnailPreview.SetSelectedPages);
TCustomListView.DeleteSelected causes error in TThumbnailPreview.DeleteSelected.

I have tried to "fix" these methods in the text of preview.pas, compiled and installed the component, but then I have received the unpleasant surprise: the TThumbnailPreview doesn't draw thumbnails - only "transparent" rectangles instead of them (see picture).
Image

In version 4.75 this worked OK.

Windows 2000 SP4, Delphi 5.1.
Morozov
Member
Member
 
Posts: 3
Joined: February 17th, 2009, 5:22 pm

Re: Print Preview D5 Installation

Postby Kambiz » February 20th, 2009, 2:24 pm

Thank you very much for the information.

I guess I have to obtain older versions of Delphi and check the components.

I'll post the result right here.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Re: Print Preview D5 Installation

Postby Kambiz » February 20th, 2009, 3:02 pm

It was quite easy to figure out the problem.

Please check out the attachment, hope that it works.
Attachments
preview_unit_only.zip
Revised Preview.pas unit for D5
(35.72 KiB) Downloaded 66 times
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Re: Print Preview D5 Installation

Postby Morozov » February 21st, 2009, 9:43 pm

Thank you, the problem with installation on Delphi 5 is SOLVED. (I'm not a "admirer" of D5, but my customer wants the program made on this version of Delphi. Thank you very much for your extremely useful component.)
Morozov
Member
Member
 
Posts: 3
Joined: February 17th, 2009, 5:22 pm

Re: Print Preview D5 Installation

Postby Kambiz » February 22nd, 2009, 12:12 am

Thanks to you for your help and the valuable information.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: Bing [Bot] and 1 guest