Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Converting from D7 to DXE10.2.3, forms change color



Permlink Replies: 5 - Last Post: Apr 23, 2018 10:58 PM Last Post By: Peter Below Threads: [ Previous | Next ]
Dimitris Koutso...

Posts: 28
Registered: 12/10/06
Converting from D7 to DXE10.2.3, forms change color
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2018 12:58 PM
I’ve just transferred a big application (more than 500,000 code
lines)from Delphi 7 to Delphi X10.2.3 Tokyo and everything works fine.
I am really amazed with the easiness of the upgrade.

My only problem is that GroupBoxes inside forms get the color of parent
form. I check the form with Object Inspector and the color of GroupBox
is correct. If I change it to another color and set it again to the
original, it works. I can do this for all my forms (about 100), but I
wonder if there is an easier way around this problem.
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Converting from D7 to DXE10.2.3, forms change color
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2018 11:11 PM   in response to: Dimitris Koutso... in response to: Dimitris Koutso...
Dimitris Koutsourelis wrote:

I’ve just transferred a big application (more than 500,000 code
lines)from Delphi 7 to Delphi X10.2.3 Tokyo and everything works fine.
I am really amazed with the easiness of the upgrade.

That is a mighty big leap, 15 years or so of accumulated changes in the
run-time library and VCL.

My only problem is that GroupBoxes inside forms get the color of
parent form. I check the form with Object Inspector and the color of
GroupBox is correct.

Yes, but the control, like TPanel, has a ParentBackground property now
that is true by default. That is probably your problem. This property
was introduced to allow container controls to be transparent, e.g. if
there is a background image on the form.

If I change it to another color and set it again
to the original, it works. I can do this for all my forms (about
100), but I wonder if there is an easier way around this problem.

Not really. But with this many forms to modify it may pay to write a
small program that scans the DFM files for occurences of TGroupBox and
inserts a line
ParentBackground = False
with the proper indentation into it. Make backup copies of the files
first!

--
Peter Below
TeamB

Dimitris Koutso...

Posts: 28
Registered: 12/10/06
Re: Converting from D7 to DXE10.2.3, forms change color
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2018 1:01 AM   in response to: Peter Below in response to: Peter Below
Thx a lot for the reply. Good tip.
I had tried to upgrade with XE2 but there were a lot of problems
converting, and also I had messed up with third party libraries
(especially TurboPower).
It was a great advance that they adapted the most popular ones, it
helped me a lot.

Peter Below wrote:

Dimitris Koutsourelis wrote:

I’ve just transferred a big application (more than 500,000 code
lines)from Delphi 7 to Delphi X10.2.3 Tokyo and everything works
fine. I am really amazed with the easiness of the upgrade.

That is a mighty big leap, 15 years or so of accumulated changes in
the run-time library and VCL.

My only problem is that GroupBoxes inside forms get the color of
parent form. I check the form with Object Inspector and the color of
GroupBox is correct.

Yes, but the control, like TPanel, has a ParentBackground property
now that is true by default. That is probably your problem. This
property was introduced to allow container controls to be
transparent, e.g. if there is a background image on the form.

If I change it to another color and set it again
to the original, it works. I can do this for all my forms (about
100), but I wonder if there is an easier way around this problem.

Not really. But with this many forms to modify it may pay to write a
small program that scans the DFM files for occurences of TGroupBox and
inserts a line
ParentBackground = False
with the proper indentation into it. Make backup copies of the files
first!
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Converting from D7 to DXE10.2.3, forms change color
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2018 2:32 AM   in response to: Dimitris Koutso... in response to: Dimitris Koutso...
Another tip.. Before you search for a few hours..

If (font)colors of panels or other components are not visible in runtime then take
a look to the property StyleElements There you have seFont, seClient and seBorder
and they are all on True as default.
Dimitris Koutso...

Posts: 28
Registered: 12/10/06
Re: Converting from D7 to DXE10.2.3, forms change color
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2018 1:41 PM   in response to: Robert Triest in response to: Robert Triest
I checked a form copied to DXE10 from D7. ParentColor is false in all
GroupBoxes, and every GroupBox has its own color declared at color
property.
However, all GroupBoxes appear with the same color, the color of the
main form.

I have to change color to anything and then again to original in order
to get back my color. ParentColor property does not seem to work right,
at least for forms transfered from D7


Robert Triest wrote:

Another tip.. Before you search for a few hours..

If (font)colors of panels or other components are not visible in
runtime then take a look to the property StyleElements There you have
seFont, seClient and seBorder and they are all on True as default.
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Converting from D7 to DXE10.2.3, forms change color
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2018 10:58 PM   in response to: Dimitris Koutso... in response to: Dimitris Koutso...
Dimitris Koutsourelis wrote:

I checked a form copied to DXE10 from D7. ParentColor is false in all
GroupBoxes, and every GroupBox has its own color declared at color
property.
However, all GroupBoxes appear with the same color, the color of the
main form.

I have to change color to anything and then again to original in order
to get back my color. ParentColor property does not seem to work
right, at least for forms transfered from D7

ParentBackground is not the same as ParentColor, and it has higher
priority!


--
Peter Below
TeamB

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02