FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Residual process [ SOLVED ]
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Residual process [ SOLVED ]
Posted: Thu Sep 11, 2014 06:12 PM
After many months looking for an error in my system I found this in a log file that traces the actions made by the user:
In some few moments the user used an action triggered by a button in a dialog before the function defined in the "On Init" end

I don't know how to simulate but I think that a MsgRun() in the On Init Clause should help because of the change of focus to a modal dialog that will prevent the user to activate the button.

Code (fw): Select all Collapse
//-- The dialog
oDlgVenda = TDialog():New(,,,,, cResource,, .F.,,,,, oWnd, .F.,,,,,, .F. )

//-- The button pressed 
oBtnPre := TButtonBmp():ReDefine( 206, {||TransVenda("P")}, oDlgVenda,,, .F., {|| HabPreOrc("P")},, "Pre-venda->Venda"+Chr(13)+Chr(10)+"F&7", .F., "Prevenda"+cTam, Upper("TEXTRIGHT"), )

//-- Dialog Activate
//-- PPO
//oDlgVenda:Activate( oDlgVenda:bLClicked, oDlgVenda:bMoved, oDlgVenda:bPainted, .T., {|Self|( cSairVda .AND. !lTravaSaida )},, {|Self|NovaVenda(.T.)}, oDlgVenda:bRClicked,, )

//-- PRG
  Activate Dialog oDlgVenda CENTERED On Init NovaVenda(.t.) valid ( cSairVda .And. !lTravaSaida )

//-- Workaround
  Activate Dialog oDlgVenda CENTERED On Init MsgRun("Inicializando a tela de vendas","Aguarde",{||NovaVenda(.t.)}) valid ( cSairVda .And. !lTravaSaida )
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Residual process
Posted: Fri Sep 12, 2014 05:18 AM

Samir,

I don't understand what you need. Could you post some screenshots ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Residual process
Posted: Fri Sep 12, 2014 09:52 AM

Sambomb

You should disabled previous controls to run proccess.

In general cases

Solution 1)
// 1st. To disable dialog or all dialogs

Process

// 3rd. To enable dialog

Solution 2)
To capture mouse pointer

In you particular case

Set bWhen data of button to {|| !lRunningProccess }

Regards

Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Residual process
Posted: Fri Sep 12, 2014 11:37 AM
Antonio Linares wrote:Samir,

I don't understand what you need. Could you post some screenshots ? thanks


Antonio, I don't have any screenshots and neither can repeat what happened in my client.

I wanna know if this is possible and how can I force this type of error.

[hmpaquito]
I know how to build a workaround to this problem, but first I need to force this to check the before and after.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: Residual process
Posted: Fri Sep 12, 2014 08:05 PM
I found!
The problem is in the bKeyDown.
I can press a button ( F7 ) before the dialog appear for the user ( while the On init is running )

Solved setting the bKeyDown after the On Init function

Code (fw): Select all Collapse
   //oDlgVenda:bKeyDown  :={| nKey | KeyDownVenda(nKey) } 
   bKeyDownTelaVenda :=  {| nKey | KeyDownVenda(nKey) } 

   //Activate Dialog oDlgVenda CENTERED On Init NovaVenda(.t.) valid ( cSairVda .And. !lTravaSaida )
   Activate Dialog oDlgVenda CENTERED On Init MsgRun("Inicializando a tela de vendas","Aguarde",{||NovaVenda(.t.),(oDlgVenda:bKeyDown := bKeyDownTelaVenda) }) valid ( cSairVda .And. !lTravaSaida )
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2

Continue the discussion