Multiple icons/buttons in a cell

Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: Multiple icons/buttons in a cell

Post by Natter »

Thanks, I'll try.

User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Multiple icons/buttons in a cell

Post by karinha »

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#HAfXMxHyn ... NlmcwD_1E0

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: Multiple icons/buttons in a cell

Post by Natter »

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

User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Multiple icons/buttons in a cell

Post by karinha »

Natter wrote: Thu May 14, 2026 7: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

Something like that?

viewtopic.php?p=282669&hilit=oCol%3AbMMoved#p282669

Code: Select all | Expand

// 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
}

Code: Select all | Expand

#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
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: Multiple icons/buttons in a cell

Post by Natter »

I got it, thanks!

Post Reply