Converting Delphi 5 code to Delphi 2010 Code

I am trying to make a Delphi 5 component's code work in Delphi 2010

Question 1:

The following code:

with AItem do
      begin
        LEditState := GetEditState;
        Visible := esCanZOrder in LEditState;
        AddItem(sToFrontControl, 0, False, True, HandleToFront);
        AddItem(sToBackControl, 0, False, True, HandleToBack);
      end;

I am getting a

Undeclared identifier: 'esCanZOrder'

It seems that this enum value existed in the old unit DsgnIntf;

as:

TEditState = set of (esCanUndo, esCanRedo, esCanCut, esCanCopy, esCanPaste,
    esCanDelete, esCanZOrder, esCanAlignGrid, esCanEditOle, esCanTabOrder,
        esCanCreationOrder, esCanPrint, esCanSelectAll);


but now, in the new unit DesignIntf

as:

TEditStates = (esCanUndo, esCanRedo, esCanCut, esCanCopy, esCanPaste,
    esCanDelete, esCanEditOle, esCanPrint, esCanSelectAll, esCanCreateTemplate,
    esCanElide);

The Type TEditState has been renamed TEditStates and the esCanZOrder no longer exists.


How to rectify this?????

Question 2:

The following code:



procedure TEditActionSelectionEditor.HandleToFront(Sender: TObject);
begin
  EditAction(eaBringToFront);
end;

I am getting a

Undeclared identifier: 'eaBringToFront'


Same thing with eaBringToFront, which was found in the old unit DsgnIntf

as:

TEditAction = (eaUndo, eaRedo, eaCut, eaCopy, eaPaste, eaDelete, eaSelectAll,
    eaPrint, eaBringToFront, eaSendToBack, eaAlignToGrid, eaFlipChildrenAll,
    eaFlipChildrenSelected);

but now, in the new unit DesignIntf

as:


TEditAction = (eaUndo, eaRedo, eaCut, eaCopy, eaPaste, eaDelete, eaSelectAll,
    eaPrint, eaElide);

eaBringToFront no longer exists.


How to rectify this?????


thanx
DelphiRulezAsked:
Who is Participating?
 
Mahdi78Commented:
try to add designide.dcp to requires clause of package
0
 
DelphiRulezAuthor Commented:
No that did not work

0
 
Mahdi78Commented:
try to put DesignIntf and DesignEditors instead of DsgnIntf and add designide.dcp to requires clause of package
0
 
DelphiRulezAuthor Commented:
Mahdi78:

I already changed the DsgnIntf to  DesignIntf . That was a given.

I did add the DesignEditors to the uses clause and the designide.dcp to requires

but got the same errors

i then remove  designide.dcp from requires

and I got one error and the ToolsAPI.pas file opened in my package

the error i get now is:

 File not found: 'DockForm.dcu'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.