FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Multiple icons/buttons in a cell
Posts: 1396
Joined: Mon May 14, 2007 09:49 AM

Re: Multiple icons/buttons in a cell

Posted: Fri May 01, 2026 04:35 PM

Thanks, I'll try.

Posts: 9028
Joined: Thu Oct 06, 2005 08:17 PM

Re: Multiple icons/buttons in a cell

Posted: Fri May 01, 2026 04:40 PM

This is the RC file:

MIO_PNG RCDATA "S_1.png"
Posts: 8559
Joined: Tue Dec 20, 2005 07:36 PM

Re: Multiple icons/buttons in a cell

Posted: Fri May 01, 2026 06:52 PM

Natter, see if this helps: Look at NATERPNG.RC, include the .PNG files you want to use, and convert them to .RES FILES. Incorporate the .RES FILES into your project and call them wherever you need them. See the attached demo. If you have any questions, ask.

Natter, mira si esto te sirve: consulta NATERPNG.RC, incluye los archivos .PNG que quieras usar y conviértelos a formato .RES. Incorpora los archivos .RES a tu proyecto y úsalos donde los necesites. Consulta la demostración adjunta. Si tienes alguna duda, pregunta.

Tests with FWH26.03, xHARBOUR, and BCC77 worked perfectly.

Las pruebas realizadas con FWH26.03, xHARBOUR y BCC77 funcionaron a la perfección

Download complete,

https://mega.nz/file/tMkGGAYD#HAfXMxHyneoWTG7MLaA-kNw25CPfTFHOoNlmcwD_1E0

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1396
Joined: Mon May 14, 2007 09:49 AM

Re: Multiple icons/buttons in a cell

Posted: Thu May 14, 2026 07:36 AM

There are 3 icons (48x48) in the xBrowse cell. Is it possible to change the cursor type when hovering over any of these icons?

https://cloud.mail.ru/public/8JMM/W3jwcMRkJ

Posts: 8559
Joined: Tue Dec 20, 2005 07:36 PM

Re: Multiple icons/buttons in a cell

Posted: Thu May 14, 2026 05:55 PM
Natter wrote:

There are 3 icons (48x48) in the xBrowse cell. Is it possible to change the cursor type when hovering over any of these icons?

https://cloud.mail.ru/public/8JMM/W3jwcMRkJ

Something like that?

https://forums.fivetechsupport.com/viewtopic.php?p=282669&hilit=oCol%3AbMMoved#p282669

// Exemplo de código para xBrowse com ícones 48x48
oCol := oBrw:AddCol()
oCol:bStrData    := { || "" }
oCol:nDataStrAlign := AL_CENTER
oCol:AddBitmap( { "icon1.bmp", "icon2.bmp", "icon3.bmp" } ) // Carrega os 3 ícones
oCol:nWidth      := 150 // Espaço suficiente para 3 ícones 48x48 lado a lado

// Evento ao mover o mouse dentro da célula
oCol:bMMoved := { | nRow, nCol, nFlags | ;
    If( nCol > 10 .and. nCol < 50, ; // Ajuste as coordenadas X de cada ícone
        oBrw:oCursor := oCursorHand(), ; // Define a mãozinha
        oBrw:oCursor := nil ) ; // Volta ao cursor padrão
}
#include "FiveWin.ch"
#include "xbrowse.ch"

Function Main()
    local oWnd, oBrw, oCol
    local oHand, oArrow
    

DEFINE CURSOR oHand HAND
DEFINE CURSOR oArrow ARROW

// ... setup browse and data ...

oBrw:bMMoved := { |nRow, nCol, nKeyFlags| 
    CheckIconHover(oBrw, nRow, nCol, oHand, oArrow) 
}

// ... activate browse ...
return nil

Function CheckIconHover(oBrw, nRow, nCol, oHand, oArrow)
    local nCellRow, nCellCol
    local nIcon1X, nIcon2X, nIcon3X
    local nIconY := 10 // Example vertical position in cell
    

// Determine if we are on the specific column with icons
// Get mouse position relative to the CELL
// This requires calculating where the icons are drawn:
// ... (Icon location calculation logic) ...

// Example condition (if mouse is over icon 1, 2, or 3 area)
if IsMouseOverIcon(oBrw, nRow, nCol)
    oBrw:oCursor := oHand
else
    oBrw:oCursor := oArrow
endif
return nil

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1396
Joined: Mon May 14, 2007 09:49 AM

Re: Multiple icons/buttons in a cell

Posted: Thu May 14, 2026 06:24 PM

I got it, thanks!

Continue the discussion