FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TBtnBmp problem
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TBtnBmp problem
Posted: Tue Jun 26, 2007 09:36 AM
Dear friends,

there is a little problem using tbtnbmp with a brush. If i set ::ltransparent = .t., the focus-rect is not shown moving the mouse over the button. If ::lTransparent is .f., it´s working fine.

The following sample shows this issue.

#Include "FiveWin.ch"

//----------------------------------------------------------------------------//
static oWnd, oBar,oB1, oBrush, oB2

Func Main()

   Define Window oWnd From 0, 0 To 15, 65 ;
       Title "Bar-Test " 

   define BRUSH oBrush FILE "Xp.bmp"

   define BUTTONBAR oBar OF oWnd 3DLOOK SIZE 26,26
   oBar:oBrush:= oBrush

   define BUTTON oB1 OF oBar FILE "Calc.bmp" ACTION MsgInfo ("B1") NOBORDER
   define BUTTON oB2 OF oBar FILE "Calendar.bmp" ACTION MsgInfo ("B2") NOBORDER
   oB1:lTransparent := .t.
   oB1:oBrush := oBrush
   //oB2:lTransparent := .t.
   oB2:oBrush := oBrush
   oB1:Refresh()

   Activate Window oWnd

Retu nil


Can anyone confirm this behavior ?

Is there a solution for this ?


kind regards
Stefan
kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
TBtnBmp problem
Posted: Tue Jun 26, 2007 09:57 AM

Stefan,

If transparent is used, then thats the expected behavior, just to see the image and be able to push it

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TBtnBmp problem
Posted: Tue Jun 26, 2007 11:07 AM

Antonio,

ok, thanks for the info.

Is there a way, to change this behavior ?

kind regards
Stefan

kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
TBtnBmp problem
Posted: Tue Jun 26, 2007 01:25 PM

Stefan,

Yes, you can easily modify the Class source code

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TBtnBmp problem
Posted: Wed Jun 27, 2007 07:36 AM

Antonio,

in the class btnbmp are many occurences of DrawFocusRect(), but no call depends on ::ltransparent.

In my opinion the method MouseMove is responsible for showing the focus-rect.

I don´t understand what i have to change. Could you please help me ?

Many thanks

kind regards
Stefan

kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
TBtnBmp problem
Posted: Wed Jun 27, 2007 12:06 PM
Stefan,

Do you mean this border around the button ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TBtnBmp problem
Posted: Wed Jun 27, 2007 03:25 PM

Antonio,

yes, i mean the border that comes up if i move the mouse over the button. It does not appear, if ltransparent is true.

kind regards
Stefan

kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
TBtnBmp problem
Posted: Wed Jun 27, 2007 04:06 PM

In my screenshot lTransparent is used.

Don't use a bitmap whose image is too close to the left edge

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TBtnBmp problem
Posted: Wed Jun 27, 2007 08:38 PM
Antonio Linares wrote:In my screenshot lTransparent is used.

Don't use a bitmap whose image is too close to the left edge


What do you mean ? I use the standard bitmaps 16x16.

I made 2 screenshots, to show what happens.

Button2 is not transparent, the rect is shown, Button 3 is transparent, the rect is not shown moving the mouse over the buttons.





It seems the rect is painted transparent.
kind regards

Stefan
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
TBtnBmp problem
Posted: Wed Jun 27, 2007 09:50 PM
Antonio,

i made some tests and i found that the transparent bitmap (the right one) is nearer to the left edge, it´s not centered as the left bitmap (not transparent). These buttons are painted with a border to show the difference.



TransBmp() seems to move the bitmap to the left.
kind regards

Stefan

Continue the discussion