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