Browse with transparent background

This forum is for eXpress++ general support.
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Browse with transparent background

#1 Post by c-tec »

Hello,
is it possible to make a transparent browser over a background image ? I want only to display the content of the browse cells. Have tried it with presentation parameters:
{ XBP_PP_COL_DA_BGCLR, XBPSYSCLR_TRANSPARENT}, /* Row BG Color */ ;
but without success
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Browse with transparent background

#2 Post by Tom »

Hi, Rudolf.

This should work, but you also need to set the transparent color for the statics containing the browse. Take a look at the object using "DC_InspectObject(oBrowse)". If you look/click at the "ChildList" method, you will see a list of objects representing the browse. Some of them (two or three normally) are statics. If you set the transparent background color for them, sooner or later, your background image should shine through the browse columns.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Browse with transparent background

#3 Post by c-tec »

Hello Tom
thank you, found the static objects. So I need a function to go through the childlist and set all static objects background color to transparent. Maybe someone can help with some code for this function.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Browse with transparent background

#4 Post by c-tec »

Hello,
this function works so far, but the background is still not transparent
regards
Rudolf

Code: Select all

function settransp(oBrowse,aGetlist)
******************************************************************
altd()
setbackgrd(oBrowse)
oBrowse:configure()
oBrowse:refreshall()
if !empty(aGetlist)
     dc_getrefresh(agetlist)
endif
return .t.

function setbackgrd(oObj)
******************************************************************
local x
for x := 1 to len(oObj:childlist())
     if valtype(oObj:childlist()[x]) = "A"
          setbackgrd(oObj:childlist()[x])
     else
          if oObj:childlist()[x]:isDerivedFrom( "XbpStatic" )
               oObj:childlist()[x]:setcolorbg(XBPSYSCLR_TRANSPARENT)
               dcqdebug oObj:childlist()[x]
          endif
     endif
next x
return .t.
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Browse with transparent background

#5 Post by Tom »

Hi, Rudolf.

You're right. I walked through all avaiable objects in the dialog/browse providing the methods "SetColorFG/SetColorBG" and turned them to XBPSYSCLR_TRANSPARENT, but cells remain gray (GRA_CLR_BACKGROUND). Even the scrollbars shine through, but it seems that transparent color is not supported by the "DrawCell" method of XbpBrowse. :(
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Browse with transparent background

#6 Post by c-tec »

Hello Tom
I tried it also with other colors, but does also not work. It seems that it has something todo with refreshing, reconfig or so.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Browse with transparent background

#7 Post by Auge_Ohr »

hi,
is it possible to make a transparent browser over a background image ?
did you meen this http://www.ulurudatabase.com/features02.htm?

using SL1 v1.9.355 you have to use oBrowse:useVisualStyle := .F.
else GraBackGround() will "overpaint" your Color (in "DrawCell").

"visual Style" does use XBPSYSCLR_* Color to "match" OS() Color
so oBrowse:dataArea is "grey" (W2K) or "white" with XP Manifest

as you have ask in Alaska Forum too i "think" you need a XbpColumn Class for "repaint" without "visual Style".
it does not help using SL1 "without visual Style" or NOT using a XP Manifest ... try 1.9.331 instead to "see" what i meen...
greetings by OHR
Jimmy

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Browse with transparent background

#8 Post by c-tec »

Hello Jimmy,
thank you, but I do not use SL1. Your are right, should be the same like in XOANON. I have it, but I would like tu use eXPress++ for this, because it has more features.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Browse with transparent background

#9 Post by c-tec »

Hello Jimmy,
a combination of eXPress++ and XOANON would be the perfect solution, but I know that it is not possible. This two tools togehter have all things I need for making my applications looking better. Another chance is CodeJock, but it is complexer to handle for me and the rusult it is not pure XBase.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Browse with transparent background

#10 Post by Auge_Ohr »

c-tec wrote:Your are right, should be the same like in XOANON. I have it, but I would like tu use eXPress++ for this, because it has more features.
i do not have XOANON ( Source ? ) so i do not know who he did it.
using XBPSYSCLR_TRANSPARENT "only" will not work, it will be "black" (sometimes "white")

J.A. Diego Kerejeta have point me the Way using :customDrawCell using Xbase++ SL1 v1.9.355
You need a Ownerdraw XbpColumne() Class to :draw underlay ::oDrawingArea:bitmap as Background into a "Cell"

while you have to "calculate" (there is no :measureItem) "Size" of a "Cell" and ::oBmp:draw(...)
just the "Part of Bitmap" that "match" underlay ::oDrawingArea:bitmap
BrowseTransparent.JPG
BrowseTransparent.JPG (54.67 KiB) Viewed 17376 times
next Problem ... if you :move or :resize oBrowse ...
greetings by OHR
Jimmy

Post Reply