File selector dialog class. More...
#include <ilviews/gadgets/filechoo.h>
Public Member Functions | |
IlvFileChooser (IlvDisplay *display, const char *dir=0, const char *title=0, IlvFileChooserOptions *options=0, IlvSystemView transientFor=0, IlUInt properties=0) | |
Constructor. More... | |
virtual void | addFileInListMode (const IlPathName &file, IlvPathGadgetItem *item) |
Adds an item to the sheet in List mode. More... | |
virtual void | addFileInMatrixMode (const IlPathName &file, IlvPathGadgetItem *item) |
Adds an item to the sheet in Matrix mode. More... | |
virtual void | addFileToSheet (const IlPathName &file) |
Adds an item to the sheet. More... | |
virtual void | adjustSheetForMatrixMode () |
Updates the sheet when the dialog is resized. More... | |
virtual void | changePath (const IlPathName &path) |
Called when the user selects a new path. More... | |
virtual void | convertSizeToLabel (IlUInt size, IlString &label) const |
Converts a file size to a string. More... | |
virtual IlvButton * | createApplyButton (const IlvRect &rect, const IlString &label) const |
Creates a dialog Apply button. More... | |
virtual IlvButton * | createCancelButton (const IlvRect &rect, const IlString &label) const |
Creates a dialog Cancel button. More... | |
virtual IlvButton * | createCreateButton (const IlvRect &rect) const |
Creates a Create directory dialog button. More... | |
virtual IlvTreePathGadgetItem * | createDeviceItem (const IlPathName &filepath, IlInt genre) const |
Creates a tree gadget item for a device. More... | |
virtual void | createDirectoryButtonClicked () |
Called when the Create directory button has been clicked. More... | |
virtual IlvComboBox * | createFilterComboBox (const IlvRect &rect) const |
Creates a dialog combobox. More... | |
virtual IlvButton * | createHiddenButton (const IlvRect &rect) const |
Creates a Hide hidden files dialog button. More... | |
virtual IlvButton * | createListButton (const IlvRect &rect) const |
Creates a List mode dialog button. More... | |
virtual IlvButton * | createMatrixButton (const IlvRect &rect) const |
Creates a Matrix mode dialog button. More... | |
virtual IlvMessageLabel * | createMsgLabel (const IlvRect &rect, const IlString &label) const |
Creates a dialog message label. More... | |
virtual IlvFileChooserSheet * | createSheet (const IlvRect &rect) const |
Creates a dialog sheet. More... | |
virtual IlvPathGadgetItem * | createSheetItem (const IlPathName &filepath, IlvFileChooserDisplayMode mode) const |
Creates a gadget item for the sheet. More... | |
virtual IlvButton * | createShowAllButton (const IlvRect &rect) const |
Creates a Show all files dialog button. More... | |
virtual IlvTextField * | createTextField (const IlvRect &rect) const |
Creates a dialog textfield. More... | |
virtual IlvToolBarPath * | createToolBar (const IlvRect &rect) const |
Creates a dialog toolbar. More... | |
virtual IlvFileChooserTree * | createTreeGadget (const IlvRect &rect) const |
Creates a dialog tree gadget. More... | |
virtual IlvTreePathGadgetItem * | createTreeItem (const IlPathName &path) const |
Creates a tree gadget item for a directory. More... | |
virtual IlvButton * | createUpButton (const IlvRect &rect) const |
Creates an Up directory dialog button. More... | |
virtual IlvTreePathGadgetItem * | fillTree (IlPathName &path, IlvTreePathGadgetItem *parent, IlPathName *ref=0) |
Expands a directory of the tree gadget. More... | |
virtual void | filterChanged () |
Called when the filter has changed. More... | |
IlInt | get (IlBoolean grab=IlFalse, IlvCursor *cursor=0) |
Displays the dialog as a modal dialog. More... | |
IlvButton * | getApplyButton () const |
Returns the filechooser dialog's apply button. More... | |
IlvButton * | getCreateButton () const |
Returns the Create directory dialog button. More... | |
IlvComboBox * | getFilterComboBox () const |
Returns the dialog combobox. More... | |
virtual const IlString & | getFilterExtension () const |
Returns the current filter extension. More... | |
IlvButton * | getListButton () const |
Returns the List mode dialog button. More... | |
IlvButton * | getMatrixButton () const |
Returns the Matrix mode dialog button. More... | |
virtual IlBoolean | getNewDirectoryName (IlString &name) |
Called when the user has clicked the Create directory button. More... | |
IlvFileChooserOptions * | getOptions () const |
Returns the object which describes the dialog. More... | |
const IlString & | getResult (IlInt index=0) const |
Returns a selected path name. More... | |
IlInt | getResultCount () const |
Returns the result count. More... | |
IlvFileChooserSheet * | getSheet () const |
Returns the dialog sheet. More... | |
IlvFileChooserDisplayMode | getSheetMode () const |
Returns the display mode of the sheet. More... | |
IlvButton * | getShowAllButton () const |
Returns the Show all files dialog button. More... | |
IlvTextField * | getTextField () const |
Returns the dialog textfield. More... | |
IlvToolBarPath * | getToolBar () const |
Returns the dialog toolbar. More... | |
IlvFileChooserTree * | getTreeGadget () const |
Returns the dialog tree gadget. More... | |
IlvButton * | getUpButton () const |
Returns the Up directory dialog button. More... | |
virtual void | handleSheetDoubleClick (IlvEvent &evt) |
Handles double-clicking in the sheet. More... | |
virtual void | initSheet () |
Initializes the sheet. More... | |
virtual void | initSheetForListMode () |
Initializes the sheet for List mode. More... | |
virtual void | initSheetForMatrixMode () |
Initializes the sheet for Matrix mode. More... | |
virtual void | listModeButtonClicked () |
Called when the List mode button has been clicked. More... | |
virtual void | matrixModeButtonClicked () |
Called when the Matrix mode button has been clicked. More... | |
virtual void | newShowAllMode (IlBoolean show) |
Changes the status of the Show files buttons. More... | |
virtual void | processApply () |
Called when the Apply button has been clicked. More... | |
virtual void | refreshSheet () |
Updates the sheet with the current path. More... | |
virtual void | rewindPath (const IlPathName &path) |
Called when the user selects a directory of the path. More... | |
virtual void | selectionChanged () |
Called when the sheet selection has been changed. More... | |
void | setCurrentPath (const IlPathName &path) |
Sets the current path. More... | |
void | setFilterExtension (const IlString &ext) |
Sets the current filter extension. More... | |
void | setSortMode (IlPathName::SortMode mode) |
Sets the sort method for entries in the sheet. More... | |
virtual void | setTreePath (const IlPathName &path) |
Sets the path of the tree gadget. More... | |
virtual void | updateApplyButton (const IlPathName &path) |
Updates the apply button. More... | |
virtual void | updateDisplayButtons () |
Updates the status of the display mode buttons. More... | |
virtual void | updateSheet (IlPathName &path) |
Updates the sheet for a path. More... | |
virtual void | updateShowAllButton () |
Updates the status of the Show files buttons. More... | |
virtual void | updateToolBar (IlPathName &path) |
Updates the toolbar. More... | |
virtual void | updateTree (IlPathName &path, IlvTreePathGadgetItem *item) |
Updates a part of the tree gadget. More... | |
virtual void | upDirectoryButtonClicked () |
Called when the Up directory button has been clicked. More... | |
Public Member Functions inherited from IlvDialog | |
IlvDialog (IlvDisplay *display, const char *name, const char *title, const char *filename, const IlvRect *rect=0) | |
Constructor. More... | |
IlvDialog (IlvDisplay *display, const char *name, const char *title, const char *filename, IlUInt properties, const IlvRect *rect=0, IlvSystemView transientFor=0) | |
Constructor. More... | |
IlvDialog (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlUInt properties=0, IlvSystemView transientFor=0) | |
Constructor. More... | |
virtual void | apply () |
Is called when the callback associated with the apply symbol is triggered. More... | |
virtual void | cancel () |
Is called when the callback associated with the cancel symbol is triggered. More... | |
virtual void | wait (IlBoolean grab=IlFalse, IlvCursor *cursor=0) |
Displays a modal dialog. More... | |
IlBoolean | wasCanceled () const |
Returns the status of the dialog after closing it. More... | |
Public Member Functions inherited from IlvGadgetContainer | |
IlvGadgetContainer (IlvAbstractView *parent, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, const char *cssElementName="IlvGadgetContainer") | |
Initializes a new instance of the IlvGadgetContainer class as a child view of another view. More... | |
IlvGadgetContainer (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, const char *cssElementName="IlvGadgetContainer") | |
Initializes a new instance of the IlvGadgetContainer class as a top view. More... | |
IlvGadgetContainer (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlUInt properties, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, IlvSystemView transientFor=0, const char *cssElementName="IlvGadgetContainer") | |
Initializes a new instance of the IlvGadgetContainer class as a top view. More... | |
IlvGadgetContainer (IlvDisplay *display, IlvSystemView parent, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, const char *cssElementName="IlvGadgetContainer") | |
Initializes a new instance of the IlvGadgetContainer class as a child view of a system view. More... | |
IlvGadgetContainer (IlvDisplay *display, IlvSystemView window, IlBoolean useacc=IlFalse, const char *cssElementName="IlvGadgetContainer") | |
Initializes a new instance of the IlvGadgetContainer class using an existing system view. More... | |
virtual IlBoolean | allowFocus (IlBoolean value) |
Specifies whether the container manages the focus. More... | |
virtual void | applyResize (IlFloat sx, IlFloat sy, IlBoolean redraw=IlTrue) |
Is called to carry out the resize events applying to the gadget container. More... | |
IlBoolean | autoResize (IlBoolean a) |
Sets the auto resize mode of the gadget container. More... | |
IlvButton * | getDefaultButton () const |
Returns the default button of the gadget container. More... | |
virtual IlvGraphic * | getFirstFocusGraphic () const |
Returns the first object that receives the focus in this container. More... | |
virtual IlvGraphic * | getFocus () const |
Returns the object that has the keyboard focus in the gadget container. More... | |
virtual IlvGraphic * | getGrab () const |
Returns the object that is currently grabbing events in the container. More... | |
virtual IlvGraphic * | getLastFocusGraphic () const |
Returns the last object that receives the focus in this container. More... | |
virtual IlvLookFeelHandler * | getLookFeelHandler () const |
Returns the look and feel handler associated with this container. More... | |
virtual IlvGraphic * | getNextFocusGraphic (IlvGraphic *object) const |
Returns the next object that will receive the focus after the specified object. More... | |
IlvGraphic * | getOverriddenFocus () const |
Returns the object that will receive the focus after calling setFocus() . More... | |
virtual IlvGraphic * | getPreviousFocusGraphic (IlvGraphic *object) const |
Returns the previous object that received the focus before the specified object. More... | |
IlBoolean | isAutoResizing () const |
Indicates whether the gadget container gets resized when loading a file. More... | |
virtual IlBoolean | isFocusAllowed () const |
Indicates whether the focus is allowed in the container. More... | |
virtual void | moveFocusAfter (IlBoolean redraw=IlTrue) |
Is called to find the next focusable object. More... | |
virtual void | moveFocusBefore (IlBoolean redraw=IlTrue) |
Is called to find the previous focusable object. More... | |
void | overrideFocus (IlvGraphic *obj) |
Sets the object that will receive the focus after calling setFocus() . More... | |
virtual void | removeGrab () |
Cancels the grabbing settings defined with setGrab() . More... | |
void | setDefaultButton (IlvButton *button, IlBoolean redraw=IlTrue) |
Sets the default button of the gadget container. More... | |
virtual void | setFocus (IlvGraphic *graphic=0, IlBoolean redraw=IlTrue) |
Sets the focus to the specified object of the gadget container. More... | |
virtual void | setGrab (IlvGraphic *object) |
Sets the specified object as the grabbing object. More... | |
virtual void | setLookFeelHandler (IlvLookFeelHandler *lfh) |
Sets the look and feel handler of this container. More... | |
File selector dialog class.
Library: ilvadvgdt
The IlvFileChooser
class enables you to browse through a directory hierarchy and select a file name or directory. To modify this dialog, create an IlvFileChooserOptions
object with the options you wish to change.
PNG
bitmaps. If you plan to statically link an application that uses IlvFileChooser
, you will have to explicitly include the header file <ilviews/bitmaps/png.h>
in one of your application source file and add the ilvpng
library to your link command.IlvDialog
, IlvFileChooserOptions
. IlvFileChooser::IlvFileChooser | ( | IlvDisplay * | display, |
const char * | dir = 0 , |
||
const char * | title = 0 , |
||
IlvFileChooserOptions * | options = 0 , |
||
IlvSystemView | transientFor = 0 , |
||
IlUInt | properties = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvIFileChooser
class.
display | The connection to the display. |
dir | The initial directory that will be scanned. |
title | The dialog title. If the value is null then the title from the IlvFileChooserOptions object is used. |
options | The object which defines the look and behaviour of the dialog. |
transientFor | The system view for which the dialog is transient. |
properties | The view properties, as defined in IlvView class. |
IlvView
constructors.
|
virtual |
Adds an item to the sheet in List mode.
Adds a file or directory to the sheet in List mode.
file | The full path for a file or a directory. |
item | The gadget item associated with the file or directory. |
|
virtual |
Adds an item to the sheet in Matrix mode.
Adds a file or directory to the sheet in Matrix mode.
file | The full path for a file or a directory. |
item | The gadget item associated with the file or directory. |
|
virtual |
Adds an item to the sheet.
Adds a file or directory to the sheet. This method creates a gadget item before calling the addFileInMatrixMode()
or addFileInListMode()
method to add it.
file | The full path for a file or a directory. |
|
virtual |
Updates the sheet when the dialog is resized.
Updates the sheet when the dialog is resized. It is not necessary to call this method if the display mode is List mode as the number of columns does not change.
|
virtual |
Called when the user selects a new path.
Called when the user selects a new path from a pop-up menu on the toolbar.
path | The path which corresponds to the selection. |
Converts a file size to a string.
Converts a file size to a string.
size | The file size. |
label | The conversion result. |
|
virtual |
Creates a dialog Apply button.
Creates the Apply button.
rect | The bounding box of the button. |
label | The button label. |
|
virtual |
Creates a dialog Cancel button.
Creates the Cancel button.
rect | The bounding box of the button. |
label | The button label. |
Creates a Create directory dialog button.
Creates the Create directory button which is displayed at the right of the toolbar to display the current path.
rect | The bounding box of the button. |
|
virtual |
Creates a tree gadget item for a device.
Creates a tree gadget item for a device. This method is called only under Windows. A device has a name (a letter) and a type. Type can take one of the following values:
0
for Unknown 1
for Error 2
for Removable 3
for Fixed 4
for Network 5
for CDRom 6
for Ram disk filepath | The full path name of the device. |
genre | The device type. |
|
virtual |
Called when the Create directory button has been clicked.
Called when the Create directory button has been clicked.
|
virtual |
Creates a dialog combobox.
Creates the combobox which contains the filter list. If no filter is defined, this method is not called.
rect | The bounding box of the combobox. |
Creates a Hide hidden files dialog button.
Creates the Hide hidden files button which is displayed at the right of the toolbar to display the current path.
rect | The bounding box of the button. |
Creates a List mode dialog button.
Creates the List mode button which is displayed at the right of the toolbar to display the current path.
rect | The bounding box of the button. |
Creates a Matrix mode dialog button.
Creates the Matrix mode button which is displayed at the right of the toolbar to display the current path.
rect | The bounding box of the button. |
|
virtual |
Creates a dialog message label.
Creates a message label such as Filename or Filter.
rect | The bounding box of the message label. |
label | The text of the message label. |
|
virtual |
Creates a dialog sheet.
Creates the sheet which displays the directories and files of the current path.
rect | The bounding box of the sheet. |
|
virtual |
Creates a gadget item for the sheet.
Creates a gadget item for the list of directories and files.
filepath | The full path name of the directory or file. |
mode | The display mode of the sheet which can be List or Matrix mode. |
Creates a Show all files dialog button.
Creates the Show all files button which is displayed at the right of the toolbar to display the current path.
rect | The bounding box of the button. |
|
virtual |
Creates a dialog textfield.
Creates the textfield which contains the selection.
rect | The bounding box of the textfield. |
|
virtual |
Creates a dialog toolbar.
Creates the toolbar which displays the current path.
rect | The bounding box of the toolbar. |
|
virtual |
Creates a dialog tree gadget.
Creates the tree gadget which displays the directory tree.
rect | The bounding box of the tree gadget. |
|
virtual |
Creates a tree gadget item for a directory.
Creates a tree gadget item for a directory.
path | The full path name of the directory. |
Creates an Up directory dialog button.
Creates the Up directory button which is displayed at the right of the toolbar to display the current path.
rect | The bounding box of the button. |
|
virtual |
Expands a directory of the tree gadget.
Expands a directory of the tree gadget.
path | The full path of the directory. |
parent | The tree gadget item associated with the path. |
ref | The current path of the dialog. |
null
.
|
virtual |
Called when the filter has changed.
Called when the user selects a new filter in the filter combobox.
Displays the dialog as a modal dialog.
grab | Specifies whether the dialog should be system modal. A system modal dialog grabs input events occurring on the entire system so that other applications cannot get any keyboard or mouse events until the member function returns. You can specify the cursor to be displayed with the cursor parameter. If grab is set to IlFalse , the dialog is application modal. In this case, the application does not receive input events in other windows. This is the default value. |
cursor | The cursor used to make the selection. |
getResult()
, getResultCount()
. IlvButton* IlvFileChooser::getApplyButton | ( | ) | const |
Returns the filechooser dialog's apply button.
IlvButton* IlvFileChooser::getCreateButton | ( | ) | const |
Returns the Create directory dialog button.
0
if the button is not visible. IlvComboBox* IlvFileChooser::getFilterComboBox | ( | ) | const |
Returns the dialog combobox.
|
virtual |
Returns the current filter extension.
IlvButton* IlvFileChooser::getListButton | ( | ) | const |
Returns the List mode dialog button.
0
if the button is not visible. IlvButton* IlvFileChooser::getMatrixButton | ( | ) | const |
Returns the Matrix mode dialog button.
0
if the button is not visible. Called when the user has clicked the Create directory button.
Called when the user has clicked the Create directory button. By default this method creates a dialog to ask for a directory name. This directory name is not checked.
name | The name of the new directory. |
IlTrue
if the user clicked the Apply button and name is not empty. IlvFileChooserOptions* IlvFileChooser::getOptions | ( | ) | const |
Returns the object which describes the dialog.
Returns a selected path name.
Returns a path name from the list of selected path names.
index | The index of the selected path name in the list. The index value starts at 0 . |
IlInt IlvFileChooser::getResultCount | ( | ) | const |
Returns the result count.
Returns the result count. A result is a selected path name. It can be a file or a directory.
IlvFileChooserSheet* IlvFileChooser::getSheet | ( | ) | const |
Returns the dialog sheet.
IlvFileChooserDisplayMode IlvFileChooser::getSheetMode | ( | ) | const |
Returns the display mode of the sheet.
IlvButton* IlvFileChooser::getShowAllButton | ( | ) | const |
Returns the Show all files dialog button.
0
if the button is not visible. IlvTextField* IlvFileChooser::getTextField | ( | ) | const |
Returns the dialog textfield.
IlvToolBarPath* IlvFileChooser::getToolBar | ( | ) | const |
Returns the dialog toolbar.
IlvFileChooserTree* IlvFileChooser::getTreeGadget | ( | ) | const |
Returns the dialog tree gadget.
IlvButton* IlvFileChooser::getUpButton | ( | ) | const |
Returns the Up directory dialog button.
0
if the button is not visible.
|
virtual |
Handles double-clicking in the sheet.
Handles double-clicking in the sheet. By default this method calls the processApply()
method. param evt The double-click event.
|
virtual |
Initializes the sheet.
Initializes the common features of the sheet before calling the initSheetForMatrixMode()
or initSheetForListMode()
methods to finalize.
|
virtual |
Initializes the sheet for List mode.
Initializes the sheet for List mode. In List mode, each matrix row is a file or a directory.
|
virtual |
Initializes the sheet for Matrix mode.
Initializes the sheet for Matrix mode. In Matrix mode, each matrix item is a file or directory.
|
virtual |
Called when the List mode button has been clicked.
Called when the List mode button has been clicked.
|
virtual |
Called when the Matrix mode button has been clicked.
Called when the Matrix mode button has been clicked.
|
virtual |
Changes the status of the Show files buttons.
Changes the status of the Show files buttons.
show | The Show all files button will be visible if the value is IlTrue , otherwise it will be hidden. The Hide hidden files button will be hidden if the value is IlTrue . |
|
virtual |
Called when the Apply button has been clicked.
Called when the Apply button has been clicked. If the dialog selection type is file only and the selection is a directory, the current path of the dialog is set to the selected directory. If the selection is a file, the result is built and the dialog is closed.
|
virtual |
Updates the sheet with the current path.
Updates the sheet data with the current path.
|
virtual |
Called when the user selects a directory of the path.
Called when the user selects a directory or the device of the current path of the toolbar.
path | The path which corresponds to the selection. |
|
virtual |
Called when the sheet selection has been changed.
Called when the sheet selection has been changed to update the textfield containing the user selection.
void IlvFileChooser::setCurrentPath | ( | const IlPathName & | path | ) |
Sets the current path.
Sets the current path. This method does not update the different gadgets of the dialog.
path | The new current path. |
void IlvFileChooser::setFilterExtension | ( | const IlString & | ext | ) |
Sets the current filter extension.
ext | The new filter extension. |
void IlvFileChooser::setSortMode | ( | IlPathName::SortMode | mode | ) |
Sets the sort method for entries in the sheet.
Specifies how file and directory names are sorted in the file chooser. The sort mode can be any combinaison of the values of the IlPathName::SortMode enumeration.
If IlPathName::GroupDirectories is specified, files are listed afted the directories.
mode | The sort method that must be used. |
|
virtual |
Sets the path of the tree gadget.
Removes all tree gadget items before rebuilding the directory tree and expanding the tree gadget items to show the new current path. To finalize, the tree gadget item of the directory is selected.
path | The new current path. |
|
virtual |
Updates the apply button.
Updates the apply button based on the selected path. Default implemenation updates the apply button's state based on whether the selected directory can be read or not. Use getApplyButton()
to retrieve the button.
path | The new path. |
|
virtual |
Updates the status of the display mode buttons.
Updates the status of the display mode buttons. The display mode buttons are: Matrix mode and List mode.
|
virtual |
Updates the sheet for a path.
Initializes the sheet before updating the sheet data for a path. See the setSortMode()
method to choose the sort algorithm.
path | The path. |
|
virtual |
Updates the status of the Show files buttons.
Updates the status of the Show files buttons. The Show files buttons are: Show all files and Hide hidden files.
|
virtual |
Updates the toolbar.
Updates the toolbar which displays the current path.
path | The new path. |
|
virtual |
Updates a part of the tree gadget.
Manages the drawing operations of the tree gadget before calling the fillTree()
method to update a part of the tree gadget.
path | The path. |
item | The tree gadget item associated with the path. |
|
virtual |
Called when the Up directory button has been clicked.
Called when the Up directory button has been clicked.