Delphi 2007 to Delphi XE2 paint order change

Hello all,

I have a program here that does some very specific work in the paint 
handlers and requires that the controls are painted from bottom to top.
This worked just fine under Delphi 2007 but now that we have migrated to 
Delphi XE2, it no longer works.
Tracing the paint order, we discovered that there are cases when the 
bottom most component (the form for instance) is drawn last instead of 
first, which means that the painting code we do in the program gets a 
black area for the bottom most control instead of its background.
This was observed with D2007 and DXE2 on the same computers.

For instance, here the order we get in D2007:

LoginForm
LoginForm.cbAccessType
LoginForm
LoginForm.cbxEnv
LoginForm
LoginForm
LoginForm


And here is the one we get in DXE2:

LoginForm.cbAccessType
LoginForm
LoginForm
LoginForm.cbxEnv
LoginForm
LoginForm
LoginForm

As you can see, the first paint code to be called is the one inside the 
combobox where we expected it to be the login form as in under D2007.

Do any of you remember seeing a change in the VCL that could explain 
such a change in behavior?

Do you have any suggestion as to what I could try to get back to the 
previous order of things?

Regards
Olivier
0
Olivier
9/3/2012 3:40:27 PM
embarcadero.delphi.vcl.using 2297 articles. 2 followers. Follow

2 Replies
1261 Views

Similar Articles

[PageSpeed] 46

Olivier Sannier wrote:

> Hello all,
> 
> I have a program here that does some very specific work in the paint 
> handlers and requires that the controls are painted from bottom to
> top.  This worked just fine under Delphi 2007 but now that we have
> migrated to Delphi XE2, it no longer works.
> Tracing the paint order, we discovered that there are cases when the 
> bottom most component (the form for instance) is drawn last instead
> of first, which means that the painting code we do in the program
> gets a black area for the bottom most control instead of its
> background.  This was observed with D2007 and DXE2 on the same
> computers.
> 
> For instance, here the order we get in D2007:
> 
> LoginForm
> LoginForm.cbAccessType
> LoginForm
> LoginForm.cbxEnv
> LoginForm
> LoginForm
> LoginForm
> 
> 
> And here is the one we get in DXE2:
> 
> LoginForm.cbAccessType
> LoginForm
> LoginForm
> LoginForm.cbxEnv
> LoginForm
> LoginForm
> LoginForm
> 
> As you can see, the first paint code to be called is the one inside
> the combobox where we expected it to be the login form as in under
> D2007.
> 
> Do any of you remember seeing a change in the VCL that could explain 
> such a change in behavior?
> 
> Do you have any suggestion as to what I could try to get back to the 
> previous order of things?

Perhaps it is due to the ParentBackground property. I don't remember
whether D2007 already had it, but it was introduced to allow controls
(like panels) to effectively become transparent. This is only active if
theme support is enabled, if memory serves.

-- 
Peter Below (TeamB)
0
Peter
9/3/2012 4:57:19 PM
Peter Below wrote:

>> Do you have any suggestion as to what I could try to get back to the
>> previous order of things?
>
> Perhaps it is due to the ParentBackground property. I don't remember
> whether D2007 already had it, but it was introduced to allow controls
> (like panels) to effectively become transparent. This is only active if
> theme support is enabled, if memory serves.

Thanks for the pointers, but alas, it does not help.
But we managed to find the place where it was not painting properly and 
we changed it a bit so that now it copes with it.
Basically, this came from the fact that there are less messages sent 
under DXE2 and so one paint order was never done for our background.

Thanks for your help
0
Olivier
9/5/2012 2:11:37 PM
Reply:

Similar Artilces:

How to use a delphi XE3 obj file in delphi 2007?
Hi, I'm migrating an application from delphi 2007 to delphi XE3 and I would like to do it in several steps. To do this I need to use a part of my new code (XE3) in the current delphi 2007 application. So I want to use the .obj file from my XE3 file. I know I have to use the {$L 'Filename'} and I know that I have to declare the functions that I want to use in external in my D2007 project. I wanted to make an easy and simple example to see how it works with only 1 function 'hello world' compiled in obj with XE3 but I can't find the way to use it in D2007. In D200...

can i use delphi 2007 bpls in delphi 2009
can i use delphi 2007 bpls in delphi 2009 ? "Gaetan SIRY" skrev i meddelelsen news:8703@forums.codegear.com... > can i use delphi 2007 bpls in delphi 2009 ? No. -- Finn Tolderlund The compatiblity between D2006 and D2007 was unique. Normaly they can't be compatible because new version enhance/change the API. And D2009 defines String = Unicode where older version has String = Ansistring so D200x/Dx-BPL are 200% incompatible with D2009. ...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but...

Delphi 4 to Delphi 2007
Hello, I will have to port a D4 application (with source) to D2007. what kind of problem could I face ? I will have to go to customer site tommorow to analyse its source code to quote the work, what should I care of to hestimate the porting time ? Thanks John Terry wrote: > Hello, > I will have to port a D4 application (with source) to D2007. > what kind of problem could I face ? > I will have to go to customer site tommorow to analyse its source code > to quote the work, what should I care of to hestimate the porting time ? You can probably do it by just changi...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

MOVED: Use Delphi XE TLB importer in Delphi 2007?
....to the ActiveX group: https://forums.embarcadero.com/thread.jspa?threadID=47170 -- Craig Stuntz · Vertex Systems Corp. · Columbus, OH Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/ ...

converting delphi 2007 code to delphi XE2 -- emptyparam problem
Hi, I am trying to convert my applicantion code from delphi 2007 to delphi XE2 and i got stuck in this error "[DCC Error] ADODB_TLB.pas(4888): E2033 Types of actual and formal var parameters must be identical". This happens when we use emptyparam as an argument in a function that wants an olevariant. Example: function TAcadDatabase.CopyObjects(Objects: OleVariant): OleVariant; begin Result := DefaultInterface.CopyObjects(Objects, EmptyParam, EmptyParam); //this is where we get the ERROR end; The coyobjects function as this signature: " function CopyObjects(Object...

Debugging in Delphi XE2 using another Delphi BDS process as host
Hi I've been using delphi a long time And I always had the possibility of debbuging Packages using another Delphi process as host. This is very useful to test the design-time side of packages. Now with XE 2 I can whether running with options - Debugger - Host Application or Attach to process Any ideas? Thanks Plp Pedro wrote: > Now with XE 2 I can whether running with options - Debugger - Host > Application or Attach to process What exactly are you having trouble with? Error messages, unexpected behavior, etc. -- Remy Lebeau (TeamB) Hi Remy ...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Delphi 2007 RTL in Delphi 7
I read somewhere that it is possible to use Delphi 2007's (or for that matter Delphi 2006's) RTL in Delphi 7 by just recompiling the source of RTL. Is this really possible? What are the benefits that we can derive using a higher version's RTL? TIA Yogi Yang Yogi Yang wrote: > I read somewhere that it is possible to use Delphi 2007's (or for > that matter Delphi 2006's) RTL in Delphi 7 by just recompiling the > source of RTL. If it actually compiles in Delphi 7, I guess it would be possible. OTOH, if one has Delphi 2007 already, I don't s...

Migrate from Delphi 2007 to Delphi 2010
Hi All, Thanks in advance for your help. Below is my query, Currently I am using Delphi 2007 and i want to migrate to Delphi 2010. 1. What all things i need to take care while doing this? 2. What all third party components will get impacted? 3. Any known issues in Delphi 2010 which might impact the cause? 4. Any changes in database operation required as i am using Oracle? Hope I have post this query under correct category. If not sorry for the trouble and could you please suggest me the correct category for this? Looking forward for your response. Have a great day. Th...

Delphi 2007 to Delphi 2009 Conversion
CharArrayPtr = ^CharArray; CharArray = array[0..MaxInt-1] of Char; How to convert to Delphi 2009? Bill Bill Miller wrote: > CharArrayPtr = ^CharArray; > CharArray = array[0..MaxInt-1] of Char; > > How to convert to Delphi 2009? > > Bill it depends heavelly on how it is used fearther down in your project and what you want to convert it to. I you want to simple convert the declarations ignoring UNicode altogether then the only think you have to change is the CharArray declaratin from a Char to an AnsiChar eg CharArrayPtr = ^CharArray; CharArray =...

Delphi 2010 w Delphi 2007
I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). Can I install D2010 on this machine without it affecting D2007? Will D2010 affect D2007 in any way? Thanks, Randall Carpenter > {quote:title=Randall Carpenter wrote:}{quote} > I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). > Can I install D2010 on this machine without it affecting D2007? Will D2010 > affect D2007 in any way? Won't hurt a thing. I have D7, RAD Studio 2007, RAD Studio 2009, and RAD Studio 2010 all on my desktop system and they coexist fine. Jus...

is there a Delphi 2007
Would be nice to have a bundle of the latest Delphi packages. Gilbert Padilla wrote: > Would be nice to have a bundle of the latest Delphi packages. > I expect Delphi 2007 will only be on sale until the full RAD Studio 2009 edition is published, including Delphi 2009.net. W ...