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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mahdi78Commented:
try to add designide.dcp to requires clause of package
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.