Possible, to show a buttonbar on fixed screen-position ?

Possible, to show a buttonbar on fixed screen-position ?

Postby ukoenig » Thu Oct 23, 2008 9:33 pm

Hello,

A customer of mine wants something special.

Image

Is it possible, to show a buttonbar on defined-places on screen ?
I don't want, that the bar can be moved.
If it is not possible, i have to use single bitmaps.

For the Folder BMP's i used :

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( MAKEBAR1( oWnd ) ) ;
ON PAINT ( gradpaint1( hDC, oWnd ), ;
ABPaint( hDC, 50, 10, oBmp1:hBitmap, 220 ), ;
ABPaint( hDC, 380, 10, oBmp2:hBitmap, 220 ), ;
ABPaint( hDC, 50, 220, oBmp3:hBitmap, 220 ), ;
ABPaint( hDC, 380, 220, oBmp4:hBitmap, 220 ), ;
ABPaint( hDC, 50, 430, oBmp5:hBitmap, 220 ), ;
ABPaint( hDC, 380, 430, oBmp6:hBitmap, 220 ) ) // 0-255 transparency level

For the moment, i paint single bitmaps on top of the folder-bmp's.

Regards
Uwe :lol:
Last edited by ukoenig on Fri Oct 24, 2008 8:41 am, edited 1 time 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 » Fri Oct 24, 2008 12:18 am

Uwe,

I don't know if this is what you want but... take a look!

Disable the movable property of a buttonbar:
Code: Select all  Expand view
DEFINE BUTTONBAR oToolBar OF oWnd _3D SIZE 40, 40
oToolBar:brClicked := {|| 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

Buttons on Alpha-BMP's

Postby ukoenig » Fri Oct 24, 2008 9:39 am

Hello JC,

I have done some tests, to arrange buttons
on Alpha-channel BMP's.
It doesn't look very nice ( transparent problem).
I can paint another Alpha-Bmp as Button
on a Alpha-Bmp-basic picture.
I don't know, if it is possible to define any actions to the 2. BMP

I tested BTNBMP, but there is no support for Alpha-channel.

The Basic-BMP
------------------
DEFINE BITMAP oBmp1 FILENAME "f_custom.bmp"
ABPaint( hDC, 50, 10, oBmp1:hBitmap, 220 )

A Alpha-channel-Bmp on Top of oBmp1
---------------------------------------------
DEFINE BITMAP oBmp7 FILENAME "show.bmp"
ABPaint( hDC, 75, 130, oBmp7:hBitmap, 220 )

Antonio will support Alpha-channel for ButtonBMP ?
That would solve the problem.

Maybe there is another good looking solution for it ?

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

Buttons on BMP with Alpha-channel

Postby ukoenig » Fri Oct 24, 2008 12:38 pm

Hello,

The best looking solution, i found in the moment
for painting a button on Alpha-channel-BMP's is using :

@ 7.7, 13 BUTTONBMP oBtn1 PROMPT "" SIZE 38, 40 BITMAP "gear.bmp" of oWnd
oBtn1:cToolTip = "The tooltip text"

Image

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 Antonio Linares » Fri Oct 24, 2008 6:10 pm

Uwe,

> Antonio will support Alpha-channel for ButtonBMP ?

In METHOD Paint() CLASS TButtonBmp change:
Code: Select all  Expand view
         DrawMasked( ::hDC, ::hBitmap, nTop + If( lPressed, 1, 0 ),;
                     nLeft + If( lPressed, 1, 0 ) )

with:
Code: Select all  Expand view
         ABPaint( ::hDC, ::hBitmap, nTop + If( lPressed, 1, 0 ),;
                     nLeft + If( lPressed, 1, 0 ), 220 )  )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Alpha-BMP-Button

Postby ukoenig » Sat Oct 25, 2008 12:36 pm

Antonio,

I changed the source in BUTTONB ( paint )
and added a Alert as test. The Alert is shown at start for each Button.

Code: Select all  Expand view

if ::lActive

msgalert( "Aktiv" )

   ABPaint( ::hDC, ::hBitmap, nTop + If( lPressed, 1, 0 ),;
      nLeft + If( lPressed, 1, 0 ), 220 )   //  )  changed, because of error
else
   DrawGray( ::hDC, ::hBitmap, nTop + If( lPressed, 1, 0 ),;
      nLeft + If( lPressed, 1, 0 ) )
      endif                     
endif   



The Button shows no Alpha-Bmp's, only a empty button-frame.

Code: Select all  Expand view

DEFINE BITMAP oBmp1 FILENAME "f_custom.bmp"

// Test Alpachannel-button
DEFINE BITMAP oBmp7 FILENAME "show.bmp"

// Alpha-Channel BMP
@ 7.7, 11 BUTTONBMP oBtn1 PROMPT "" SIZE 50, 45 BITMAP "show.bmp" of oWnd
oBtn1:cToolTip = "The 1. Button"

// Normal BMP => that works !!!
*@ 7.7, 11 BUTTONBMP oBtn1 PROMPT "" SIZE 50, 45 BITMAP "preview.bmp" of oWnd
*oBtn1:cToolTip = "The 1. Button"

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( MAKEBAR1( oWnd ) ) ;
ON PAINT ( gradpaint1( hDC, oWnd ), ;
     ABPaint( hDC, 50, 10, oBmp1:hBitmap, 220 ), ;
     ABPaint( hDC, 100, 50, oBmp7:hBitmap, 220 ) ) // 0-255 transparency level



The test-alpha-bmp is defined as button as well :
Image

A normal BMP works
Image

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests