Solved

Delphi 3 source code produces errors when compiled with Delphi 5

Posted on 2001-07-10
9
321 Views
Last Modified: 2010-04-06
I did not write the code but need to do minor application changes. I don't really know Delphi. :-(

The application compiles and runs cleanly under Delphi 3 with the DsgnIntf.dcu reference included in the interface.

This unit is missing from supplied Lib of Delphi 5 and error is produced. Other unit has insufficient parameters errors.

What do I do to remedy the situation?

Thank you experts!

Here is the code someone asked for:

unit TabLists;
(*

      Note: If this unit is compiled with SHAREWARE_VER defined,
        it will limit the number of lines it displays to 5.

      To Do:
      ------
      - handle THeader's OnSizing and OnSized events
      - handle deletion of related THeader component from from
      - spruce up column property dialog
      - move/size header along with listboxes

*)

interface

uses
      WinTypes, SysUtils, Graphics, Controls, StdCtrls, ExtCtrls,
      Classes, Forms, Menus, Buttons,
        DsgnIntf;

const
      TabChar = #9;
      TabCharStr: string = TabChar;

type
      TColumnRange = 0..255;
      TColumnJust = (cjLeft, cjRight, cjCenter, cjCurrency);

      TColumnInfo = class(TPersistent)
      private
            FNumColumns: TColumnRange;
            FWidth: array[TColumnRange] of integer;
            FJust: array[TColumnRange] of TColumnJust;
            FGap: array[TColumnRange] of integer;
            FCurrencyTrailer: string;
            FOnChange: TNotifyEvent;
//            procedure SetNumColumns(NewValue: integer);
            function GetWidth(Index: TColumnRange): integer;
            procedure SetWidth(Index: TColumnRange;
                          NewWidth: integer);
            function GetJust(Index: TColumnRange): TColumnJust;
            procedure SetJust(Index: TColumnRange;
                         NewJust: TColumnJust);
            function GetGap(Index: TColumnRange): integer;
            procedure SetGap(Index: TColumnRange;
                                            NewGap: integer);
            procedure SetCurrencyTrailer(NewValue: string);
            procedure ReadColumns(Reader: TReader);
            procedure WriteColumns(Writer: TWriter);
      protected
            procedure DefineProperties(Filer: TFiler); override;
            procedure Changed;

      public
            procedure Assign(NewValue: TColumnInfo);

            class function ColJustToStr(Just: TColumnJust): string;
            class function StrToColJust(Str: string): TColumnJust;

            class function EncodeColStr(Width: integer;
                    Just: TColumnJust;
                    Gap: integer): string;
            class procedure DecodeColStr(ColStr: string;
                    var Width: integer;
                    var Just: TColumnJust;
                    var Gap: integer);

            property Width[Index: TColumnRange]:
                        integer read GetWidth write SetWidth;
            property Just[Index: TColumnRange]:
                        TColumnJust read GetJust write SetJust;
            property Gap[Index: TColumnRange]:
                        integer read GetGap write SetGap;
      published
            property NumColumns: TColumnRange
                        read FNumColumns write FNumColumns;
            property CurrencyTrailer: string
                        read FCurrencyTrailer write SetCurrencyTrailer;
            property OnChange: TNotifyEvent read FOnChange write FOnChange;
      end;

      ETabbedListMgr = Exception;
      TTabbedListMgr = class
      private
            Columns: TColumnInfo;
            function GetColumnString(Col: integer;
                                s: string): string;
            function GetCellRect(Col: integer;
                                     EntireRect: TRect): TRect;
            procedure DrawCell(Canvas: TCanvas;
                                            Rect: TRect;
                                            Str: string;
                                            Just: TColumnJust;
                                            State: TOwnerDrawState);
      public
            constructor Create(AColumns: TColumnInfo);
            procedure DrawItem(Control: TWinControl;
                                            Index: integer;
                                            Rect: TRect;
                                            ItemString: string;
                                            State: TOwnerDrawState);
            procedure SyncHeader(Control: TWinControl;
                                           Header: THeader);
      end;

      TTabbedListBox = class(TCustomListBox)
      private
            FColumns: TColumnInfo;
            FHeader: THeader;
            tlm: TTabbedListMgr;
            procedure SetColumns(NewValue: TColumnInfo);
            procedure SetHeader(NewHeader: THeader);
      protected
            procedure HandleDrawItem(Control: TWinControl;
                                      Index: integer;
                                      Rect: TRect;
                                      State: TOwnerDrawState); virtual;
            procedure Redraw(Sender: TObject);
      public
            constructor Create(AOwner: TComponent); override;
            destructor Destroy; override;
            procedure SyncHeader(Header: THeader);
      published
            { Properties }
            property Align;
            property BorderStyle;
            property Color;
            property Columns: TColumnInfo read FColumns write SetColumns;
            property Ctl3D;
            property Cursor;
            property DragCursor;
            property DragMode;
            property Enabled;
            property ExtendedSelect;
            property Font;
            property Header: THeader read FHeader write SetHeader;
            property Height;
            property HelpContext;
            property Hint;
            property IntegralHeight;
            property ItemHeight;
            property Items;
            property Left;
            property MultiSelect;
            property Name;
            property ParentColor;
            property ParentCtl3D;
            property ParentFont;
            property ParentShowHint;
            property PopupMenu;
            property ShowHint;
            property Sorted;
            property TabOrder;
            property TabStop;
            property Tag;
            property Top;
            property Visible;
            property Width;

            { Events }
            property OnClick;
            property OnDblClick;
            property OnDragDrop;
            property OnDragOver;
            property OnEndDrag;
            property OnEnter;
            property OnExit;
            property OnKeyDown;
            property OnKeyPress;
            property OnKeyUp;
            property OnMouseDown;
            property OnMouseMove;
            property OnMouseUp;
      end;

      TTabbedDropDownListBox = class(TCustomComboBox)
      private
            FColumns: TColumnInfo;
            FHeader: THeader;
            tlm: TTabbedListMgr;
            procedure SetColumns(NewValue: TColumnInfo);
            procedure SetHeader(NewHeader: THeader);
      protected
            procedure HandleDrawItem(Control: TWinControl;
                                Index: integer;
                                Rect: TRect;
                                State: TOwnerDrawState); virtual;
            procedure Redraw(Sender: TObject);
      public
            constructor Create(AOwner: TComponent); override;
            destructor Destroy; override;
            procedure SyncHeader(Header: THeader);
      published
            { Properties }
            property Color;
            property Columns: TColumnInfo read FColumns write SetColumns;
            property Ctl3D;
            property Cursor;
            property DragCursor;
            property DragMode;
            property DropDownCount;
            property Enabled;
            property Font;
            property Header: THeader read FHeader write SetHeader;
            property Height;
            property HelpContext;
            property Hint;
            property ItemHeight;
            property Items;
            property Left;
            property MaxLength;
            property Name;
            property ParentColor;
            property ParentCtl3D;
            property ParentFont;
            property ParentShowHint;
            property PopupMenu;
            property ShowHint;
            property Sorted;
            property TabOrder;
            property TabStop;
            property Tag;
            property Text;
            property Top;
            property Visible;
            property Width;

            { Events }
            property OnChange;
            property OnClick;
            property OnDblClick;
            property OnDragDrop;
            property OnDragOver;
            property OnDropDown;
            property OnEndDrag;
            property OnEnter;
            property OnExit;
            property OnKeyDown;
            property OnKeyPress;
            property OnKeyUp;
      end;

      TEditColumnInfoDlg = class(TForm)
            OKBtn: TBitBtn;
            CancelBtn: TBitBtn;
            Panel1: TPanel;
            Label3: TLabel;
            GroupBox2: TGroupBox;
            Label1: TLabel;
            Label2: TLabel;
            ColumnText: TMemo;
            Memo1: TMemo;
            CurrencyTrailer: TEdit;
            procedure OKBtnClick(Sender: TObject);
      private
            procedure DisplayInfo(ci: TColumnInfo);
            procedure RetrieveValues(ci: TColumnInfo);
      public
            class function Execute(Columns: TColumnInfo): boolean;
      end;

      TColumnInfoProperty = class(TClassProperty)
      public
            function GetAttributes: TPropertyAttributes; override;
            procedure Edit; override;
      end;


procedure Register;

implementation

{$R *.DFM}

uses
      Dialogs;


(* Implementation of TColumnInfo *)

procedure TColumnInfo.SetNumColumns(NewValue: integer);
begin
      if NewValue <> FNumColumns then
      begin
            FNumColumns := NewValue;
            Changed;
      end;
end;

function TColumnInfo.GetWidth(Index: TColumnRange): integer;
begin
      Result := FWidth[Index];
end;

procedure TColumnInfo.SetWidth(Index: TColumnRange;
                                NewWidth: integer);
begin
      if NewWidth <> FWidth[Index] then
      begin
            FWidth[Index] := NewWidth;
            Changed;
      end;
end;

function TColumnInfo.GetJust(Index: TColumnRange): TColumnJust;
begin
      Result := FJust[Index];
end;

procedure TColumnInfo.SetJust(Index: TColumnRange;
                                NewJust: TColumnJust);
begin
      if NewJust <> FJust[Index] then
      begin
            FJust[Index] := NewJust;
            Changed;
      end;
end;

function TColumnInfo.GetGap(Index: TColumnRange): integer;
begin
      Result := FGap[Index];
end;

procedure TColumnInfo.SetGap(Index: TColumnRange;
                                 NewGap: integer);
begin
      if NewGap <> FGap[Index] then
      begin
            FGap[Index] := NewGap;
            Changed;
      end;
end;

procedure TColumnInfo.SetCurrencyTrailer(NewValue: string);
begin
      if NewValue <> FCurrencyTrailer then
      begin
            FCurrencyTrailer := NewValue;
            Changed;
      end;
end;

procedure TColumnInfo.ReadColumns(Reader: TReader);
var
      i: integer;
      ColStr: string;
      TempWidth: integer;
      TempJust: TColumnJust;
      TempGap: integer;
begin
      with Reader do
      begin
            ReadListBegin;
            i := -1;
            while not EndOfList do
            begin
                  Inc(i);
                  ColStr := ReadString;
                  DecodeColStr(ColStr, TempWidth, TempJust, TempGap);
                  Width[i] := TempWidth;
                  Just[i] := TempJust;
                  Gap[i] := TempGap;
            end;
            ReadListEnd;
      end;

      if i <> NumColumns - 1 then
      begin
            raise Exception.Create('Expecting ' + IntToStr(NumColumns) +
                               ' columns, read ' + IntToStr(i + 1));
      end;
end;

procedure TColumnInfo.WriteColumns(Writer: TWriter);
var
      i: integer;
      ColStr: string;
begin
      with Writer do
      begin
            WriteListBegin;
            for i := 0 to NumColumns - 1 do
            begin
                  ColStr := EncodeColStr(Width[i], Just[i], Gap[i]);
                  WriteString(ColStr);
            end;
            WriteListEnd;
      end;
end;

procedure TColumnInfo.DefineProperties(Filer: TFiler);
begin
      Filer.DefineProperty('Columns', ReadColumns,
                WriteColumns, NumColumns > 0);
end;

procedure TColumnInfo.Changed;
begin
      if Assigned(FOnChange) then
            OnChange(self);
end;

procedure TColumnInfo.Assign(NewValue: TColumnInfo);
begin
      NumColumns := NewValue.NumColumns;
      CurrencyTrailer := NewValue.CurrencyTrailer;
      FJust := NewValue.FJust;
      FWidth := NewValue.FWidth;
      FGap := NewValue.FGap;
end;

class function TColumnInfo.ColJustToStr(Just: TColumnJust): string;
begin
      case Just of
            cjLeft:
                  Result := 'L';
            cjRight:
                  Result := 'R';
            cjCenter:
                  Result := 'C';
            cjCurrency:
                  Result := 'M';
      end;
end;

class function TColumnInfo.StrToColJust(Str: string): TColumnJust;
begin
      case UpperCase(Str)[1] of
            'L':
                  Result := cjLeft;
            'R':
                  Result := cjRight;
            'C':
                  Result := cjCenter;
            'M':
                  Result := cjCurrency;
            else
                  raise EConvertError.Create('Unknown justification code '''
                                + Str + '''');
      end;
end;

class procedure TColumnInfo.DecodeColStr(ColStr: string;
               var Width: integer;
               var Just: TColumnJust;
               var Gap: integer);

      procedure GetNextPart(var SrcStr: string;
                         var NextPart: string);

            function IsAlphaNum(c: char): boolean;
            begin
                  if (c >= '0') and (c <= '9') then
                        Result := true
                  else
                  begin
                        c := LowerCase(c)[1];
                        Result := (c >= 'a') and (c <= 'z');
                  end
            end;

      var
            c: char;
            Done: boolean;
      begin
            { Read in next part }
            NextPart := '';
            Done := false;
            while not Done and (length(SrcStr) <> 0) do
            begin
                  c := SrcStr[1];
                  Done := not IsAlphaNum(c);
                  if not Done then
                  begin
                        NextPart := NextPart + c;
                        Delete(SrcStr, 1, 1);
                  end;
            end;

{ Sitting at first non-alphanumeric after value. Kill inter-value chars }
            Done := false;
            while not Done and (length(SrcStr) <> 0) do
            begin
                  c := SrcStr[1];
                  Done := IsAlphaNum(c);
                  if not Done then
                  begin
                        Delete(SrcStr, 1, 1);
                  end;
            end;
      end;

var
      OrigColStr: string;
      Part: string;
begin
      try
            OrigColStr := ColStr;
            GetNextPart(ColStr, Part);
            Width := StrToInt(Part);
            GetNextPart(ColStr, Part);
            Just := StrToColJust(Part);
            GetNextPart(ColStr, Part);
            Gap := StrToInt(Part);
      except
            on e: EConvertError do
            begin
                  raise EConvertError.Create('Error in column data: '
                                + e.Message +
                        '. Original string is: ' + OrigColStr);
            end;
      end;
end;

class function TColumnInfo.EncodeColStr(Width: integer;
             Just: TColumnJust;
             Gap: integer): string;
begin
      Result := IntToStr(Width)
                + ' ' + ColJustToStr(Just) + ' ' + IntToStr(Gap);
end;


(* Implementation of TTabbedListMgr *)

constructor TTabbedListMgr.Create(AColumns: TColumnInfo);
begin
      inherited Create;
      Columns := AColumns;
end;

procedure TTabbedListMgr.DrawItem(Control: TWinControl;
            Index: integer;
            Rect: TRect;
            ItemString: string;
            State: TOwnerDrawState);
var
      CurrCol: integer;
      CellStr: string;
      CellRect: TRect;
      Canvas: TCanvas;
begin
      { Get the control's canvas (if it has one!)}
      if Control is TCustomListBox then
            Canvas := TCustomListBox(Control).Canvas
      else if Control is TCustomComboBox then
            Canvas := TCustomComboBox(Control).Canvas
      else
        raise ETabbedListMgr.Create('Cannot handle drawing for objects of type '
                 + Control.ClassName);

      Canvas.FillRect(Rect);

{$IFDEF SHAREWARE_VER}
      { Limit shareware version to 5 lines }
      if Index > 4 then
            Exit;
{$ENDIF}

      for CurrCol := 0 to Columns.NumColumns - 1 do
      begin
            CellStr := GetColumnString(CurrCol, ItemString);
            CellRect := GetCellRect(CurrCol, Rect);
            DrawCell(Canvas,
                        GetCellRect(CurrCol, Rect),
                        CellStr, Columns.Just[CurrCol], State);
      end;
end;

procedure TTabbedListMgr.SyncHeader(Control: TWinControl;
                        Header: THeader);
var
      i: integer;
begin
      Header.Left := Control.Left;
      Header.Width := Control.Width;
      Header.Top := Control.Top - Header.Height + 1;
      with Columns do
      begin
            for i := 0 to NumColumns - 1 do
            begin
                  Header.SectionWidth[i] := Width[i] + Gap[i];
            end;
      end;
end;

function TTabbedListMgr.GetColumnString(Col: integer;
                   s: string): string;
var
      TabStr: string;
      i: integer;
      p: byte;
begin
      Result := s;
      TabStr := TabChar;
      for i := 0 to Col - 1 do { Skip past the first columns }
      begin
            p := Pos(TabStr, Result);
            if p = 0 then { No more tabs: use empty string }
                  Delete(Result, 1, 255)
            else
                  Delete(Result, 1, p);
      end;

      p := Pos(TabStr, Result); { Remove any remaining columns }
      if p > 0 then
      begin
            Delete(Result, p, 255);
      end;
end;

function TTabbedListMgr.GetCellRect(Col: integer;
                  EntireRect: TRect): TRect;
var
      i: integer;
begin
      Result := EntireRect;
      for i := 0 to Col - 1 do
      begin
            Inc(Result.Left, Columns.Width[i] + Columns.Gap[i]);
      end;
      Result.Right := Result.Left + Columns.Width[Col];
end;

procedure TTabbedListMgr.DrawCell(Canvas: TCanvas;
                   Rect: TRect;
                   Str: string;
                   Just: TColumnJust;
                   State: TOwnerDrawState);
var
      OrigFontColor: TColor;
      s: AnsiString;
      DrawTextExStyle: UINT;
begin
      OrigFontColor := Canvas.Font.Color;
      case Just of
            cjLeft:
            begin
                  DrawTextExStyle := DT_LEFT;
            end;

            cjRight:
            begin
                  DrawTextExStyle := DT_RIGHT;
            end;

            cjCenter:
            begin
                  DrawTextExStyle := DT_CENTER;
            end;

            cjCurrency:
            begin
                  DrawTextExStyle := DT_RIGHT;
                  if Pos(Columns.CurrencyTrailer, Str) = 0 then
                  begin
                          Dec(Rect.Right,
                                Canvas.TextWidth(Columns.CurrencyTrailer));
                  end
                  else
                  begin
                        Canvas.Font.Color := clRed;
                  end;
            end;

      end;

      // Check for -ve integer value: set red if so
      if StrToIntDef(Str, 0) < 0 then
      begin
            Canvas.Font.Color := clRed;
      end;

      // Center text vertically in item
      Inc(Rect.Top, (Rect.Bottom - Rect.Top - Canvas.TextHeight(Str)) div 2);

      // Draw the item
      s := Str;
      DrawTextEx(Canvas.Handle,
                          PChar(s),
                          -1,
                          Rect,
                          DrawTextExStyle or
                                  DT_END_ELLIPSIS or DT_NOPREFIX,  nil);

      Canvas.Font.Color := OrigFontColor;
end;


(* Implementation of TTabbedListBox *)

constructor TTabbedListBox.Create(AOwner: TComponent);
begin
      inherited Create(AOwner);
      FColumns := TColumnInfo.Create;
      FColumns.OnChange := Redraw;
      tlm := TTabbedListMgr.Create(FColumns);
      Style := lbOwnerDrawFixed;
      OnDrawItem := HandleDrawItem;
end;

destructor TTabbedListBox.Destroy;
begin
      tlm.Free;
      FColumns.Free;
      inherited Destroy;
end;

procedure TTabbedListBox.Redraw(Sender: TObject);
begin
      if FHeader <> nil then
            SyncHeader(FHeader);
      Refresh;
end;

procedure TTabbedListBox.SetColumns(NewValue: TColumnInfo);
begin
      FColumns.Assign(NewValue);
end;

procedure TTabbedListBox.SetHeader(NewHeader: THeader);
begin
      if (NewHeader <> nil)
                and (Columns.NumColumns <> NewHeader.Sections.Count) then
      begin
            MessageDlg('Tabbed listbox has '
                  + IntToStr(Columns.NumColumns) +
              ' columns, its header has '
                  + IntToStr(NewHeader.Sections.Count) +
              '. Adjust the header''s sections, then reselect the ' +
              'listbox''s header.',  mtError, [mbOK], 0);
      end
      else
      begin
            FHeader := NewHeader;
            Redraw(self);
      end;
end;

procedure TTabbedListBox.HandleDrawItem(Control: TWinControl;
            Index: integer;
            Rect: TRect;
            State: TOwnerDrawState);
begin
      tlm.DrawItem(Control, Index, Rect, Items.Strings[Index], State);
end;

procedure TTabbedListBox.SyncHeader(Header: THeader);
begin
      tlm.SyncHeader(self, Header);
end;


(* Implementation of TTabbedDropDownListBox *)

constructor TTabbedDropDownListBox.Create(AOwner: TComponent);
begin
      inherited Create(AOwner);
      FColumns := TColumnInfo.Create;
      FColumns.OnChange := Redraw;
      tlm := TTabbedListMgr.Create(FColumns);
      Style := csOwnerDrawFixed;
      OnDrawItem := HandleDrawItem;
end;

destructor TTabbedDropDownListBox.Destroy;
begin
      tlm.Free;
      FColumns.Free;
      inherited Destroy;
end;

procedure TTabbedDropDownListBox.Redraw(Sender: TObject);
begin
      if FHeader <> nil then
            SyncHeader(FHeader);
      Refresh;
end;

procedure TTabbedDropDownListBox.SetColumns(NewValue: TColumnInfo);
begin
      FColumns.Assign(NewValue);
end;

procedure TTabbedDropDownListBox.SetHeader(NewHeader: THeader);
begin
      if (NewHeader <> nil)
        and (Columns.NumColumns <> NewHeader.Sections.Count) then
      begin
           MessageDlg('Tabbed listbox has ' + IntToStr(Columns.NumColumns) +
            ' columns, its header has ' + IntToStr(NewHeader.Sections.Count) +
            '. Adjust the header''s sections, then reselect the ' +
            'listbox''s header.', mtError, [mbOK], 0);
      end
      else
      begin
            FHeader := NewHeader;
            Redraw(self);
      end;
end;

procedure TTabbedDropDownListBox.HandleDrawItem(Control: TWinControl;
             Index: integer;
             Rect: TRect;
             State: TOwnerDrawState);
begin
      tlm.DrawItem(Control, Index, Rect, Items.Strings[Index], State);
end;

procedure TTabbedDropDownListBox.SyncHeader(Header: THeader);
begin
      tlm.SyncHeader(self, Header);
end;


(* Implementation of TEditColumnInfoDlg *)

procedure TEditColumnInfoDlg.DisplayInfo(ci: TColumnInfo);
var
      i: integer;
begin
      CurrencyTrailer.Text := ci.CurrencyTrailer;
      ColumnText.Lines.Clear;
      for i := 0 to ci.NumColumns - 1 do
      begin
              ColumnText.Lines.Add(ci.EncodeColStr(ci.Width[i],
                ci.Just[i], ci.Gap[i]));
      end;
end;

procedure TEditColumnInfoDlg.OKBtnClick(Sender: TObject);
var
      NumCols: integer;
      i: integer;
      Width: integer;
      Just: TColumnJust;
      Gap: integer;
begin
      try
            NumCols := ColumnText.Lines.Count;
            for i := 0 to NumCols - 1 do
                  TColumnInfo.DecodeColStr(ColumnText.Lines.Strings[i],
                        Width, Just, Gap);
      except
            on e: EConvertError do
            begin
                  MessageDlg('Syntax error in line ' + IntToStr(i + 1) +
                        '. ' + e.Message, mtError, [mbOK], 0);
                  ColumnText.SetFocus;
                  ModalResult := mrNone;
            end;
      end;
end;

procedure TEditColumnInfoDlg.RetrieveValues(ci: TColumnInfo);
var
      i: integer;
      Width: integer;
      Just: TColumnJust;
      Gap: integer;
begin
      ci.NumColumns := ColumnText.Lines.Count;
      ci.CurrencyTrailer := CurrencyTrailer.Text;
      for i := 0 to ci.NumColumns - 1 do
      begin
            ci.DecodeColStr(ColumnText.Lines.Strings[i], Width, Just, Gap);
            ci.Width[i] := Width;
            ci.Just[i] := Just;
            ci.Gap[i] := Gap;
      end;
end;

class function TEditColumnInfoDlg.Execute(Columns: TColumnInfo): boolean;
var
      dlg: TEditColumnInfoDlg;
begin
      Result := false;
      dlg := TEditColumnInfoDlg.Create(Application);
      try
            dlg.DisplayInfo(Columns);
            if dlg.ShowModal = mrOK then
            begin
                  dlg.RetrieveValues(Columns);
                  Result := true;
            end;
      finally
            dlg.Free;
      end;
end;


(* Implementation of TColumnInfoProperty editor *)

function TColumnInfoProperty.GetAttributes: TPropertyAttributes;
begin
      Result := [paMultiSelect, paReadOnly, paDialog];
end;

procedure TColumnInfoProperty.Edit;
var
      Columns: TColumnInfo;
begin
      Columns := TColumnInfo(GetOrdValue);
      if TEditColumnInfoDlg.Execute(Columns) then
            SetOrdValue(longint(Columns));
end;


(* Register components and property editor with Delphi *)

procedure Register;
begin
      RegisterComponents('Jenex', [TTabbedListBox,
               TTabbedDropDownListBox]);
      RegisterPropertyEditor(TypeInfo(TColumnInfo),
              nil, '', TColumnInfoProperty);
end;


end.
0
Comment
Question by:joedob
  • 3
  • 3
  • 3
9 Comments
 
LVL 2

Expert Comment

by:bugroger
Comment Utility
Can you post the code?
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
I found dsgnintf.pas under ..\Delphi5\source\toolsapi
You may try recompiling the file to create the desired dcu file.
or
Try adding the file to your uses statement.

You may also need to Set the environment options to browse this library $[DELPHI]\source\toolsapi

Open Delphi
Click Tools | Environment Options | Library
Modify the Browseing Path
0
 
LVL 2

Expert Comment

by:bugroger
Comment Utility
3Yes,
 Just
  "Set the environment options to browse this library
   $[DELPHI]\source\toolsapi

  Open Delphi
  Click Tools | Environment Options | Library
  Modify the Browseing Path "

and put this function in brackets:

{procedure TColumnInfo.SetNumColumns(NewValue: integer);
begin
 ...
end;}

now it should be ready to compiles.
I'm not sure. But it could be that the list items won't
be drawn?!

GL
 Bug
0
 

Author Comment

by:joedob
Comment Utility
Please let me know if the DsgnIntf unit is contained in
$[DELPHI]\source\toolsapi in your Delphi 5. I have downloaded only the trial version. The ToolsAPI folder is in DEMOS folder. DsgnIntf is not included anywhere in the
trial version.

I asked Borland pre-sales support and they suggested that
the application does "not segragate design time from run time"?!



 
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 21

Expert Comment

by:gemarti
Comment Utility
I am using Delphi 5 Professional.

0
 
LVL 2

Accepted Solution

by:
bugroger earned 100 total points
Comment Utility
I' m using Delphi 5 Enterprise
0
 

Author Comment

by:joedob
Comment Utility
Why is Delphi Trial version different from the commercial product??? It says it's Enterprise edition and the file is
not there, directory structure is obviously different.
Worse yet, Borland presales support does not acknowledge
the problem. I'll go back to them and request a copy of the file. Thanks for the help.  
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
I guess this is what got bugroger the point's?

{procedure TColumnInfo.SetNumColumns(NewValue: integer);
begin
...
end;}

I think this is why I stopped coming here in the first place.
0
 

Author Comment

by:joedob
Comment Utility
As I said before I don't really know Delphi and am
trying to compile a bunch of Delphi 3 code under
Delphi 5 enterprise trial. Borland "presales support"
was of no help. Bugroger was the first one to confirm that
the DsgnIntf.dcu is contained in Delphi 5 enterprise commercial issue.
To gemarti: I don't understand your last comment and
the Delphi statement. As far as I am concerned, you only
confirmed what bugroger said first for which I thank you, but the system allows for points award to one expert only,
right?
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange message in Delphi 10 Seattle 1 463
Simple Delphi Question 9 77
code issue 8 84
Convert a string into a TDateTime 5 44
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now