Alaska Software Inc. - Re: Alaska 2.0 transparency
Username: Password:
AuthorTopic: Re: Alaska 2.0 transparency
Andreas Gehrs-Pahl

View the complete thread for this message in:

Re: Alaska 2.0 transparency
on Sun, 18 Oct 2015 20:59:57 -0400
Peter,

>My problem is: Same code it works differently with xBase++ version 1.9 than 
>with version 2.0

To be precise, this behavior was actually changed between builds 1.90.346 
and 1.90.347, during the SL1 beta (in October 2008). All versions after 
build 346, including 1.90.355 (SL1), show the same (new) behavior.

>The Static with setColorBG( XBPSYSCLR_TRANSPARENT)  displayed Transparent 
>with version 1.9, but with 2.0 not.

The problem occurs in :InvalidateRect() of the XbStatic text, which is a 
child of the Bitmap XbStatic. The simplest solution to the issue is to use 
Owner-Draw Mode. Add the following lines of code before "oStat:Create()":

   oStat:DrawMode := XBP_DRAW_OWNER
   oStat:Draw     := {|oPS, aInfo, oSelf| Draw_Static(oPS, aInfo, oSelf)}

And then add the following function somewhere to your code:

Function Draw_Static(oPS, aInfo, oStatic)
   GraStringAt(oPS, {0, 0}, oStatic:Caption)
return (.f.)

Alternatively, you could put the entire owner draw function code directly 
into the code block, as long as you return FALSE at the end:

oStat:Draw := {|oPS, aI, oSelf| GraStringAt(oPS, {0,0}, oSelf:Caption), .f.}

A function is more flexible, though, and you could change some of the Gra* 
attributes if you like, such as selecting a different font, alignment, etc. 
for the GraStringAt() function, before drawing it.

The above code will work in all version, from 1.90.339 up to 2.00.644!

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
web:   http://www.Aerospace-History.net