From: Alexander S.K. <al...@be...> - 2016-10-13 10:22:45
|
Alain Aupeix пишет: > > But I found a better way to do it > > Just add a line like this after the object to hide: > > @ 10,230 SAY "" SIZE 1,1 ON INIT {||oFolders:hide()} > The better is: @ 10,160 GET COMBOBOX oFolders ... ON INIT {|o|o:Hide()} > It displays nothing (what I want) The following, modified a bit for better understanding, works normally: #include "hwgui.ch" Static oModDlg, aScripts := { "one","two","three","four" } Function Main Local oName, oScript, rscript := 1, dscript Local oFolders, aFolders := { "aa","bb" }, rfolders := 1 INIT DIALOG oModDlg TITLE "Repertoire distant" ; AT 0,0 SIZE 340,250 @ 10,10 SAY "Donnez la commande a 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 a 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(),combo_manage(rScript)} TEXT @ 10,136 SAY "Donnez le parametre du script a 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()} ; ON INIT {|o|o:Hide()} TEXT @ 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 Return Nil Function combo_manage(rScript) if rscript == "two".or. rscript == "four" oModDlg:oFolders:show() else oModDlg:oFolders:hide() endif return nil Regards, Alexander. |