ddsFileBrowseCB
ddsFileBrowseCB(g_form s_targetName[t_filter][s_mode][t_caption]) =>t/ nil
Description
Creates a file browser dialog for specifying file names through browsing.
The given name will be pasted into the target string field upon clicking the OK or Apply button. The dialog can filter files when first displayed. To navigate up or down in the directory structure, either double-click a directory name, or select it and click OK or Apply. The mode option allows checking for existing files.
Arguments
Value Returned
Examples
This example creates a Browse button to open an ASCII Technology file.
;; target file name field
tcAsciiTFStr = hiCreateStringField(
?name 'tcAsciiTFStr
?prompt "ASCII Technology File"
?value ""
)
;; Browse button for selecting an existing file
tcOpenBrowserBtn = hiCreateFormButton(
?name 'tcOpenBrowserBtn
?buttonText "Browse..."
?callback "ddsFileBrowseCB( hiGetCurrentForm()
'tcAsciiTFStr \"*.tf\" 'existingFile )" ;open
)
This example creates a browse button for selecting a library. The browse button is placed in a HI Tab field. The eval function has been used to seed the proper argument for ddsSyncWithForm.
libBrowseBtn = hiCreateFormButton(
?name 'libBrowseBtn
?buttonText "Browse..."
?callback "ddsSyncWithForm(eval(browseForm->tabs->page1) 'libname 'libname)"
)
; Create a browse button for selecting a file. This browse button is placed in a HI Tab field.
field2 = hiCreateStringField( ?name 'filename ?prompt "File Name")
fileBrowseBtn = hiCreateFormButton(
?name 'fileBrowseBtn
?buttonText "Browse..."
?callback "ddsFileBrowseCB(browseForm->tabs->page1 'filename)"
)
; Create a HI Tab field where the previous browse fields are placed within it.
tabs = hiCreateTabField(
?name 'tabs
?notebookStyle 'nil
?tabPlacement 'top
?tabs list("TEST")
?value 1
?fields list( list(
list(field1 0:0 200:0 100)
list(libBrowseBtn 210:0 80:30)
list(field2 0:40 200:0 100)
list(fileBrowseBtn 210:40 80:30))
)
)
hiCreateAppForm(
?name 'browseForm
?formTitle "Example Form"
?callback ""
?dontBlock t
?fields list(list(tabs 0:0 300:100))
)
Related Topics
ddsSyncWithForm
Return to top