Problem to change bitmap

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Problem to change bitmap

Post by Silvio.Falconi »

I wish chnge the bitmap on btnbmo when I click over but not run ok
change the caption but not the bitmap (png)

Code: Select all


 @ 195,250 BTNBMP oBtnClose  PROMPT "&Chiudi" ;
           RESOURCE ".\bitmaps\DLG_NO_MIN.bmp "  FLAT;
            SIZE  50,50 PIXEL OF oFld:aDialogs[1] RIGHT;
            ACTION CHANGE(oBtnClose, @lgiorno)

Function CHANGE(oBtnClose,lgiorno)
   lgiorno:=!lGiorno
   If lGiorno
       oBtnClose:cBmpFile1:="time.png"
       oBtnClose:cCaption:="giornaliero"
    else
       oBtnClose:cBmpFile1:="prenota.png"
      oBtnClose:cCaption:="periodico"
   endif

    oBtnClose:refresh()
   return lgiorno
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Problem to change bitmap

Post by karinha »

Maybe using, bChange()
João Santos - São Paulo - Brasil
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Problem to change bitmap

Post by ukoenig »

Silvio,
tested and works imagechange on mouseclick :D

Image

Code: Select all

FUNCTION CHANGE(oBtnClose,lgiorno)

lgiorno:=!lGiorno

If lGiorno
       // replaces the 1th bitmap
       oBtnClose:SetImages( c_path1 + "Checkon.bmp", nil, nil,nil )  
       oBtnClose:cCaption   := "Checkon"
ELSE
       oBtnClose:SetImages( c_path1 + "Checkoff.bmp", nil, nil,nil )
       oBtnClose:cCaption   := "Checkoff"
ENDIF

RETURN lgiorno
 
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to change bitmap

Post by Silvio.Falconi »

I must use CLASS TButtonBmp
and setimages not good
oBtngiorn:LoadBitmap(".\bitmaps\prenota.png" )
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem to change bitmap

Post by nageswaragunupudi »

Code: Select all

   @ 195,250 BTNBMP PROMPT { || If( lGiorno, "giornaliero", "periodico" ) } ;
      RESOURCE aImages[ 1 ] ;
      SIZE 100,100 PIXEL OF oDlg FLAT ;
      ACTION ( lGiorno := !lGiorno, ;
               ::SetImages( If( lGiorno, aImages[ 1 ], aImages[ 2 ] ) ) )

 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to change bitmap

Post by Silvio.Falconi »

Rao,
yes but my problem was the color of the btnbmp (over and not ) because I not Know How make the theme effect

I tried with

Code: Select all

  @ 6,680 BTNBMP oBtnGiorn PROMPT { || If( lGiorno, "giornaliero", "periodico" ) } ;
      RESOURCE aImagesGiorno[ 1 ] ;
      SIZE 40,30 PIXEL OF oFld:aDialogs[1] FLAT ;
      ACTION ( lGiorno := !lGiorno, ;
               ::SetImages( If( lGiorno, aImagesGiorno[ 1 ], aImagesGiorno[ 2 ] ) ) ) ;
      COLOR CLR_RED,Rgb( 225,239,219) FONT oFontBold ;
        GRADIENT  { | lInvert | If( ! lInvert,;
                { { 1 ,RGB( 225, 225,225 ),   RGB( 229,241,251 ) } },;
                { { 1, RGB( 229,241,251 ),RGB( 225, 225, 225 ) } } ) }

I wish the border gray
the gray color when the btnbmp is not press
the blue color when the bbtnbmp is press or over and chenged the border

But I not have the theme effect


then I thinked to BUTTOMBMP but I have problem with cCaption not refresh
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Problem to change bitmap

Post by ukoenig »

Try this
( I think You mean the colour not border )
I wish the border :?: gray
the gray color when the btnbmp is not press
the blue color when the bbtnbmp is press or over and chenged the border

Code: Select all

oBtn:bClrGrad = { | lMouseOver | If( ! lMouseOver,; 
    { { 0.9, RGB( 225, 225,225 ), RGB( 225, 225,225 ) }, ;
      { 0.9, RGB( 225, 225,225 ), RGB( 225, 225,225 ) } }, ;
    { { 0.9, RGB( 229,241,251), RGB( 229,241,251 ) }, ;
       { 0.9, RGB( 229,241,251), RGB( 229,241,251 ) } } ) }
 
Your selected colours

Image

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to change bitmap

Post by Silvio.Falconi »

I'm searching 2016 Office Like colors for windows 10pro
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply