Jump to content
Ian Branch

ThemesEnabled deprecated..

Recommended Posts

Hi Team,

I am updating a piece of code to D10.3 and have reached a confusing point.

The original code is..

{code}

      if ThemesEnabled then DrawElement(Canvas.Handle,GetElementDetails(tebExplorerBarRoot), ClientRect)

     else

     ....

{code}

To this I was getting the message at build time.. "[dcc32 Warning] myprocs.pas(123🙂 W1000 Symbol 'ThemesEnabled' is deprecated: 'Use TCustomStyleServices.Enabled'"

So, I changed the code to..

{code}

//      if ThemesEnabled then
      if TCustomStyleServices.Enabled then  DrawElement(Canvas.Handle,GetElementDetails(tebExplorerBarRoot), ClientRect)

      else

      ...

{code}

Now I get the message.. "[dcc32 Error] myprocs.pas(123😞 E2233 Property 'Enabled' inaccessible here"

Clearly I have done something untoward.  How should I correct this please?

 

Regards & TIA,

Ian

Share this post


Link to post

I am pretty sure that your code is inside a class derived from TCustomStyleServices (unless you are using with). As ThemesEnabled is a member of TCustomStyleServices so is Enabled. Simply change that ThemesEnabled to Enabled and you should be fine.

  • Like 1

Share this post


Link to post

Hi Uwe,

100% on the money.  

They were inside a 'With StyleServices do..'

All good now Tks.

Regards,

Ian

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×