Msq..se repete 2 vezes ....

Msq..se repete 2 vezes ....

Postby Ale SB » Wed Jan 30, 2008 5:34 pm

Este codigo..funciona perfect com FwH2.6...ja com FwH712, as msg..se repete 2 vezes antes de sair.

Code: Select all  Expand view  RUN
#include "FiveWin.ch"

static oWnd

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

function Main()

   local oBar

   SET _3DLOOK ON

   DEFINE WINDOW oWnd TITLE "MDIChilds from resources" MDI

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar ACTION child() //( Child(), MsgInfo( oWnd:oWndClient:aWnd[ 1 ]:cCaption ) )

   ACTIVATE WINDOW oWnd maximized

return nil

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

function Child()

   local oWndChild, oDlg, oBtn, n
   local cName := "Testing..."

   DEFINE WINDOW oWndChild MDICHILD OF oWnd ;
      FROM 5,5 TO 6,6;
      COLOR "N/W"

   oWndChild:bGotFocus  = { || oDlg:SetFocus() }

   DEFINE DIALOG oDlg RESOURCE "Child1" OF oWndChild

   REDEFINE GET cName ID 110 OF oDlg

   REDEFINE BUTTON oBtn ID 120 OF oDlg ;
      ACTION ( MsgInfo( "First" ), oBtn:SetFocus() )


   REDEFINE BUTTON ID 130 OF oDlg ACTION MsgInfo( "Second" )

   for n = 1 to Len( oDlg:aControls )
      oDlg:aControls[ n ]:bLClicked = GenBlock( oWndChild, oDlg:aControls[ n ] )
   next    
      
   ACTIVATE DIALOG oDlg NOWAIT ;  // It has to be NonModal --> NOWAIT clause
      ON INIT oDlg:Move( 0, 0 ) ;
        valid ( if(Salir(),;
                  (Eval( {|| oWndChild:End(), .T. }), .t. ),;
                  (.f.) ))

   // Correct window size to match dialog
   oWndChild:nWidth := oDlg:nWidth+7
   oWndChild:nHeight := oDlg:nHeight+32

   ACTIVATE WINDOW oWndChild ON INIT oWnd:paint()

return nil

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

function GenBlock( oWndChild, oControl )

return { || oWndChild:SetFocus(), oControl:SetFocus() }
   
//----------------------------------------------------------------------------//
Static Function Salir()
   Local iRet:= .f.

   iRet:= MsgYesNo("Abandona la opcion ?","Cerrar de Ventas")

RETURN iRet


Sendo q esta msg..deve aparecer una unica vez...

Es algum Bug, FwH712 ?

Saluds
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
Ale SB
 
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Postby Antonio Linares » Wed Jan 30, 2008 9:11 pm

Ale,

Cual de los MsgInfo() ? ó es el MsgYesNo() ?

Puedes proporcionar el RC usado ? gracias
regards, saludos

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

Postby Ale SB » Wed Jan 30, 2008 9:48 pm

El msgYesNo()

.RC
Code: Select all  Expand view  RUN
child1 DIALOG 18, 18, 317, 189
STYLE WS_CHILD
{
CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 7, 5, 107, 50
EDITTEXT 110, 15, 10, 93, 12, ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP
PUSHBUTTON "Text", 120, 32, 35, 24, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Text", 130, 67, 35, 24, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 7, 59, 108, 20
LTEXT "This is a resource !!!", -1, 25, 65, 68, 8
CONTROL "Text", 111, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 14, 85, 28, 12
}
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
Ale SB
 
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Postby Antonio Linares » Thu Jan 31, 2008 9:58 am

Ale,

Hazlo así:
Code: Select all  Expand view  RUN
   ACTIVATE DIALOG oDlg NOWAIT ;  // It has to be NonModal --> NOWAIT clause
      ON INIT oDlg:Move( 0, 0 ) ;
      VALID .F.
...
   ACTIVATE WINDOW oWndChild ON INIT oWnd:paint() ;
      VALID Salir()
regards, saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests