From: Alain A. <ala...@wa...> - 2016-10-11 09:27:35
|
Le 11/10/2016 à 10:44, Alexander S.Kresin a écrit : > When exactly do you call that function, combo_manage() ? When the current item of oScripts changes, in ON CHANGE Some scripts need the use of a parameter which may be choose in oFolders combobox Some not So I want to change the visibility depending of the needings of the current script in oScripts Here is an hard-copy of the window: https://www.dropbox.com/s/9uh292mulgpx4a3/R%C3%A9pertoire%20distant.png?dl=1 and here are is the part of the source the commented lines are the one I want ----------------------------------------------------------------------------------------------- // SET TIMER oTm2 VALUE 100 ACTION {||oFolders:hide()} //ONCE ACTIVATE WINDOW oMainWindow oIcon := HIcon():Addfile( cImageDir+"nohup.png" ) INIT DIALOG oModDlg TITLE "Répertoire distant" ; AT oMainWindow:nLeft+140,oMainWindow:nTop+130 SIZE 340,250 ; FONT oFont ICON oIcon @ 10,10 SAY "Donnez la commande à lancer en nohup" SIZE 320, 22 COLOR hwg_ColorC2N("FF0000") @ 10,34 GET oName VAR dscript SIZE 320, 26 @ 10,72 SAY "Choissez du script à lancer en nohup" SIZE 320, 22 COLOR hwg_ColorC2N("FF0000") @ 10,96 GET COMBOBOX oScript VAR rScript ITEMS aScripts STYLE WS_TABSTOP SIZE 320, 25; TOOLTIP "Choix d'un script distant"; ON CHANGE {||dscript:=rScript,oName:Refresh(),oFolders:show()}; TEXT // ON CHANGE {||dscript:=rScript,oName:Refresh(),combo_manage(rScript)}; @ 10,136 SAY "Donnez le paramètre du script à lancer en nohup" SIZE 320, 22 COLOR hwg_ColorC2N("FF0000") @ 10,160 GET COMBOBOX oFolders VAR rFolders ITEMS aFolders STYLE WS_TABSTOP SIZE 320, 25; TOOLTIP "Choix d'un dossier distant"; ON CHANGE {||dScript:=dscript+" "+trim(rFolders),oName:Refresh()}; TEXT // ON CHANGE {||oName:=oName+" "+trim(rFolders),oName:Refresh()}; @ 60,208 BUTTON "Ok" OF oModDlg ID IDOK ; SIZE 100, 32 COLOR hwg_ColorC2N("FF0000") ; ON CLICK {||oModDlg:lResult:=.t.} @ 180,208 BUTTON "Annuler" OF oModDlg ID IDCANCEL ; SIZE 100, 32 ACTIVATE DIALOG oModDlg ... // ================================================================ Function combo_manage(rScript) // ================================================================ local rg for rg=1 to len(aScripts) if trim(rScript)==aScripts[rg,1] qout(trim(rScript)) qout(aScripts[rg,4]) if aScripts[rg,4] SET TIMER oTm2 VALUE 100 ACTION oModDlg:oFolders:show() else SET TIMER oTm2 VALUE 100 ACTION oModDlg:oFolders:hide() endif exit endif next return nil ----------------------------------------------------------------------------------------------- Thanks A+ -- ------------------------------------------------------------------------ Alain Aupeix http://jujuland.pagesperso-orange.fr/ http://pissobi-lacassagne.pagesperso-orange.fr/ ------------------------------------------------------------------------ U.buntu 12.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev (2016-10-04 13:22) | Hw.Gui 2.19-6 (2619) ------------------------------------------------------------------------ |