Problems with owndraw buttons and background

Just starting out? Need help? Post your questions and find answers here.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Problems with owndraw buttons and background

Post by GPI »

http://caosandkin.bei.t-online.de/pureb ... utton2.zip

I overworked my CostumButtons, but i get a problem. I found a method, how to draw transparent image without using startdrawing(), but i have a little problem:

Image

As you see, the background of the around the buttons is gray and not the same like the background of the mainwindow. (and yes, the buttons are draw real transparent, because outside the round button is the color black!)
It seems, that the redraw of the background in the button is stopped for the mainwindow. How can i change this?

GPI
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

Try and create a button the API way (CreateWindow_) and see if that works ok. If that works you could make a qualified guess that it's PB that do something to make things difficult for you ;)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Found a better methode:

Code: Select all

point.POINT\x=0:point\y=0
MapWindowPoints_(GetParent_(CButton_()\hwnd),CButton_()\hwnd,point,1)
            
BackBrush=GetClassLong_(WindowID(), #GCL_HBRBACKGROUND)
SetBrushOrgEx_(*dis\hDC,point\x,point\y,oldpoint.POINT)
FillRect_(*dis\hDC,*dis\rcItem,BackBrush)
SetBrushOrgEx_(*dis\hDC,oldpoint\x,oldpoint\y,0)
GPI
Post Reply