FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PaintBorder of Btnbmp ( fwteam)
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
PaintBorder of Btnbmp ( fwteam)
Posted: Sat Jun 10, 2023 04: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 (fw): Select all Collapse
 
//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 (fw): Select all Collapse
 if ! ::lPressed
                  WndRaised( ::hWnd, ::hDC )
               else
                  WndInset( ::hWnd, ::hDC )
               endif
now seem run ok the border color




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 March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: PaintBorder of Btnbmp ( fwteam)
Posted: Sat Jun 10, 2023 05:09 PM

We will look into this.

Thanks

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion