FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH26.08 LoadBitmap error
Posts: 137
Joined: Sat Oct 08, 2005 09:38 PM

FWH26.08 LoadBitmap error

Posted: Tue Aug 18, 2026 11:57 AM

After I upgrade from November 2025 to August 2026 LoadBitmap gives an error.
Try the code below. Click the find button to fire the Action

#include "FiveWin.ch"

function Main()
local oWnd, cFind1, cFind2, oTest
local nShow1 := .T., cTest := "Hello world!"

   cFind1 := "\fwh\bitmaps\16x16\find.bmp"
   cFind2 := "\fwh\bitmaps\16x16\find2.bmp"

   DEFINE WINDOW oWnd COLOR "N/W*"

   @ 2, 2 GET oTest VAR cTest ;
          SIZE 110, 22 ;
          BITMAP cFind1 ;
          ACTION ( nShow1 := ! nShow1, ;
                   oTest:oBtn:LoadBitmap( IF( nShow1, cFind1, cFind2 ) ) )

   ACTIVATE WINDOW oWnd

return nil

Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 26.08, BCC77

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

Re: FWH26.08 LoadBitmap error

Posted: Tue Aug 18, 2026 01:47 PM
// C:\FWH2603\SAMPLES\BIROL.PRG

#include "FiveWin.ch"

STATIC oWnd, nShow1 := .F.

FUNCTION Main()

   LOCAL oTest
   LOCAL cTest := "Hello world!"

   DEFINE WINDOW oWnd COLOR "N/W*"

   @ 2, 2 GET oTest VAR cTest SIZE 110, 22 OF oWnd ;
          BITMAP "..\bitmaps\16x16\find.bmp"       ;
          ACTION ( LOAD_BITM( oTest, nShow1 := .T. ) )

   oTest:lBtnTransparent := .T.
   oTest:lAdjustBtn      := .T.

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION LOAD_BITM( oTest, nShow1 )

   IF( nShow1 ) // := .T.

  oTest:oBtn:LoadBitmaps( "..\bitmaps\16x16\find2.bmp" )

  nShow1 := .F.

   ENDIF

RETURN( .T. )

// FIN / END

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Tue Aug 18, 2026 02:56 PM

There really is an error.

Realmente hay un error.

// C:\FWH2603\SAMPLES\BIROL.PRG

#include "FiveWin.ch"

STATIC oWnd, nShow1 := [YES] //.T.

FUNCTION Main()

   LOCAL oTest
   LOCAL cTest := "Hello world!"

   DEFINE WINDOW oWnd COLOR "N/W*"

   @ 2, 2 GET oTest VAR cTest SIZE 110, 22 OF oWnd ;
          BITMAP "..\bitmaps\16x16\find2.bmp"      ;
          ACTION ( LOAD_BITM( oTest, nShow1 ) )

   oTest:lBtnTransparent := .T.
   oTest:lAdjustBtn      := .T.

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION LOAD_BITM( oTest, nShow1 )

   IF nShow1 = [NO] // .F.

  oTest:oBtn:LoadBitmaps( "..\bitmaps\16x16\Find2.bmp" )

  ? [Entering: 1 ], nShow1

  nShow1 := [YES] // .T.

   ELSEIF nShow1 = [YES] // .T.

  oTest:oBtn:LoadBitmaps( "..\bitmaps\16x16\Exit.bmp" )
  
  ? [Entering: 2 ], nShow1

  nShow1 := [NO] // .F.

   ELSE

  ? [ERROR...], nShow1

   ENDIF

   oWnd:Update()
   oWnd:Refresh()

RETURN NIL  // ( .T. )

// FIN / END

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 137
Joined: Sat Oct 08, 2005 09:38 PM

Re: FWH26.08 LoadBitmap error

Posted: Tue Aug 18, 2026 04:01 PM

Thanks for yur reply Karinha. But the method was LoadBitmap(), not LoadBitmaps() In Fwh25.11 the object of the button in the get action was buttonbmp In Fwh26.08 it is changed as btnbmp.

I was using this button to show/hide the password. The old one looked much better—it was highlighted when I moved the mouse over it. With the current version, the password always remains hidden, so it doesn't work.

Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 26.08, BCC77

Posts: 137
Joined: Sat Oct 08, 2005 09:38 PM

Re: FWH26.08 LoadBitmap error

Posted: Tue Aug 18, 2026 04:21 PM

Please try this code with the old fwh.

#include "FiveWin.ch"

function Main()
local oDlg, cFind1, cFind2, oPsw
local cPsw := PadR('Abc@12', 10)

   cFind1 := "\fwh\bitmaps\16x16\find.bmp"
   cFind2 := "\fwh\bitmaps\16x16\find2.bmp"

   DEFINE DIALOG oDlg SIZE 460, 160 ;
          PIXEL TRUEPIXEL ;
          TITLE " " ;
          TRANSPARENT 

   @ 2, 2 GET oPsw VAR cPsw OF oDlg UPDATE ;
          SIZE 110, 22 ;
          BITMAP cFind1 ;
          ACTION ( oPsw:lPassword := !oPsw:lPassword, ;
                   oPsw:oBtn:LoadBitmap( IF( oPsw:lPassword, cFind1, cFind2 ) ), ;
                   oDlg:UpDate() )

   oPsw:lPassword := .T.

   ACTIVATE DIALOG oDlg CENTERED

return nil

Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 26.08, BCC77

Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: FWH26.08 LoadBitmap error

Posted: Tue Aug 18, 2026 04:50 PM
betoncu wrote:

Thanks for yur reply Karinha. But the method was LoadBitmap(), not LoadBitmaps()
In Fwh25.11 the object of the button in the get action was buttonbmp
In Fwh26.08 it is changed as btnbmp.

I was using this button to show/hide the password. The old one looked much better—it was highlighted when I moved the mouse over it. With the current version, the password always remains hidden, so it doesn't work.

Dear Birol,

Let me review why we did such change and if we can revert it

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Thu Aug 20, 2026 07:18 PM

Birol and Master Liñares, the code I posted didn't actually have errors related to FWH2603; the mistake was in my own writing. I discovered this when modifying one of my own modules—I did the exact same thing and made the same error, and it didn't work even in version FWH1905. Hahaha, here is the fix:
My sincerest apologies.

Birol y maestro Liñares: el código que publiqué no tenía errores en FWH2603, sino que el fallo estaba en cómo lo escribí. Me di cuenta al modificar un módulo propio: hice lo mismo, cometí el mismo error y tampoco funcionaba en la versión FWH1905; jajaja. Aquí está la corrección:
Les pido mil disculpas.

// C:\FWH2603\SAMPLES\BIROL2.PRG - 20/08/2026 - kapiaba, my mistake..

#include "FiveWin.ch"

STATIC oWnd, nShow1 := [YES] //.T.

FUNCTION Main()

   LOCAL oTest
   LOCAL cTest := "Hello world!"

   DEFINE WINDOW oWnd COLOR "N/W*"

   @ 2, 2 GET oTest VAR cTest SIZE 110, 22 OF oWnd ;
          BITMAP "..\bitmaps\16x16\find2.bmp"      ;
          ACTION ( LOAD_BITM( oTest, nShow1 ) )

   oTest:lBtnTransparent := .T.
   oTest:lAdjustBtn      := .T.

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION LOAD_BITM( oTest, nNShow1 ) // My mistake. Terrible. hahahaha.

   IF nNShow1 = [NO] // .F.

  oTest:oBtn:LoadBitmaps( "..\bitmaps\16x16\Find2.bmp" )

  oTest:oBtn:Refresh()

  // ? [Entering: 1 ], nShow1

  nShow1 := [YES] // .T.

   ELSEIF nNShow1 = [YES] // .T.

  oTest:oBtn:LoadBitmaps( "..\bitmaps\16x16\Exit.bmp" )

  oTest:oBtn:Refresh()
  
  // ? [Entering: 2 ], nShow1

  nShow1 := [NO] // .F.

   ELSE

  ? [ERROR...], nShow1

   ENDIF

//   oWnd:Update()
//   oWnd:Refresh()

RETURN NIL  // ( .T. )

// FIN / END

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Thu Aug 20, 2026 09:15 PM

¡¡Ni Antônio Liñares ni la INTELIGENCIA ARTIFICIAL pueden vencerme!! Jajajaja.

// C:\FWH2603\SAMPLES\BIROL3.PRG

#include "FiveWin.ch"

FUNCTION Main()

   local oDlg, cFind1, cFind2, oPsw
   local cPsw := PadR( 'Abc@123', 10 )

   cFind1 := "\fwh1905\bitmaps\16x16\find.bmp"
   cFind2 := "\fwh1905\bitmaps\16x16\find2.bmp"

   DEFINE DIALOG oDlg SIZE 460, 160 PIXEL TRUEPIXEL TRANSPARENT              ;
      TITLE "Birol in PassWord -> fwh1905 and fwh2603."

   oDlg:lHelpIcon :=.F.

   IF FWVERSION >= "FWH 26.03" // Changes in IA/AI, terribles. hahaha.

  @ 2, 2 GET oPsw VAR cPsw OF oDlg SIZE 110, 22 UPDATE BITMAP cFind1         ;
     ACTION( oPsw:lPassword := !oPsw:lPassword,                              ;
             oPsw:oBtn:LoadBitmaps( IIF( oPsw:lPassword, cFind1, cFind2 ) ), ;
             oPsw:oBtn:Refresh() )

  oPsw:lPassword := .T.

   ELSE // FWH1905

  @ 2, 2 GET oPsw VAR cPsw OF oDlg SIZE 110, 22 UPDATE BITMAP cFind1        ;
     ACTION( oPsw:lPassword := !oPsw:lPassword,                             ;
             oPsw:oBtn:LoadBitmap( IIF( oPsw:lPassword, cFind1, cFind2 ) ), ;
             oPsw:oBtn:Refresh() )

  oPsw:lPassword := .T.

   ENDIF

   ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

// FIN / END

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 137
Joined: Sat Oct 08, 2005 09:38 PM

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 09:50 AM

I Have test it both in a dialog and in a window, with FWH25.11 and FWH26.08.
Here are the Results:

FWH25.11
LoadBitmap in a dialog works fine
LoadBitmap in a window works fine
LoadBitmaps in a dialog gives an error (object TBUTTONBMP)
LoadBitmaps in a window gives an error (object TBUTTONBMP)

FWH26.08
LoadBitmap in a dialog gives an error (object TBTNBMP)
LoadBitmap in a window gives an error (object TBTNBMP)
LoadBitmaps in a dialog works but does not show the password
LoadBitmaps in a window works fine

//   TestGetActionDlg.prg

#include "FiveWin.ch"

function Main()
local oDlg, cFind1, cFind2, oPsw
local cPsw := PadR('Abc@12', 10)

   cFind1 := "\fwh\bitmaps\16x16\find.bmp"
   cFind2 := "\fwh\bitmaps\16x16\find2.bmp"

   DEFINE DIALOG oDlg SIZE 460, 160 ;
          PIXEL TRUEPIXEL ;
          TITLE " " ;
          TRANSPARENT 

   @ 2, 2 GET oPsw VAR cPsw OF oDlg UPDATE ;
          SIZE 110, 22 ;
          BITMAP cFind1 ;
          ACTION ( oPsw:lPassword := !oPsw:lPassword, ;
                   oPsw:oBtn:LoadBitmap( IF( oPsw:lPassword, cFind1, cFind2 ) ), ;
                   oDlg:UpDate() )

   oPsw:lPassword := .T.

   ACTIVATE DIALOG oDlg CENTERED

return nil
// TestGetActionWnd.prg

#include "FiveWin.ch"

function Main()
local oWnd, cFind1, cFind2, oPsw
local cPsw := PadR('Abc@12', 10)

   cFind1 := "\fwh\bitmaps\16x16\find.bmp"
   cFind2 := "\fwh\bitmaps\16x16\find2.bmp"

   DEFINE WINDOW oWnd COLOR "N/W*"

   @ 2, 2 GET oPsw VAR cPsw SIZE 110, 22 OF oWnd ;
          BITMAP cFind1 ;
          ACTION ( oPsw:lPassword := !oPsw:lPassword, ;
                   oPsw:oBtn:LoadBitmap( IF( oPsw:lPassword, cFind1, cFind2 ) ) )

   oPsw:lPassword := .T.

   ACTIVATE WINDOW oWnd

return nil

Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 26.08, BCC77

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

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 11:23 AM

Birol, you're right; Master Liñares needs to look into the reasons for so many radical changes from one version to the next—for instance, renaming the "TELA" (screen) to "SENHA" (password) in the new versions, or the fact that to get the screen to sit "INSIDE" the WINDOW, you have to do it this way:

Birol, tienes razón; el maestro Liñares tiene que ver por qué hubo tantos cambios radicales de una versión a otra. Por ejemplo: para llamar a la pantalla de contraseña en las nuevas versiones, o para que la pantalla quede "dentro" de la ventana, solo se puede hacer así:

   // AGORA NA FWH2603 E ASSIM:
   WITH OBJECT oWnd
      :bInit := {|| oWnd:Show(), oWnd:Center(), oWnd:Maximize(),  DLGINICIAL() }
   END
     

   ACTIVATE WINDOW oWnd MAXIMIZED VALID( ENCERRA( oWnd ) )
   // ON INIT( DLGINICIAL() )  // PAROU DE FUNCIONAR NA FWH2603.

   RELEASE FONT oFont

RETURN NIL

Gracias, tks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 04:52 PM

Revisé el fuente y el historial git. La conclusión: ON INIT no fue eliminado ni modificado en FWH2603 — el mecanismo sigue
exactamente igual:

• El comando ACTIVATE WINDOW ... ON INIT <uInit> (include/fivewin.ch:1909) sigue expandiendo a <oWnd>:bInit := { |Self| <uInit>
} (línea 1930).
• TWindow:Activate() sigue evaluándolo en source/classes/window.prg:1186-1188 (Eval( ::bInit, Self )), código que no cambia
desde 2007.

O sea, esto es equivalente:

Code (xbase): Select all Collapse
     ON INIT( DLGINICIAL() )          // idéntico a:
     :bInit := {|| DLGINICIAL() }

Lo que realmente cambió en tu workaround no es bInit vs ON INIT, sino esto:

Code (xbase): Select all Collapse
     :bInit := {|| oWnd:Show(), oWnd:Center(), oWnd:Maximize(), DLGINICIAL() }

La clave: en Activate(), el bInit se evalúa antes de ShowWindow() (línea 1207) y antes de arrancar el bucle de mensajes (WinRun,
línea 1214). Es decir, con el código viejo, DLGINICIAL() corría con la ventana principal todavía oculta y sin message loop
activo. Tu versión nueva muestra y maximiza la ventana explícitamente antes de llamar DLGINICIAL() — eso es lo que lo "arregla",
no el cambio de sintaxis.

Sobre por qué dejó de funcionar en 26.03: en ese release no hubo cambios en el path bInit/Activate (los commits de esa época
fueron fixes de warnings, Unicode/chars acentuados, codepages CP1252 y toolchain GCC 14.3). Lo más probable es que algo dentro
de DLGINICIAL() — típicamente activar un diálogo modal — ahora requiera que la ventana padre esté visible. Sin ver DLGINICIAL()
no puedo señalar el commit exacto, pero si quieres lo reviso: dime qué hace esa función (o pégala aquí) y rastreo el cambio
concreto.

Un aviso adicional si actualizas más allá de 26.03: el commit 488140e42 (26.08) añadió FW_WndDarkMode( Self ) justo después del
Eval( ::bInit ) en Activate() — si creas controles dentro de bInit, el dark mode global se les aplicará encima.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 05:08 PM

Master Antônio, con bInit:

https://imgur.com/zCeRWzk

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 05:12 PM

Con ON INIT:

https://imgur.com/zvi9dLT

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 05:18 PM

En las versiones anteriores, el ON INIT desplegaba la pantalla de contraseña "dentro" de la ventana, tal como en la primera pantalla; ahora, en las nuevas versiones, primero aparece la pantalla de contraseña y después la ventana.

P.D. Esto no supone ningún inconveniente, ya que con bInit funciona igual que antes con ON INIT.

Gracias, tks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: FWH26.08 LoadBitmap error

Posted: Fri Aug 21, 2026 06:06 PM

Estimado Maestro Antônio, ¿ya no es posible modificar TGET.PRG en METHOD DispText() CLASS TGet para que aparezca un asterisco (*) en la contraseña en lugar de un punto (CHR(149))?

Gracias, tks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341