FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Why xBrowse => oLbx:bChange is evaluated twice ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Why xBrowse => oLbx:bChange is evaluated twice ?
Posted: Mon Nov 24, 2008 04: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.

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 :-)
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.
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
Why xBrowse => oLbx:bChange is evaluated twice ?
Posted: Mon Nov 24, 2008 10:25 PM
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
oLbx:bchange evulated twice.
Posted: 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.

Continue the discussion