Light a Icon on Msgitem - Resolved -

Light a Icon on Msgitem - Resolved -

Postby Silvio.Falconi » Wed Nov 09, 2022 9:24 am

When I activate the main windows I made

Image

Code: Select all  Expand view

IF !CheckEstrazione()
          ::oMsgItem2:setBitmap("warning")
          ::oMsgItem2:cMsg:="Archivio non aggiornato"
       else
          ::oMsgItem2:setBitmap("check")
          ::oMsgItem2:cMsg:="Archivio aggiornato"
       Endif
        ::oMsgItem2:refresh()


How I can to flash the icon or bitmap?
Last edited by Silvio.Falconi on Thu Nov 10, 2022 9:43 am, edited 1 time in total.
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Light a Icon on Msgitem

Postby karinha » Wed Nov 09, 2022 3:31 pm

Dear Silvio: Maybe,

Code: Select all  Expand view

   IF !CheckEstrazione()
      ::oWnd:oMsgItem2:setBitmap("warning") // LoadBmp() ?
      ::oWnd:oMsgItem2:cMsg:="Archivio non aggiornato"
   ELSE
      ::oWnd:oMsgItem2:setBitmap("check")
      ::oWnd:oMsgItem2:cMsg:="Archivio aggiornato"
   ENDIF

   ::oWnd:oMsgItem2:Refresh()

   // If( IsWindowVisible( ::oMsgBar:hWnd ), ::Paint(),)
 


Regards, saludos.
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: Light a Icon on Msgitem

Postby Silvio.Falconi » Wed Nov 09, 2022 3:50 pm

karinha wrote:Dear Silvio: Maybe,

Code: Select all  Expand view

   IF !CheckEstrazione()
      ::oWnd:oMsgItem2:setBitmap("warning") // LoadBmp() ?
      ::oWnd:oMsgItem2:cMsg:="Archivio non aggiornato"
   ELSE
      ::oWnd:oMsgItem2:setBitmap("check")
      ::oWnd:oMsgItem2:cMsg:="Archivio aggiornato"
   ENDIF

   ::oWnd:oMsgItem2:Refresh()

   // If( IsWindowVisible( ::oMsgBar:hWnd ), ::Paint(),)
 


Regards, saludos.




Karina,
are you running a competition to answer all my requests without reconnaissance on the forum? but did you understand my problem?
I want to display a bitmap but I want to make it flash that is to show and not to show, to show and not to show ... until infinity !!

I believe that you are making me so much teasing on the forum, you are answering my requests for help without a logical sense, maybe I'm wrong because I really don't really understand your answers !!!!
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Light a Icon on Msgitem

Postby TimStone » Wed Nov 09, 2022 6:03 pm

Silvio,

First, I see lots of applications with those warning icons, but never flashing. I think to do that you would have to create a function that displays, removes, displays, removes the icon. That would certainly be a load on the CPU to constantly refresh the dialog to display it in a flash.

Icons, by nature, are not ( I think ) animated. Just thinking outloud, but can you insert a GIF for a flashing warning ? I really don't know if you can do it, but just sharing some thoughts.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Light a Icon on Msgitem

Postby karinha » Wed Nov 09, 2022 6:05 pm

Caro Silvio, tranquilo. Dear Silvio, calm down.
No sé por qué estás tan nervioso. I don't know why you're so nervous. hahahahahaha.

A ver si te ayuda:

C:\FWH..\SAMPLES\TESTMBAR.PRG

Regards, saludos.
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: Light a Icon on Msgitem

Postby Silvio.Falconi » Thu Nov 10, 2022 9:43 am

TimStone wrote:Silvio,

First, I see lots of applications with those warning icons, but never flashing. I think to do that you would have to create a function that displays, removes, displays, removes the icon. That would certainly be a load on the CPU to constantly refresh the dialog to display it in a flash.

Icons, by nature, are not ( I think ) animated. Just thinking outloud, but can you insert a GIF for a flashing warning ? I really don't know if you can do it, but just sharing some thoughts.

Tim


Tim,
I resolved!!!!

Two Bitmaps

warning1.bmp
Image

warning2.bmp
Image

If you save from forum you must rename the exstension of Bmps because postimages.org converte on Png


Code: Select all  Expand view


// Animations on MsgItem using Bmp and Timers

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   local oBrush



   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 60 ;
      TITLE "msgitem"

   SET MESSAGE OF oWnd ;
      TO FWVERSION + FWCOPYRIGHT

      DEFINE MSGITEM oMsgItem1;
         OF oWnd:oMsgBar ;
           SIZE 170             ;
         ACTION NIL

   ACTIVATE WINDOW oWnd ;
      ON INIT DisplayIcons(oMsgItem1)

return nil

//----------------------------------------------------------------------------//

function DisplayIcons(oMsgItem1)

   local oIco, oTimer

   static nFrame := 1

    oMsgItem1:cMsg:="Archivio non aggiornato"

   DEFINE TIMER oTimer OF oWnd ;
      INTERVAL 400 ;
      ACTION ( nFrame := If( ++nFrame > 2, 1, nFrame ) , ;
               oMsgItem1:setBitmap( "warning" + AllTrim( Str( int(nFrame) ) )+".bmp" ) )

   ACTIVATE TIMER oTimer

return nil
 
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: 7061
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 86 guests