PaintBorder of Btnbmp ( fwteam)

PaintBorder of Btnbmp ( fwteam)

Postby Silvio.Falconi » Sat Jun 10, 2023 4:17 pm

Perhaps I found a solution for the border

I would like to propose these changes to the fwteam

#define WHITE_PEN 6 // add this on top

METHOD PaintBorder() CLASS TBtnBmp

local nAdjustBorder := 0
local nWidth, nAdj, oCli
local nRound := If( ::lRound, ::nRound, 0 )

local hWhitePen, hGrayPen, hOldPen add these

line 1752

Code: Select all  Expand view

//if ! ::lPressed
if !   ::lMOver
         hGrayPen  := CreatePen (PS_SOLID,1,::nClrBorder)
         hWhitePen := GetStockObject (WHITE_PEN)
         hOldPen   := SelectObject(::hDC,hWhitePen)
         Moveto (::hDC, 0, ::nHeight - nAdjustBorder - 1)
         Lineto (::hDC, 0, 0)
         Lineto (::hDC, ::nWidth - nAdjustBorder - 1, 0)
         SelectObject (::hDC, hOldPen)
         hOldPen := SelectObject(::hDC, hGrayPen)
         Moveto (::hDC, 1         , ::nHeight - nAdjustBorder - 3)
         Lineto (::hDC, ::nWidth - nAdjustBorder -3, ::nHeight - nAdjustBorder - 3)
         Lineto (::hDC, ::nWidth - nAdjustBorder -3,           1)
         SelectObject(::hDC, hOldPen)
         DeleteObject (hGrayPen)
                 // WndRaised( ::hWnd, ::hDC )
       else
         hGrayPen  := CreatePen (PS_SOLID,1,::nClrBorder)
         hOldPen   := SelectObject(::hDC,hGrayPen)
         Moveto (::hDC, 0, ::nHeight - nAdjustBorder - 1)
         Lineto (::hDC, 0, 0)
         Lineto (::hDC, ::nWidth - nAdjustBorder - 1, 0)
         SelectObject(::hDC, hOldPen)
         DeleteObject (hGrayPen)
                //  WndInset( ::hWnd, ::hDC )
               endif



instead of

Code: Select all  Expand view

 if ! ::lPressed
                  WndRaised( ::hWnd, ::hDC )
               else
                  WndInset( ::hWnd, ::hDC )
               endif
 


now seem run ok the border color

Image


I set the btnbmps into the scrollpanel with

:nClrBorder := { || (IIF(ocontrol:lMOver,CLR_BLUE,CLR_HGRAY)) }
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: PaintBorder of Btnbmp ( fwteam)

Postby nageswaragunupudi » Sat Jun 10, 2023 5:09 pm

We will look into this.
Thanks
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: SantaCroya and 46 guests