Page 1 of 1

Xbrowse button size

Posted: Tue Nov 12, 2019 12:30 pm
by Silvio.Falconi
Image

I use FW_BmpPlus(), FW_BmpMinus()

Can we correct this problem ?

the size of plus button see to smaller than minus button

I tried with other file (png)
Image

As you can see the border ( on yellow) is too big of plus button

thanks

Re: Xbrowse button size

Posted: Thu Nov 14, 2019 8:28 am
by nageswaragunupudi
Can you try making this change in XBrowse.prg?

Please locate the method
METHOD PaintCellBtn( hDC, oRect, aColors ) CLASS TXBrwColumn

The method looks like this:

Code: Select all

METHOD PaintCellBtn( hDC, oRect, aColors ) CLASS TXBrwColumn

   local oBtn, oBrush

   if !::lBtnTransparent
      WndBoxRaised(hDC, oRect:nTop - 1, oRect:nLeft - 1,;
                        oRect:nBottom, oRect:nRight + 1 ) // ButtonGet
   endif

   if ::nEditType == EDIT_LISTBOX .or. ::nEditType == EDIT_GET_LISTBOX
      ::oBtnElip:Hide()
      oBtn     := ::oBtnList
   else
      ::oBtnList:Hide()
      oBtn     := ::oBtnElip
   endif
   oBtn:Move( oRect:nTop, oRect:nLeft, oRect:nWidth, oRect:nHeight, .f.) // ButtonGet
   oBtn:Show()

   oBtn:GetDC()
   if .not. ::lBtnTransparent
      oRect:nRight   += 1
      FillRect( hDC, oRect:aRect, oBtn:oBrush:hBrush )
   else
      FillRectEx( hDC, oRect:aRect, aColors[ 2 ] )
   endif
   oBtn:lTransparent := ::lBtnTransparent
   if ! Empty( oBtn:hBitmap1 )
      oBtn:PaintBitmap()
   elseif ! Empty( oBtn:cCaption )
      oBtn:PaintCaption()
   endif
   oBtn:ReleaseDC()


/*
   if ::lBtnTransparent
      oBtn:lTransparent := .f.
      oBtn:bClrGrad     := { || { { 1, aColors[ 2 ], aColors[ 2 ] } } }
   endif
   oBtn:Refresh()
*/

return nil
 
Please change it like this:

Code: Select all

METHOD PaintCellBtn( hDC, oRect, aColors ) CLASS TXBrwColumn

   local oBtn, oBrush

   if !::lBtnTransparent
      WndBoxRaised(hDC, oRect:nTop - 1, oRect:nLeft - 1,;
                        oRect:nBottom, oRect:nRight + 1 ) // ButtonGet
   endif

   if ::nEditType == EDIT_LISTBOX .or. ::nEditType == EDIT_GET_LISTBOX
      ::oBtnElip:Hide()
      oBtn     := ::oBtnList
   else
      ::oBtnList:Hide()
      oBtn     := ::oBtnElip
   endif
   oBtn:Move( oRect:nTop, oRect:nLeft, oRect:nWidth, oRect:nHeight, .f.) // ButtonGet
   oBtn:Show()
/*
   oBtn:GetDC()
   if .not. ::lBtnTransparent
      oRect:nRight   += 1
      FillRect( hDC, oRect:aRect, oBtn:oBrush:hBrush )
   else
      FillRectEx( hDC, oRect:aRect, aColors[ 2 ] )
   endif
   oBtn:lTransparent := ::lBtnTransparent
   if ! Empty( oBtn:hBitmap1 )
      oBtn:PaintBitmap()
   elseif ! Empty( oBtn:cCaption )
      oBtn:PaintCaption()
   endif
   oBtn:ReleaseDC()
*/

   if ::lBtnTransparent
      oBtn:lTransparent := .f.
      oBtn:bClrGrad     := { || { { 1, aColors[ 2 ], aColors[ 2 ] } } }
   endif
   oBtn:Refresh()

return nil
 

Re: Xbrowse button size

Posted: Thu Nov 14, 2019 9:28 am
by Silvio.Falconi
Now Seem ok thanks

the green button not is the same of red because the border is different, on red button not have that box, I see the box when I put the mouse over

Re: Xbrowse button size

Posted: Thu Nov 28, 2019 10:20 am
by Silvio.Falconi
Nages,
can we insert oCursor Hand when the user press these buttons?