Buttonbar disabled, if painting on BMP-background ?

Buttonbar disabled, if painting on BMP-background ?

Postby ukoenig » Tue Oct 28, 2008 11:36 am

Hello,

I noticed :

If using a full-screen BMP as background ( resized to screen-resolution )
and painting a Buttonbar on top,
the Buttonbar is disabled, because of the BMP behind.

Image

before :

Code: Select all  Expand view

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( MAKEBAR1( oWnd ) ) ;
ON PAINT SHOW_PIC0( oWnd )

// ----------------------------------------------

FUNCTION MAKEBAR1( oWnd )
LOCAL oBar1, oBtn1, oBtn2

DEFINE BUTTONBAR oBar1 OF oWnd SIZE 80, 67 2007 RIGHT

DEFINE BUTTON oBtn1 OF oBar1 ACTION ( Tools1(oWnd) ) ;
RESOURCE "gear" PROMPT "Windows"  TOOLTIP "Windows and Dialog"

DEFINE BUTTON oBtn2 OF oBar1 ACTION ( Tools2(oWnd) ) ;
RESOURCE "gear" PROMPT "xBrowse"  TOOLTIP "xBrowse"

RETURN( NIL )

// ------ Full screen Background ( with Buttonbar on Top ) ------------

FUNCTION  SHOW_PIC0( oWnd )
LOCAL oImage1
LOCAL aRect := GETCLIENTRECT( oWnd:hWnd )

@ 0, 0 IMAGE oImage1 SIZE aRect[4], aRect[3] OF oWnd  ADJUST
oImage1:LoadBmp( "BRAINSTORM.BMP" )

RETURN( NIL )



If I reduce the BMP-width it works.
I had to change the line :

Code: Select all  Expand view

@ 0, 0 IMAGE oImage1 SIZE aRect[4] -80, aRect[3] OF oWnd  ADJUST



BMP-width = aRect[4]-80 ( - Buttonbar-width )

Why the Buttonbar is disabled on TOP of the Background-BMP
using the full screen-size ?

Regards
Uwe :lol:
Last edited by ukoenig on Tue Oct 28, 2008 12:16 pm, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Tue Oct 28, 2008 11:56 am

Uwe,

In our system, we using into "on resize" method.

Code: Select all  Expand view
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( MAKEBAR1( oWnd ) ) ;
ON RESIZE SHOW_PIC0( oWnd )

// ----------------------------------------------

FUNCTION MAKEBAR1( oWnd )
LOCAL oBar1, oBtn1, oBtn2

DEFINE BUTTONBAR oBar1 OF oWnd SIZE 80, 67 2007 RIGHT

DEFINE BUTTON oBtn1 OF oBar1 ACTION ( Tools1(oWnd) ) ;
RESOURCE "gear" PROMPT "Windows"  TOOLTIP "Windows and Dialog"

DEFINE BUTTON oBtn2 OF oBar1 ACTION ( Tools2(oWnd) ) ;
RESOURCE "gear" PROMPT "xBrowse"  TOOLTIP "xBrowse"

RETURN( NIL )

// ------ Full screen Background ( with Buttonbar on Top ) ------------

FUNCTION  SHOW_PIC0( oWnd )
LOCAL oImage1
LOCAL aRect := GETCLIENTRECT( oWnd:hWnd )

@ 0, 0 IMAGE oImage1 SIZE aRect[4], aRect[3] OF oWnd  ADJUST
oImage1:LoadBmp( "BRAINSTORM.BMP" )

RETURN( NIL )
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Buttonbar

Postby ukoenig » Tue Oct 28, 2008 12:14 pm

Hello JC,

I changed : ON PAINT in RESIZE
The same : the Buttonbar is disabled.

If i reduce the Background-BMP-width ( - Buttonbar-width ) it is OK.

I want the Background adjusted to the screen resolution.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Tue Oct 28, 2008 12:26 pm

Uwe,

This my source code into ON RESIZE method:
Code: Select all  Expand view
oBitmap := TBitmap():new( 0, 0, oWnd:getCliRect():nRight, oWnd:getCliRect():nBottom,,, .T., oWnd )

WITH OBJECT aSIS_DadosSistema["objeto_background"]

         :lStretch := .T.
         :setBMP( "RES_IMAGEM_NAME" )
         :center()
         :refresh( .T. )

END
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests