FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BTNBMP INFO questions
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
BTNBMP INFO questions
Posted: Mon Jun 02, 2025 08:40 PM

I have a small doubt.

with the resources in the btnbmp control we use for example

RESOURCE "IMAGE" , ", ", " in third place we put the image or the bitmap when the btnbmp control is disabled, does it also work with Filename ?

that is, for a procedure that I am creating I cannot have the images in resource but I have to use filename.

another thing what is the difference between setfile() and setImages() ?

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: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: BTNBMP INFO questions
Posted: Tue Jun 03, 2025 10:17 AM

tanto REDEFINE BTNBMP como @ ... BTNBMP permiten especificar imágenes a través de RESOURCE (con cResName1, cResName2, cResName3, cResName4) o a través de FILE (con cBmpFile1, cBmpFile2, cBmpFile3, cBmpFile4). Típicamente, se entiende que: * cResName1: Es la imagen normal (habilitada). * cResName2: Es la imagen cuando el botón está presionado (clicked). * cResName3: Es la imagen cuando el botón está deshabilitado (disabled). * cResName4: Es la imagen cuando el mouse está encima del botón (mouse over).

Entonces, respondiendo a tu primera pregunta: Sí, puedes usar un nombre de archivo (filename) para la imagen del estado "disabled" utilizando cBmpFile3.

En cuanto a la diferencia entre setFile() y setImages(): Basándome en la sintaxis que me has proporcionado y mi conocimiento general de FiveWin, es probable (aunque necesitaría confirmación viendo la implementación de la clase TBtnBmp) que: * setFile(): Este método probablemente establece la imagen principal del botón, es decir, la imagen que se muestra cuando el botón está en su estado normal (habilitado y no presionado). Podría corresponder a asignar el valor de cBmpFile1 programáticamente. * setImages(): Este método probablemente permite establecer múltiples imágenes para los diferentes estados del botón (normal, presionado, deshabilitado, mouse over) de una sola vez. Sería el equivalente a asignar cResName1 a cResName4 o cBmpFile1 a cBmpFile4 programáticamente.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: BTNBMP INFO questions
Posted: Tue Jun 03, 2025 12:50 PM
Lo resolví con aBtnArt:SetFile(cPathImages + cImmagine) y en otras partes modifiqué directamente hbitmap3.= Miaimmagine()

my problem is perhaps another one if I have a button that is 150X115 how big must the image be to ensure that the text goes exactly under the lower part of the button i.e.:

 @ nTop, nLeft BTNBMP aBtnCat[i] ;
         SIZE 150,115 PIXEL FLAT ;
         FILENAME "IMAGE", "", "", "" ;
         PROMPT "article 1" OF oDlg NOROUND NOBORDER ;
         UPDATE TOP COLOR CLR_BLACK, CLR_WHITE
I ask this because many times it is not inserted well underneath while other times it is in the right place




I made the line with a my graphic func

iF i use
local nSizeWCat:=150
local nSizeHCat:=140

I must use a picture 124X124




wich is the rule ?
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: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: BTNBMP INFO questions
Posted: Wed Jun 04, 2025 05:10 PM

Silvio, calculo que el alto del font utilizado multiplicado por 2

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion