Print Preview D5 Installation

Post here your experiences, comments, suggestions, or bug reports regarding to the DELPHI AREA products. Not-matching topics will be moved or deleted.

Print Preview D5 Installation

by Morozov » 17/02/09 22:21

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: 17/02/09 17:22

Re: Print Preview D5 Installation

by Kambiz » 18/02/09 00:59

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

Donate a cup of food for free: Click to Give @ The Hunger Site

Kambiz
Administrator
Administrator
 
Posts: 1690
Joined: 07/03/03 19:10
Location: Tehran, Iran

Re: Print Preview D5 Installation

by Morozov » 18/02/09 12:10

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).


In version 4.75 this worked OK.

Windows 2000 SP4, Delphi 5.1.
Morozov
Member
Member
 
Posts: 3
Joined: 17/02/09 17:22

Re: Print Preview D5 Installation

by Kambiz » 20/02/09 14:24

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

Donate a cup of food for free: Click to Give @ The Hunger Site

Kambiz
Administrator
Administrator
 
Posts: 1690
Joined: 07/03/03 19:10
Location: Tehran, Iran

Re: Print Preview D5 Installation

by Kambiz » 20/02/09 15:02

It was quite easy to figure out the problem.

Please check out the attachment, hope that it works.
You do not have the required permissions to view the files attached to this post.
Kambiz

Donate a cup of food for free: Click to Give @ The Hunger Site

Kambiz
Administrator
Administrator
 
Posts: 1690
Joined: 07/03/03 19:10
Location: Tehran, Iran

Re: Print Preview D5 Installation

by Morozov » 21/02/09 21:43

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: 17/02/09 17:22

Re: Print Preview D5 Installation

by Kambiz » 22/02/09 00:12

Thanks to you for your help and the valuable information.
Kambiz

Donate a cup of food for free: Click to Give @ The Hunger Site

Kambiz
Administrator
Administrator
 
Posts: 1690
Joined: 07/03/03 19:10
Location: Tehran, Iran


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 0 guests