rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvFileChooser Class Reference

File selector dialog class. More...

#include <ilviews/gadgets/filechoo.h>

Inheritance diagram for IlvFileChooser:
IlvDialog IlvGadgetContainer IlvContainer IlvDrawingView IlvView IlvAbstractView IlvSystemPort IlvPort

List of all members.

Public Member Functions

 IlvFileChooser (IlvDisplay *display, const char *dir=0, const char *title=0, IlvFileChooserOptions *options=0, IlvSystemView transientFor=0, IlUInt properties=0)
 Constructor.
virtual void addFileInListMode (const IlPathName &file, IlvPathGadgetItem *item)
 Adds an item to the sheet in List mode.
virtual void addFileInMatrixMode (const IlPathName &file, IlvPathGadgetItem *item)
 Adds an item to the sheet in Matrix mode.
virtual void addFileToSheet (const IlPathName &file)
 Adds an item to the sheet.
virtual void adjustSheetForMatrixMode ()
 Updates the sheet when the dialog is resized.
virtual void changePath (const IlPathName &path)
 Called when the user selects a new path.
virtual void convertSizeToLabel (IlUInt size, IlString &label) const
 Converts a file size to a string.
virtual IlvButtoncreateApplyButton (const IlvRect &rect, const IlString &label) const
 Creates a dialog Apply button.
virtual IlvButtoncreateCancelButton (const IlvRect &rect, const IlString &label) const
 Creates a dialog Cancel button.
virtual IlvButtoncreateCreateButton (const IlvRect &rect) const
 Creates a Create directory dialog button.
virtual IlvTreePathGadgetItemcreateDeviceItem (const IlPathName &file, IlInt genre) const
 Creates a tree gadget item for a device.
virtual void createDirectoryButtonClicked ()
virtual IlvComboBoxcreateFilterComboBox (const IlvRect &rect) const
 Creates a dialog combobox.
virtual IlvButtoncreateHiddenButton (const IlvRect &rect) const
 Creates a Hide hidden files dialog button.
virtual IlvButtoncreateListButton (const IlvRect &rect) const
 Creates a List mode dialog button.
virtual IlvButtoncreateMatrixButton (const IlvRect &rect) const
 Creates a Matrix mode dialog button.
virtual IlvMessageLabelcreateMsgLabel (const IlvRect &rect, const IlString &label) const
 Creates a dialog message label.
virtual IlvFileChooserSheetcreateSheet (const IlvRect &rect) const
 Creates a dialog sheet.
virtual IlvPathGadgetItemcreateSheetItem (const IlPathName &file, IlvFileChooserDisplayMode mode) const
 Creates a gadget item for the sheet.
virtual IlvButtoncreateShowAllButton (const IlvRect &rect) const
 Creates a Show all files dialog button.
virtual IlvTextFieldcreateTextField (const IlvRect &rect) const
 Creates a dialog textfield.
virtual IlvToolBarPathcreateToolBar (const IlvRect &rect) const
 Creates a dialog toolbar.
virtual IlvFileChooserTreecreateTreeGadget (const IlvRect &rect) const
 Creates a dialog tree gadget.
virtual IlvTreePathGadgetItemcreateTreeItem (const IlPathName &path) const
 Creates a tree gadget item for a directory.
virtual IlvButtoncreateUpButton (const IlvRect &rect) const
 Creates an Up directory dialog button.
virtual IlvTreePathGadgetItemfillTree (IlPathName &path, IlvTreePathGadgetItem *parent, IlPathName *ref=0)
 Expands a directory of the tree gadget.
virtual void filterChanged ()
 Called when the filter has changed.
IlInt get (IlBoolean grab=IlFalse, IlvCursor *cursor=0)
 Displays the dialog as a modal dialog.
IlvButtongetCreateButton () const
 Returns the Create directory dialog button.
IlvComboBoxgetFilterComboBox () const
 Returns the dialog combobox.
virtual const IlStringgetFilterExtension () const
 Returns the current filter extension.
IlvButtongetListButton () const
 Returns the List mode dialog button.
IlvButtongetMatrixButton () const
 Returns the Matrix mode dialog button.
virtual IlBoolean getNewDirectoryName (IlString &name)
 Called when the user has clicked the Create directory button.
IlvFileChooserOptionsgetOptions () const
 Returns the object which describes the dialog.
const IlStringgetResult (IlInt index=0) const
 Returns a selected path name.
IlInt getResultCount () const
 Returns the result count.
IlvFileChooserSheetgetSheet () const
 Returns the dialog sheet.
IlvFileChooserDisplayMode getSheetMode () const
 Returns the display mode of the sheet.
IlvButtongetShowAllButton () const
 Returns the Show all files dialog button.
IlvTextFieldgetTextField () const
 Returns the dialog textfield.
IlvToolBarPathgetToolBar () const
 Returns the dialog toolbar.
IlvFileChooserTreegetTreeGadget () const
 Returns the dialog tree gadget.
IlvButtongetUpButton () const
 Returns the Up directory dialog button.
virtual void handleSheetDoubleClick (IlvEvent &evt)
 Handles double-clicking in the sheet.
virtual void initSheet ()
 Initializes the sheet.
virtual void initSheetForListMode ()
 Initializes the sheet for List mode.
virtual void initSheetForMatrixMode ()
 Initializes the sheet for Matrix mode.
virtual IlBoolean isSortedByName () const
 Indicates whether the files and directories are sorted by name or type.
virtual void listModeButtonClicked ()
virtual void matrixModeButtonClicked ()
virtual void newShowAllMode (IlBoolean show)
 Changes the status of the Show files buttons.
virtual void processApply ()
 Called when the Apply button has been clicked.
virtual void refreshSheet ()
 Updates the sheet with the current path.
virtual void rewindPath (const IlPathName &path)
 Called when the user selects a directory of the path.
virtual void selectionChanged ()
 Called when the sheet selection has been changed.
void setCurrentPath (const IlPathName &path)
 Sets the current path.
void setFilterExtension (const IlString &ext)
 Sets the current filter extension.
virtual void setTreePath (const IlPathName &path)
 Sets the path of the tree gadget.
void sort (IlBoolean byName)
 Sets the sort type for files and directories of the sheet.
virtual void updateDisplayButtons ()
 Updates the status of the display mode buttons.
virtual void updateSheet (IlPathName &path)
 Updates the sheet for a path.
virtual void updateSheetByName (IlPathName &path)
 Updates the sheet with data that is sorted by name.
virtual void updateSheetByType (IlPathName &path)
 Updates the sheet with data that is sorted by type.
virtual void updateShowAllButton ()
 Updates the status of the Show files buttons.
virtual void updateToolBar (IlPathName &path)
 Updates the toolbar.
virtual void updateTree (IlPathName &path, IlvTreePathGadgetItem *item)
 Updates a part of the tree gadget.
virtual void upDirectoryButtonClicked ()

Detailed Description

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.

See also:
IlvDialog, IlvFileChooserOptions

Constructor & Destructor Documentation

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.

Parameters:
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. See the IlvView constructors for more details.

Member Function Documentation

virtual void IlvFileChooser::addFileInListMode ( const IlPathName file,
IlvPathGadgetItem item 
) [virtual]

Adds an item to the sheet in List mode.

Adds a file or directory to the sheet in List mode.

Parameters:
file The full path for a file or a directory.
item The gadget item associated with the file or directory.
virtual void IlvFileChooser::addFileInMatrixMode ( const IlPathName file,
IlvPathGadgetItem item 
) [virtual]

Adds an item to the sheet in Matrix mode.

Adds a file or directory to the sheet in Matrix mode.

Parameters:
file The full path for a file or a directory.
item The gadget item associated with the file or directory.
virtual void IlvFileChooser::addFileToSheet ( const IlPathName file  )  [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.

Parameters:
file The full path for a file or a directory.
virtual void IlvFileChooser::adjustSheetForMatrixMode (  )  [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 void IlvFileChooser::changePath ( const IlPathName path  )  [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.

Parameters:
path The path which corresponds to the selection.
virtual void IlvFileChooser::convertSizeToLabel ( IlUInt  size,
IlString label 
) const [virtual]

Converts a file size to a string.

Converts a file size to a string.

Parameters:
size The file size.
label The conversion result.
virtual IlvButton* IlvFileChooser::createApplyButton ( const IlvRect rect,
const IlString label 
) const [virtual]

Creates a dialog Apply button.

Creates the Apply button.

Parameters:
rect The bounding box of the button.
label The button label.
Returns:
The created button.
virtual IlvButton* IlvFileChooser::createCancelButton ( const IlvRect rect,
const IlString label 
) const [virtual]

Creates a dialog Cancel button.

Creates the Cancel button.

Parameters:
rect The bounding box of the button.
label The button label.
Returns:
The created button.
virtual IlvButton* IlvFileChooser::createCreateButton ( const IlvRect rect  )  const [virtual]

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.

Parameters:
rect The bounding box of the button.
Returns:
The created button.
virtual IlvTreePathGadgetItem* IlvFileChooser::createDeviceItem ( const IlPathName file,
IlInt  genre 
) const [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
Parameters:
path The full path name of the device.
genre The device type.
Returns:
A tree gadget item.
virtual void IlvFileChooser::createDirectoryButtonClicked (  )  [virtual]

Called when the Create directory button has been clicked.

virtual IlvComboBox* IlvFileChooser::createFilterComboBox ( const IlvRect rect  )  const [virtual]

Creates a dialog combobox.

Creates the combobox which contains the filter list. If no filter is defined, this method is not called.

Parameters:
rect The bounding box of the combobox.
Returns:
The created combobox.
virtual IlvButton* IlvFileChooser::createHiddenButton ( const IlvRect rect  )  const [virtual]

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.

Parameters:
rect The bounding box of the button.
Returns:
The created button.
virtual IlvButton* IlvFileChooser::createListButton ( const IlvRect rect  )  const [virtual]

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.

Parameters:
rect The bounding box of the button.
Returns:
The created button.
virtual IlvButton* IlvFileChooser::createMatrixButton ( const IlvRect rect  )  const [virtual]

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.

Parameters:
rect The bounding box of the button.
Returns:
The created button.
virtual IlvMessageLabel* IlvFileChooser::createMsgLabel ( const IlvRect rect,
const IlString label 
) const [virtual]

Creates a dialog message label.

Creates a message label such as Filename or Filter.

Parameters:
rect The bounding box of the message label.
label The text of the message label.
Returns:
The created message label.
virtual IlvFileChooserSheet* IlvFileChooser::createSheet ( const IlvRect rect  )  const [virtual]

Creates a dialog sheet.

Creates the sheet which displays the directories and files of the current path.

Parameters:
rect The bounding box of the sheet.
Returns:
The created sheet.
virtual IlvPathGadgetItem* IlvFileChooser::createSheetItem ( const IlPathName file,
IlvFileChooserDisplayMode  mode 
) const [virtual]

Creates a gadget item for the sheet.

Creates a gadget item for the list of directories and files.

Parameters:
path The full path name of the directory or file.
mode The display mode of the sheet which can be List or Matrix mode.
Returns:
A gadget item.
virtual IlvButton* IlvFileChooser::createShowAllButton ( const IlvRect rect  )  const [virtual]

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.

Parameters:
rect The bounding box of the button.
Returns:
The created button.
virtual IlvTextField* IlvFileChooser::createTextField ( const IlvRect rect  )  const [virtual]

Creates a dialog textfield.

Creates the textfield which contains the selection.

Parameters:
rect The bounding box of the textfield.
Returns:
The created textfield.
virtual IlvToolBarPath* IlvFileChooser::createToolBar ( const IlvRect rect  )  const [virtual]

Creates a dialog toolbar.

Creates the toolbar which displays the current path.

Parameters:
rect The bounding box of the toolbar.
Returns:
The created toolbar.
virtual IlvFileChooserTree* IlvFileChooser::createTreeGadget ( const IlvRect rect  )  const [virtual]

Creates a dialog tree gadget.

Creates the tree gadget which displays the directory tree.

Parameters:
rect The bounding box of the tree gadget.
Returns:
The created tree gadget.
virtual IlvTreePathGadgetItem* IlvFileChooser::createTreeItem ( const IlPathName path  )  const [virtual]

Creates a tree gadget item for a directory.

Creates a tree gadget item for a directory.

Parameters:
path The full path name of the directory.
Returns:
A tree gadget item.
virtual IlvButton* IlvFileChooser::createUpButton ( const IlvRect rect  )  const [virtual]

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.

Parameters:
rect The bounding box of the button.
Returns:
The created button.
virtual IlvTreePathGadgetItem* IlvFileChooser::fillTree ( IlPathName path,
IlvTreePathGadgetItem parent,
IlPathName ref = 0 
) [virtual]

Expands a directory of the tree gadget.

Expands a directory of the tree gadget.

Parameters:
path The full path of the directory.
parent The tree gadget item associated with the path.
ref The current path of the dialog.
Returns:
The new tree gadget item corresponding to the current path of the dialog, otherwise null.
virtual void IlvFileChooser::filterChanged (  )  [virtual]

Called when the filter has changed.

Called when the user selects a new filter in the filter combobox.

IlInt IlvFileChooser::get ( IlBoolean  grab = IlFalse,
IlvCursor cursor = 0 
)

Displays the dialog as a modal dialog.

Parameters:
grab A Boolean value specifying 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.
Returns:
The number of the selected path.
Warning:
[note] Some operating systems, such as Windows NT and Windows 95, do not allow system modal dialogs. On these operating system dialogs are always application modal.
See also:
getResult, getResultCount
IlvButton* IlvFileChooser::getCreateButton (  )  const

Returns the Create directory dialog button.

Returns:
The Create directory button, or 0 if the button is not visible.
IlvComboBox* IlvFileChooser::getFilterComboBox (  )  const

Returns the dialog combobox.

Returns:
The combobox which contains the list of file types.
virtual const IlString& IlvFileChooser::getFilterExtension (  )  const [virtual]

Returns the current filter extension.

Returns:
The current filter extension. The default value is an empty string which means no filter or all files.
IlvButton* IlvFileChooser::getListButton (  )  const

Returns the List mode dialog button.

Returns:
The List mode button, or 0 if the button is not visible.
IlvButton* IlvFileChooser::getMatrixButton (  )  const

Returns the Matrix mode dialog button.

Returns:
The Matrix mode button, or 0 if the button is not visible.
virtual IlBoolean IlvFileChooser::getNewDirectoryName ( IlString name  )  [virtual]

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.

Parameters:
name The name of the new directory.
Returns:
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:
The object which describes the dialog.
const IlString& IlvFileChooser::getResult ( IlInt  index = 0  )  const

Returns a selected path name.

Returns a path name from the list of selected path names.

Parameters:
index The index of the selected path name in the list. The index value starts at 0.
Returns:
The selected path name.
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.

Returns:
The number of selected path names.
IlvFileChooserSheet* IlvFileChooser::getSheet (  )  const

Returns the dialog sheet.

Returns:
The sheet which displays the directories and files of the current path.
IlvFileChooserDisplayMode IlvFileChooser::getSheetMode (  )  const

Returns the display mode of the sheet.

Returns:
The display mode of the sheet.
IlvButton* IlvFileChooser::getShowAllButton (  )  const

Returns the Show all files dialog button.

Returns:
The Show all files button, or 0 if the button is not visible.
IlvTextField* IlvFileChooser::getTextField (  )  const

Returns the dialog textfield.

Returns:
The textfield which contains the selection.
IlvToolBarPath* IlvFileChooser::getToolBar (  )  const

Returns the dialog toolbar.

Returns:
The toolbar which displays the current path.
IlvFileChooserTree* IlvFileChooser::getTreeGadget (  )  const

Returns the dialog tree gadget.

Returns:
The tree gadget which displays the directory tree.
IlvButton* IlvFileChooser::getUpButton (  )  const

Returns the Up directory dialog button.

Returns:
The Up directory button, or 0 if the button is not visible.
virtual void IlvFileChooser::handleSheetDoubleClick ( IlvEvent evt  )  [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 void IlvFileChooser::initSheet (  )  [virtual]

Initializes the sheet.

Initializes the common features of the sheet before calling the initSheetForMatrixMode or initSheetForListMode methods to finalize.

virtual void IlvFileChooser::initSheetForListMode (  )  [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 void IlvFileChooser::initSheetForMatrixMode (  )  [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 IlBoolean IlvFileChooser::isSortedByName (  )  const [virtual]

Indicates whether the files and directories are sorted by name or type.

Indicates whether the files and directories of the sheet are sorted by name or type

Returns:
IlTrue if the files and directories are sorted by name, IlFalse if they are sorted by type. The default value is IlFalse.
virtual void IlvFileChooser::listModeButtonClicked (  )  [virtual]

Called when the List mode button has been clicked.

virtual void IlvFileChooser::matrixModeButtonClicked (  )  [virtual]

Called when the Matrix mode button has been clicked.

virtual void IlvFileChooser::newShowAllMode ( IlBoolean  show  )  [virtual]

Changes the status of the Show files buttons.

Changes the status of the Show files buttons.

Parameters:
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 void IlvFileChooser::processApply (  )  [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 void IlvFileChooser::refreshSheet (  )  [virtual]

Updates the sheet with the current path.

Updates the sheet data with the current path.

virtual void IlvFileChooser::rewindPath ( const IlPathName 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.

Parameters:
path The path which corresponds to the selection.
virtual void IlvFileChooser::selectionChanged (  )  [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.

Parameters:
path The new current path.
void IlvFileChooser::setFilterExtension ( const IlString ext  ) 

Sets the current filter extension.

Parameters:
ext The new filter extension.
virtual void IlvFileChooser::setTreePath ( const IlPathName path  )  [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.

Parameters:
path The new current path.
void IlvFileChooser::sort ( IlBoolean  byName  ) 

Sets the sort type for files and directories of the sheet.

Files and directories can be sorted by name or type.

Parameters:
byName If the value is IlTrue, the files and directories are sorted by name, otherwise they will be sorted by type.
virtual void IlvFileChooser::updateDisplayButtons (  )  [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 void IlvFileChooser::updateSheet ( IlPathName path  )  [virtual]

Updates the sheet for a path.

Initializes the sheet before updating the sheet data for a path. To finalize the update, this method calls the updateSheetByName or updateSheetByType method. See the sort method to choose the type.

Parameters:
path The path.
virtual void IlvFileChooser::updateSheetByName ( IlPathName path  )  [virtual]

Updates the sheet with data that is sorted by name.

Reads the files and directories from a path before inserting them into the sheet.

Parameters:
path The path.
virtual void IlvFileChooser::updateSheetByType ( IlPathName path  )  [virtual]

Updates the sheet with data that is sorted by type.

Reads the files and directories from a path before inserting them into the sheet. Directories are inserted before files.

Parameters:
path The path.
virtual void IlvFileChooser::updateShowAllButton (  )  [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 void IlvFileChooser::updateToolBar ( IlPathName path  )  [virtual]

Updates the toolbar.

Updates the toolbar which displays the current path.

Parameters:
path The new path.
virtual void IlvFileChooser::updateTree ( IlPathName path,
IlvTreePathGadgetItem item 
) [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.

Parameters:
path The path.
item The tree gadget item associated with the path.
virtual void IlvFileChooser::upDirectoryButtonClicked (  )  [virtual]

Called when the Up directory button has been clicked.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.