Flashing msginfo().. msgstop().. and msgalert()..

Flashing msginfo().. msgstop().. and msgalert()..

Postby fraxzi » Fri Apr 23, 2010 5:09 am

Dear all,

How can I make Msgxxx() flashing like twice.. getting user's attention?


Regards,
Fraxzi
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby Antonio Linares » Fri Apr 23, 2010 8:38 am

Frances,

You have to implement your own functions Msg...() replacements and use a timer to hide and show the text so it flashes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41366
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby James Bott » Fri Apr 23, 2010 10:39 pm

Personally, I hate flashing. Most users I ask also hate it. I don't think it is a good user interface design.

Perhaps if you explain the situation, we might come up with a better solution.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby fraxzi » Fri Apr 23, 2010 11:49 pm

Antonio Linares wrote:Frances,

You have to implement your own functions Msg...() replacements and use a timer to hide and show the text so it flashes



Mr. Antonio,

In fact, I have that function.. but what I want to flash is the dialog/window of Msg..() function like when dialog is modal when clicking the mouse outside of that dialog..


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby fraxzi » Fri Apr 23, 2010 11:52 pm

James Bott wrote:Personally, I hate flashing. Most users I ask also hate it. I don't think it is a good user interface design.

Perhaps if you explain the situation, we might come up with a better solution.

James



Dear James,

Just like a modal dialog when you click the mouse outside.. My user requested for flashing window.. not only the text..


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby James Bott » Fri Apr 23, 2010 11:58 pm

Frances,

Just like a modal dialog when you click the mouse outside.. My user requested for flashing window.. not only the text..


Since the user could click anywhere outside the dialog, even on another program, this would require dealing with the windows event queue--not simple. Further, the user would not be able to switch to another program. Most users would hate this.

The customer is always right. However, a user is not always the customer (the one who pays the bills). And I don't generally let users design interfaces--they don't really understand them. The best interface is no interface--less is more. This is a concept hard to grasp.

First I try to understand the problem. Why is your user requesting this? What is happening that they are trying to fix? If we can understand the problem, then maybe we can find a better solution.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby mmercado » Sat Apr 24, 2010 12:52 am

Hello All:

I understand the requirement of Frances and his users, and I think that would be better to make flash the label in the taskbar when the program is waiting for a user response (the case of modal messages), does someone know how to do it from a FWH program?

Best regards.

Manuel Mercado Gómez.
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby fraxzi » Sat Apr 24, 2010 3:28 am

Dear All,

Perhaps to simulate a mouse click outside the msg...() function will make it flash.. so how to trigger mouse click after msg...() function?


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby Daniel Garcia-Gil » Sat Apr 24, 2010 5:05 am

Hello Frances

please test this sample

Left Click over window, set ON flashing
Right Click over window, set OFF flashing


Code: Select all  Expand view

#include "fivewin.ch"


#define FLASHW_ALL       0x03 //Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
#define FLASHW_CAPTION   0x01 //Flash the window caption.
#define FLASHW_STOP      0x00 //Stop flashing. The system restores the window to its original state.
#define FLASHW_TIMER     0x04 //Flash continuously, until the FLASHW_STOP flag is set.
#define FLASHW_TIMERNOFG 0x0C //Flash continuously until the window comes to the foreground.
#define FLASHW_TRAY      0x02 //Flash the taskbar button.

FUNCTION MAIN
   LOCAL oWnd
   
   DEFINE WINDOW oWnd
   
   oWnd:bLClicked = { || FlashWindow( oWnd:hWnd, FLASHW_ALL ) }
   oWnd:bRClicked = { || FlashWindow( oWnd:hWnd, FLASHW_STOP ) }
   
   ACTIVATE WINDOW oWnd
   
RETURN NIL
   


#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>

HB_FUNC( FLASHWINDOW )
{
    FLASHWINFO * pFlash = ( FLASHWINFO * ) hb_xgrab( sizeof( FLASHWINFO )  );
    INT uCount = 100;
   
   
    if( hb_pcount() > 2 )
       uCount = hb_parni( 3 );
       
    memset( pFlash, 0, sizeof( FLASHWINFO ) );
   
    pFlash->cbSize    = sizeof( FLASHWINFO );
    pFlash->hwnd      = ( HWND ) hb_parnl( 1 );
    pFlash->dwFlags   = hb_parnl( 2 );
    pFlash->uCount    = uCount;
    pFlash->dwTimeout = 0;
   
    FlashWindowEx( pFlash );
   
    hb_xfree( pFlash );

}
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby armando.lagunas » Sat Apr 24, 2010 5:25 am

hola:

el código que publico, hace que aparezca un dialogo en la parte inferior izquierda, y el texto lo saco es de 500 caracteres, partido en 5 partes de 100 caracteres c/u de una tabla DBF, y el dialogo después de 9 segundos desaparece.

Código:

Code: Select all  Expand view

#define CRLF Chr(13)+Chr(10)

FUNCTION MsgTray(  oWnd, cIndice )
LOCAL DlgTray, cText
   SELECT ALERTAS
   SEEK cIndice
   IF !EOF()    
       cText := ALLTRIM(ALERTAS->TEXTO1+CRLF+ALERTAS->TEXTO2+CRLF+ALERTAS->TEXTO3 ;
                       +CRLF+ALERTAS->TEXTO4+CRLF+ALERTAS->TEXTO5)
   ELSE        
       cText := "CODE: "+cIndice+"Indice no encontrado !!"
   ENDIF
 
   DEFINE DIALOG DlgTray RESOURCE 14 OF oWnd
      REDEFINE SAY PROMPT cText ID  11 OF DlgTray
      REDEFINE BUTTON                ID  10 OF DlgTray  ACTION DlgTray:End()
      DlgTray:lHelpIcon := .F.
   ACTIVATE DIALOG DlgTray NOWAIT ;
            ON INIT ( DlgTray:MOVE((oWnd:nHeight() - 180 ), ;
                         (oWnd:nWidth() - 365 )), ;
                          TrayTimer( DlgTray ), ;
                         IIF(!SndPlaySound(".\SYSTEM\SONIDO.WAV",1),MsgBeep(),)  )
RETURN Nil

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

STATIC FUNCTION TrayTimer( DlgTray )
LOCAL oTmr
   DEFINE   TIMER oTmr OF DlgTray INTERVAL 9000 ACTION DlgTray:End()
   ACTIVATE TIMER oTmr
RETURN nil

 



el dialogo lo hice con el resource workshop y la particularidad que debe tener el say, es marcar el "control type" que sea "left text no wrap"

a mi me funciona muy bien.

espero que te sirva

saludos desde Chile.
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby fraxzi » Sat Apr 24, 2010 5:44 am

Daniel Garcia-Gil wrote:Hello Frances

please test this sample

Left Click over window, set ON flashing
Right Click over window, set OFF flashing


Code: Select all  Expand view

#include "fivewin.ch"


#define FLASHW_ALL       0x03 //Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
#define FLASHW_CAPTION   0x01 //Flash the window caption.
#define FLASHW_STOP      0x00 //Stop flashing. The system restores the window to its original state.
#define FLASHW_TIMER     0x04 //Flash continuously, until the FLASHW_STOP flag is set.
#define FLASHW_TIMERNOFG 0x0C //Flash continuously until the window comes to the foreground.
#define FLASHW_TRAY      0x02 //Flash the taskbar button.

FUNCTION MAIN
   LOCAL oWnd
   
   DEFINE WINDOW oWnd
   
   oWnd:bLClicked = { || FlashWindow( oWnd:hWnd, FLASHW_ALL ) }
   oWnd:bRClicked = { || FlashWindow( oWnd:hWnd, FLASHW_STOP ) }
   
   ACTIVATE WINDOW oWnd
   
RETURN NIL
   


#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>

HB_FUNC( FLASHWINDOW )
{
    FLASHWINFO * pFlash = ( FLASHWINFO * ) hb_xgrab( sizeof( FLASHWINFO )  );
    INT uCount = 100;
   
   
    if( hb_pcount() > 2 )
       uCount = hb_parni( 3 );
       
    memset( pFlash, 0, sizeof( FLASHWINFO ) );
   
    pFlash->cbSize    = sizeof( FLASHWINFO );
    pFlash->hwnd      = ( HWND ) hb_parnl( 1 );
    pFlash->dwFlags   = hb_parnl( 2 );
    pFlash->uCount    = uCount;
    pFlash->dwTimeout = 0;
   
    FlashWindowEx( pFlash );
   
    hb_xfree( pFlash );

}



Hello Daniel,

I added '#pragma ENDDUMP' at the end of your sample..

It worked great as this is ideal behavior.. I will integrate this to my generic Msg...() function so I can flash the dialog/window..
Great visual notification!!

Thank you and Mabuhay!


Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby Otto » Sat Apr 24, 2010 5:40 pm

mygeneric Msg...() function

Dear Frances,
Maybe you are so kind to share what other goodies you have in your function?
Thanks in advance,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6049
Joined: Fri Oct 07, 2005 7:07 pm

Re: Flashing msginfo().. msgstop().. and msgalert()..

Postby fraxzi » Mon Apr 26, 2010 12:54 am

Otto wrote:mygeneric Msg...() function

Dear Frances,
Maybe you are so kind to share what other goodies you have in your function?
Thanks in advance,
Otto



Dear Otto,

Of course.. as always a Fivewinner.. I share what I have.. My generic Msg...() function or other FW are much common.. not fancy.. not new class..
I share some thoughts and tip too..

Thank you so much for the community and our gurus here who provide and shared with us..

My gratitude.

My best regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

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