FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Disabling button in MsgMeter()
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Disabling button in MsgMeter()
Posted: Sun Dec 01, 2013 11:14 PM

Guys:

Can I disable the cancel button that shows when I'm using MsgMeter() ? I do not want users cancelling indexing operations.

Thank you.

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Disabling button in MsgMeter()
Posted: Mon Dec 02, 2013 01:19 AM
HunterEC,
Maybe something like this? (include this function into your project)
Code (fw): Select all Collapse
//----------------------------------------------------------------------------//
function MsgMeter( bAction, cMsg, cTitle, lBoton )
   local oDlg, oMeter, oText, oBtn, oFont
   local lEnd := .f., lCancel := .f.
   local nVal := 0

   DEFAULT bAction := { || nil },;
           cMsg := "Procesando...", cTitle := "Aguarde por favor",;
           lBoton := .f.

   DEFINE DIALOG oDlg RESOURCE "MSGMETER" COLOR "W+/B"
   REDEFINE TSAYT ID 111 OF oDlg 
   REDEFINE TSAYT oText VAR cMsg ID 110 OF oDlg 
   REDEFINE METER oMeter VAR nVal TOTAL 10 ID 130 OF oDlg

   **DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -8
   **DEFINE DIALOG oDlg FROM 5, 5 TO 10.4, 45 TITLE cTitle FONT oFont
   **@ 0.2, 0.5  SAY oText VAR cMsg SIZE 130, 10 OF oDlg
   **@ 1,   0.5  METER oMeter VAR nVal TOTAL 10 SIZE 150, 10 OF oDlg

 if lBoton
   @  2.8,  18  BUTTON oBtn PROMPT "&Cancel" OF oDlg ;
      ACTION ( lEnd:= .t., lCancel:= .t. ) SIZE 32, 11
 endif

   // This block gets evaluated only the first time the DialogBox is painted !!!
   oDlg:bStart = { || Eval( bAction, oMeter, oText, oDlg, @lEnd, oBtn ),;
                      lEnd := .t., oDlg:End() }

   ACTIVATE DIALOG oDlg CENTERED ;
      VALID lEnd

return lCancel

Saludos.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Disabling button in MsgMeter()
Posted: Tue Dec 03, 2013 07:14 AM

Francisco:

Thank you very much ! ¡ Muchas gracias !

Continue the discussion