Bug on Btnbmp ???

Bug on Btnbmp ???

Postby Silvio.Falconi » Wed Nov 17, 2021 12:56 pm

Image

because buttons 1 and 3 that have pngs (or bitmaps) don't behave like the number 5

I have seen that when a button is disabled if it has a png or a bitmap it does not behave
as when it does not have the bitmap (or png), i.e. when it is disabled it assumes a darker color than the button without bitmpas

this my test

Code: Select all  Expand view  RUN
#include "Fivewin.ch"

Function test
local oDlg
local oBtn:=array(6),nI
local  oCursorBtn :=TCursor():New(,'HAND')

DEFINE DIALOG oDlg        ;
   TITLE "Test btnbmp enable/disable"     ;
   SIZE  400,400 PIXEL TRUEPIXEL              ;
   COLOR CLR_BLACK,  nRgb( 245,244,234) TRANSPARENT

 @ 10,10 BTNBMP obtn[1]   ;
                FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
                COLOR  CLR_BLACK,nRgb(238,236,219) ;
                PROMPT "Pieno.png" NOROUND;
                BITMAP "pieno.png" LEFT


@ 10,200 BTNBMP obtn[2]   ;
                FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
                COLOR  CLR_BLACK,nRgb(238,236,219) ;
                PROMPT "Pieno.png" NOROUND;
                BITMAP "pieno.png" LEFT



@ 120,10 BTNBMP obtn[3]   ;
                FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
                COLOR  CLR_BLACK,nRgb(238,236,219) ;
                PROMPT "vuoto.png" NOROUND;
                BITMAP "vuoto.png" LEFT

@ 120,200 BTNBMP obtn[4]   ;
                FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
                COLOR  CLR_BLACK,nRgb(238,236,219) ;
                PROMPT "VUOTO.png" NOROUND;
                BITMAP "vuoto.png" LEFT

@ 200,10 BTNBMP obtn[5]   ;
                FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
                COLOR  CLR_BLACK,nRgb(238,236,219) ;
                PROMPT "disable senza png" NOROUND;
                 LEFT

@ 200,200 BTNBMP obtn[6]   ;
                FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
                COLOR  CLR_BLACK,nRgb(238,236,219) ;
                PROMPT "enable senza png" NOROUND;
                 LEFT


                  for nI=1 to 6
obtn[nI]:bClrGrad = { | lInvert | If( ! lInvert,;
                    { { 1, RGB( 225, 225, 225 ), RGB( 225, 225, 225 ) } },;
                    { { 1, RGB( 229,241,251 ), RGB( 229,241,251 ) } } ) }
           obtn[nI]:nClrBorder := nRgb(218,214,179)
             obtn[nI]:oCursor:=   oCursorBtn
                  next

 ACTIVATE DIALOG oDlg center;
      ON INIT (obtn[1]:disable(),obtn[3]:disable(),obtn[5]:disable())
return nil



 



Pieno.png

Image


Vuoto.png

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: Bug on Btnbmp ???

Postby karinha » Wed Nov 17, 2021 1:27 pm

Intenta asi:


Code: Select all  Expand view  RUN

      ON INIT ( oBtn[1]:Disable(), oBtn[1]:Refresh(), oBtn[3]:Disable(), ;
                oBtn[3]:Refresh(), oBtn[5]:Disable(), oBtn[5]:Refresh() )
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Bug on Btnbmp ???

Postby Silvio.Falconi » Wed Nov 17, 2021 1:41 pm

karinha wrote:Intenta asi:


Code: Select all  Expand view  RUN

      ON INIT ( oBtn[1]:Disable(), oBtn[1]:Refresh(), oBtn[3]:Disable(), ;
                oBtn[3]:Refresh(), oBtn[5]:Disable(), oBtn[5]:Refresh() )
 


but you understood what i mean???????
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: Bug on Btnbmp ???

Postby karinha » Wed Nov 17, 2021 2:32 pm

There really is a problem. Refresh() does not work with BTNBMP and PNG.

Realmente hay un problema. Refresh() no funciona con BTNBMP y PNG.

Code: Select all  Expand view  RUN

// \SAMPLES\BTNBSILV.PRG

#include "Fivewin.ch"

FUNCTION Test()

   LOCAL oDlg
   LOCAL oBtn := Array( 6 ), nI
   LOCAL  oCursorBtn := TCursor():New(, 'HAND' )

   DEFINE DIALOG oDlg TITLE "Test btnbmp enable/disable Problem PNG"  ;
      SIZE  400, 400 PIXEL TRUEPIXEL                                  ;
      COLOR CLR_BLACK,  nRgb( 245, 244, 234 ) TRANSPARENT

   @ 10, 10 BTNBMP obtn[ 1 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "Pieno.png" NOROUND;
      BITMAP "pieno.png" LEFT            ;
      ACTION MsgInfo( "1" )

   @ 10, 200 BTNBMP obtn[ 2 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "Pieno.png" NOROUND;
      BITMAP "pieno.png" LEFT            ;
      ACTION MsgInfo( "2" )

   @ 120, 10 BTNBMP obtn[ 3 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "vuoto.png" NOROUND;
      BITMAP "vuoto.png" LEFT            ;
      ACTION MsgInfo( "3" )

   @ 120, 200 BTNBMP obtn[ 4 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "VUOTO.png" NOROUND;
      BITMAP "vuoto.png" LEFT            ;
      ACTION MsgInfo( "4" )

   @ 200, 10 BTNBMP obtn[ 5 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "disable senza png" NOROUND;
      LEFT            ;
      ACTION( oBtn[ 1 ]:Disable(), oBtn[ 1 ]:Refresh(), oBtn[ 3 ]:Disable(), ;
      oBtn[ 3 ]:Refresh(), oBtn[ 5 ]:Disable(), oBtn[ 5 ]:Refresh(),         ;
      oDlg:UpDate(), oDlg:Refresh() )

   @ 200, 200 BTNBMP obtn[ 6 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "enable senza png" NOROUND;
      LEFT             ;
      ACTION( oBtn[ 1 ]:Enable(),  oBtn[ 1 ]:Refresh(), oBtn[ 3 ]:Enable(), ;
      oBtn[ 3 ]:Refresh(), oBtn[ 5 ]:Enable(),  oBtn[ 5 ]:Refresh() )

   FOR nI = 1 TO 6
      obtn[ nI ]:bClrGrad = {| lInvert | If( ! lInvert, ;
         { { 1, RGB( 225, 225, 225 ), RGB( 225, 225, 225 ) } }, ;
         { { 1, RGB( 229, 241, 251 ), RGB( 229, 241, 251 ) } } ) }
      obtn[ nI ]:nClrBorder := nRgb( 218, 214, 179 )
      obtn[ nI ]:oCursor :=   oCursorBtn
   NEXT

   /*
   oBtn[ 1 ]:Disable()
   oBtn[ 3 ]:Disable()
   oBtn[ 5 ]:Disable()
   */


   // OR:

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oBtn[ 1 ]:Disable(), oBtn[ 1 ]:Refresh(), oBtn[ 3 ]:Disable(), ;
                oBtn[ 3 ]:Refresh(), oBtn[ 5 ]:Disable(), oBtn[ 5 ]:Refresh() )

RETURN NIL
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Bug on Btnbmp ???

Postby karinha » Wed Nov 17, 2021 3:56 pm

Esto hace que sea más fácil ver el problema con PNG, con BMP funciona normalmente. Prefiero BUTTONBMP, es mucho mejor.

This makes it easier to see the problem with PNG, with BMP it works as normal. I prefer BUTTONBMP, it's much better.

Code: Select all  Expand view  RUN

// \SAMPLES\BTNBSILV.PRG

#include "Fivewin.ch"

STATIC oBtn

FUNCTION Test()

   LOCAL oDlg, nI
   // LOCAL oBtn := Array( 6 ), nI
   LOCAL  oCursorBtn := TCursor():New(, 'HAND' )

   oBtn := Array( 6 )

   SET _3DLOOK ON

   SkinButtons()

   DEFINE DIALOG oDlg TITLE "Test btnbmp enable/disable"  ;
      SIZE  400, 400 PIXEL TRUEPIXEL                      ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT

   oDlg:lHelPIcon := .F.

   @ 10, 10 BTNBMP obtn[ 1 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "Pieno.png" NOROUND;
      BITMAP "pieno.png" LEFT            ;
      ACTION MsgInfo( "1" )

   oDlg:aControls[ 1 ]:lTransparent = .T.
   oBtn[ 1 ]:lTransparent = .T.

   @ 10, 200 BTNBMP obtn[ 2 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "Pieno.png" NOROUND;
      BITMAP "pieno.png" LEFT            ;
      ACTION MsgInfo( "2" )

   oDlg:aControls[ 2 ]:lTransparent = .T.
   oBtn[ 2 ]:lTransparent = .T.

   @ 120, 10 BTNBMP obtn[ 3 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "vuoto.png" NOROUND;
      BITMAP "vuoto.png" LEFT            ;
      ACTION MsgInfo( "3" )

   oDlg:aControls[ 3 ]:lTransparent = .T.
   oBtn[ 3 ]:lTransparent = .T.

   @ 120, 200 BTNBMP obtn[ 4 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "VUOTO.png" NOROUND         ;
      BITMAP "vuoto.png" LEFT            ;
      ACTION MsgInfo( "4" )

   oDlg:aControls[ 4 ]:lTransparent = .T.
   oBtn[ 4 ]:lTransparent = .T.

   // Fuincio bien com .BMP
   @ 200, 10 BTNBMP obtn[ 5 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      FILENAME "..\bitmaps\16x16\prop.bmp"    ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "disable senza png" NOROUND      ;
      LEFT            ;
      ACTION( oBtn[ 1 ]:Disable(), oBtn[ 1 ]:Refresh(), oBtn[ 3 ]:Disable(), ;
      oBtn[ 3 ]:Refresh(), oBtn[ 5 ]:Disable(), oBtn[ 5 ]:Refresh(),         ;
      oDlg:UpDate(), oDlg:Refresh() )

   oDlg:aControls[ 5 ]:lTransparent = .T.
   oBtn[ 5 ]:lTransparent = .T.

   @ 200, 200 BTNBMP obtn[ 6 ]   ;
      FLAT  SIZE 120, 30  OF oDlg   PIXEL ;
      FILENAME "..\bitmaps\16x16\floppy.bmp"  ;
      COLOR  CLR_BLACK, nRgb( 238, 236, 219 ) ;
      PROMPT "enable senza png" NOROUND;
      LEFT             ;
      ACTION( oBtn[ 1 ]:Enable(),  oBtn[ 1 ]:Refresh(), oBtn[ 3 ]:Enable(), ;
              oBtn[ 3 ]:Refresh(), oBtn[ 5 ]:Enable(),  oBtn[ 5 ]:Refresh() )

   oDlg:aControls[ 6 ]:lTransparent = .T.
   oBtn[ 6 ]:lTransparent = .T.

   FOR nI = 1 TO 6
      obtn[ nI ]:bClrGrad = {| lInvert | If( ! lInvert, ;
         { { 1, RGB( 225, 225, 225 ), RGB( 225, 225, 225 ) } }, ;
         { { 1, RGB( 229, 241, 251 ), RGB( 229, 241, 251 ) } } ) }
      obtn[ nI ]:nClrBorder := nRgb( 218, 214, 179 )
      obtn[ nI ]:oCursor :=   oCursorBtn
   NEXT

   /*
   oBtn[ 1 ]:Disable()
   oBtn[ 3 ]:Disable()
   oBtn[ 5 ]:Disable()
   */


   // OR:

   ACTIVATE DIALOG oDlg CENTERED  ;
      ON INIT( DesLiga_BtnBmp( oBtn ) )

      /*
      ON INIT ( oBtn[ 1 ]:Disable(), oBtn[ 1 ]:Refresh(), oBtn[ 3 ]:Disable(), ;
                oBtn[ 3 ]:Refresh(), oBtn[ 5 ]:Disable(), oBtn[ 5 ]:Refresh() )
      */


RETURN NIL

FUNCTION DesLiga_BtnBmp( oBtn )

   oBtn[ 1 ]:Disable()
   oBtn[ 1 ]:Refresh()

   oBtn[ 3 ]:Disable()
   oBtn[ 3 ]:Refresh()

   oBtn[ 5 ]:Disable()
   oBtn[ 5 ]:Refresh()

RETURN( .T. )

// FIN / END
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Bug on Btnbmp ???

Postby Silvio.Falconi » Thu Nov 18, 2021 10:10 am

I saw only if I insert
oDlg:aControls[ 1 ]:lTransparent = .T.

then I see the button
If I not insert it the btnbmp show bad
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7063
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 98 guests