Problem to change bitmap

Problem to change bitmap

Postby Silvio.Falconi » Mon May 20, 2019 5:31 pm

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  Expand view


 @ 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
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: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to change bitmap

Postby karinha » Mon May 20, 2019 6:03 pm

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

Re: Problem to change bitmap

Postby ukoenig » Mon May 20, 2019 6:21 pm

Silvio,
tested and works imagechange on mouseclick :D

Image

Code: Select all  Expand view

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Problem to change bitmap

Postby Silvio.Falconi » Tue May 21, 2019 10:54 am

I must use CLASS TButtonBmp
and setimages not good
oBtngiorn:LoadBitmap(".\bitmaps\prenota.png" )
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: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to change bitmap

Postby nageswaragunupudi » Wed May 22, 2019 12:27 am

Code: Select all  Expand view
  @ 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
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem to change bitmap

Postby Silvio.Falconi » Wed May 22, 2019 7:34 am

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  Expand view

  @ 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
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: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to change bitmap

Postby ukoenig » Wed May 22, 2019 3:10 pm

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  Expand view

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Problem to change bitmap

Postby Silvio.Falconi » Wed May 22, 2019 3:51 pm

I'm searching 2016 Office Like colors for windows 10pro
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: 7054
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests