Why xBrowse => oLbx:bChange is evaluated twice ?

Why xBrowse => oLbx:bChange is evaluated twice ?

Postby ukoenig » Mon Nov 24, 2008 4:52 pm

Hello,
I added oLbx:bChange to start a action.
If a format is not supported using FREEMAGE.dll,
I want to open the image with xNVIEW.
It works, but the xNVIEW-Viewer runs twice.

Code: Select all  Expand view

A test :

This doesn't work ( evaluates the message twice ) !!!
oLbx:bChange   := { || MsgAlert( "Show Run" ) }

This is OK ( works only once ) !!!
oLbx:bLClicked := { | nRow, nCol | MsgAlert( "Show Run" ) }

What is the difference ?
I need a action also without clicking inside the browser ( using keyboard ).

----- the original source testing a value and run a application -------------

oLbx:bChange   := { || DLG_GET(), ;
   lOpen := .F., ;  // it doesn't help !!!
   cXNVIEW1 := cXNVIEW + " " + c_Path + "\" + ALLTRIM(cSUBDIR) + cIMAGE, ;
   MOVE1 := 0.0, ;
   oSlider1:Set(MOVE1), ;
   oSlider1:Refresh(), ;
   oFolder:aDialogs[1]:Update(), ; // Folder-Update
   oBMP10:Refresh(), ; // The preview is empty, because format is not supported.
   nWIDTH1 := nWIDTH, ;
   nHEIGHT1 := nHEIGHT, ;
   oDlg3:Update(), ;  // Main-Dialog-Update
   msgalert( lOpen ), ;  // This is allways .F. because runs twice !!!
   IIF( (1)->dFWH = .F. .and. lOpen = .F., ; // doesn't help
      ( WINEXEC ("&cXNVIEW1"), lOpen := .T.), NIL ) } // added .T., to run only once.

//-------- A test with a part from sample : Testxbrw5.prg ----------------//

STATIC FUNCTION BasicRow( oWnd )
local oChild, oBrw

DEFINE WINDOW oChild TITLE "Basic Row selector browse" MDICHILD OF oWnd

oBrw := TXBrowse():New( oWnd )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW

oBrw:SetRDD()
oBrw:CreateFromCode()

oChild:oClient := oBrw

// Is evulated twice !!!
oBrw:bChange := {|| msgalert( "Count run" ) }

ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()

RETURN NIL



It seems, after changing the position inside the browser,
oLbx:bChange is evaluated twice.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby demont frank » Mon Nov 24, 2008 10:25 pm

demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

oLbx:bchange evulated twice.

Postby ukoenig » Mon Nov 24, 2008 10:32 pm

Hello Frank,

thank You very much.
It seems, the problem is not solved with my version FWH 8.09.
Is it solved in Version FWH 8.10 ?
You tested with wBrowse, xBrowse is the same problem.

I removed the ::Change( .t. ) at line 2669
It works fine now.
I hope, because of removing this line something else goes wrong.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests