BBjFileChooser
Description
In BBj 7.00 and higher, the BBjFileChooser object provides methods for manipulating a GUI file chooser control, similar to the FILEOPEN Mnemonic or FILEOPEN() Function.
Implemented Interfaces
DragSource, DropTarget, Focusable, TabTraversable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjFileChooser
A BBjFileChooser object is created through the following BBjWindow methods:
Return Value |
Method |
---|---|
BBjFileChooser |
addFileChooser(int ID, number x, number y, number w, number h, string directory) |
BBjFileChooser |
addFileChooser(int ID, number x, number y, number w, number h, string directory, string flags) |
BBjFileChooser | addFileChooser(int ID, string directory) |
BBjFileChooser | addFileChooser(int ID, string directory, String flags) |
BBjFileChooser | addFileChooser(string directory) |
BBjFileChooser |
addFileChooser(string directory, String flags) |
Methods of BBjFileChooser
Return Value |
Method |
---|---|
void |
addFileFilter(string name, BBjVector filters!) |
void |
addFileFilter(string name, string filter) |
void |
|
void |
|
void |
|
void |
ensureFileNameIsVisible(string name) |
string |
|
string |
|
string | getCancelButtonText() |
boolean |
|
string |
|
boolean |
|
getFileFilterContents(string name) |
|
int |
|
string |
|
string |
|
boolean |
|
boolean |
|
boolean |
|
void |
removeFileFilter(string name) |
void |
|
void |
setAcceptAllFileFilterUsed(boolean used) |
void |
setActiveFileFilter(string name) |
void |
setApproveButtonText(string text) |
void | setCancelButtonText(string text) |
void |
setControlButtonsAreShown(boolean shown) |
void |
setCurrentDirectory(string name) |
void |
setDropZoneVisible(boolean visible) |
void |
setFileSelectionMode(int mode) |
void |
setMultiSelectionEnabled(boolean enabled) |
void |
setNewFolderEnabled(boolean enabled) |
void |
setRestrictedDirectory(string directory) |
void |
setSelectedFile(string file) |
void |
setSelectedFiles(BBjVector files!) |
void | setView(boolean detail, int column, int order) |
Methods of BBjFileChooser implemented for DragSource
Return Value | Method |
---|---|
int | getDragActions() |
string | getDragType() |
void | setDragActions(int actions) |
void | setDragType(string type) |
Methods of BBjFileChooser implemented for DropTarget
Return Value | Method |
---|---|
int | getDropActions() |
void | setDropActions(int actions) |
BBjVector | getDropTypes() |
void | setDropTypes(BBjVector types) |
Methods of BBjFileChooser implemented for Focusable
Return Value | Method |
---|---|
boolean | isFocusable() |
void | setFocusable(boolean focus) |
Methods of BBjFileChooser implemented for TabTraversable
Return Value | Method |
---|---|
boolean | isTabTraversable() |
void | setTabTraversable(boolean trav) |
Methods of BBjFileChooser inherited from BBjControl
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
---|---|---|---|
ON_DROP_TARGET_DROP |
D |
||
ON_FILECHOOSER_APPROVE |
x |
||
ON_FILECHOOSER_CANCEL |
x |
||
ON_FILECHOOSER_CHANGE |
x |
||
ON_FILECHOOSER_FILTER |
x |
||
ON_GAINED_FOCUS |
f |
||
ON_LOST_FOCUS |
f |
||
ON_MOUSE_ENTER |
E |
||
ON_MOUSE_EXIT |
E |
||
ON_POPUP_REQUEST |
r |
||
ON_RIGHT_MOUSE_DOWN |
R |
CSS
The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.
The BUI BBjFileChooser is really several different kinds of control, depending on the selected version: Open or save a client file, open or save a server file, or select a server directory. See Interacting with client files in BUI and DWC for a detailed discussion of the BUI client-side file choosers. The BBjFileChooser defines the following CSS style names:
.BBjChooser
.BBjFileChooser
.BBjFileChooser.bbj-client
.BBjFileChooser.bbj-directories
.BBjFileChooser.bbj-disabled
.BBjFileChooser.bbj-focused
.BBjFileChooser .bbj-selected (note the space between .BBjFileChooser and .bbj-selected)
.BBjFileChooser.bbj-server
.BBjChooser-button-panel
.BBjChooser-button
.BBjChooser-approveButton
.BBjChooser-cancelButton
Individual components of the .BBjFileChooser.bbj-client dialog:
.BBjFileChooser-chooseClientFileLabel
.BBjFileChooser-chooseClientFile
.BBjFileChooser-fileTypeLabel
.BBjFileChooser-fileTypeList
.BBjFileChooser-uploadProgressBar
.BBjFileChooser-uploadStatusMessage
.BBjFileChooser-dropzone
Individual components of the .BBjFileChooser.bbj-server dialog:
.BBjFileChooser-directoryList
.BBjFileChooser-directoryUpButton
.BBjFileChooser-directoryDownButton
.BBjFileChooser-summaryViewButton
.BBjFileChooser-detailViewButton
.BBjFileChooser-fileGridPanel
.BBjFileChooser-detailFileGrid
.BBjFileChooser-summaryFileGrid
.BBjFileChooser-fileNameLabel
.BBjFileChooser-fileName
.BBjFileChooser-fileTypeLabel
.BBjFileChooser-fileTypeList
Individual components of the .BBjFileChooser.bbj-directories dialog:
.BBjFileChooser-directoryTree
.BBjFileChooser-directoryTreeItem
The sample program can produce any of the different BBjFileChooser styles:
|
Remarks
The BBjFileChooser is a complex control provided as-is from a GUI control library. As such, the installed LookAndFeel determines much of its presentation and behavior, attempting to adhere to the platform expectations as much as possible. Developers should avoid depending on specific functionality in the choosers.
Also, when using a filechooser connected to the server filesystem, the remote representation of the filesystem may not support all of the functionality available from the displayed filechooser.
Constants of BBjFileChooser
File Selection Mode Constants: | |
| FILES_ONLY |
| FILES_AND_DIRECTORIES |
| DIRECTORIES_ONLY |
Constants inherited from BBjControl
Example
|
See Also
CALLBACK Verb - Register BBj Subroutine
DWC Components: dwc-file-save, dwc-file-chooser, and dwc-upload
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.