#include <dlgFilesSelector.hpp>
Inheritance diagram for dlgFilesSelector:
Public Member Functions | |
void | createControls () |
Creates and initializes the controls of the dialog. | |
dlgFilesSelector (wxWindow *parent, const bool extendDialog=false) | |
Creates a new dialog. | |
dlgFilesSelector () | |
Creates a new dialog. | |
void | getFileNames (wxArrayString &names) const |
Gets the names of the files. | |
int | getHistoryMaxSize () |
Get the maximum size of the history of the last files' names and directories for searching files. | |
wxString | getLookInConfigKey (const int n) |
Gets the configuration key for the last directories for searching files. | |
wxString | getNamedConfigKey (const int n) |
Gets the configuration key for the last files' names for searching files. | |
virtual wxString | getRootConfigKey ()=0 |
Gets the root configuration key for parameters of this dialog. | |
virtual void | initialize () |
Initializes the dialog. | |
virtual | ~dlgFilesSelector () |
The class descructor. | |
Protected Types | |
enum | { LVW_FILES = wxID_HIGHEST + 1, BTN_ADD, BTN_REMOVE, BTN_ADDLIST, BTN_LOADLIST, BTN_SAVELIST, CBO_NAMED, CBO_LOOKIN, BTN_BROWSE, BTN_SEARCH_AND_ADD, SPN_DEPTH, RBX_SORT_BY, RBX_SORT_ORDER, BTN_OK, DLG_FILESSELECTOR_ID_HIGHEST } |
Controls IDs. More... | |
enum | PreferencesKey { prGUI_SORT_BY = 0, prGUI_SORT_ORDER, prGUI_FILENAME_WIDTH, prGUI_DIRECTORY_WIDTH, prGUI_WINDOW_SIZE } |
Preferences keys. More... | |
enum | UIStrings { uiDialogTitle = 0, uiBtnOK, uiFraFilesList, uiFraSearchFiles, uiOpenDlgAddFiles, uiOpenDlgAddList, uiOpenDlgLoadList, uiSaveDlgAddList } |
Custumised UI strings. More... | |
Protected Member Functions | |
void | addFileNamesToListView (const wxArrayString &fileNames) |
Adds the given array of file names to the listview of file names. | |
void | btnAddClick (wxCommandEvent &event) |
Processes button Add. | |
void | btnAddListClick (wxCommandEvent &event) |
Processes button Add List. | |
void | btnBrowseClick (wxCommandEvent &event) |
Processes button Browse. | |
void | btnLoadListClick (wxCommandEvent &event) |
Processes button Load List. | |
void | btnOKClick (wxCommandEvent &event) |
Processes button OK. | |
void | btnRemoveClick (wxCommandEvent &event) |
Processes button Remove. | |
void | btnSaveListClick (wxCommandEvent &event) |
Processes button Save List. | |
void | btnSearchAndAddClick (wxCommandEvent &event) |
Processes button Search and Add. | |
void | cboSearchTextEnter (wxCommandEvent &event) |
Event handler for the enter key pressed on a search combo box. | |
wxString | getConfigKey (const PreferencesKey pk) |
Gets the configuration key corresponding to the given preference key. | |
virtual wxFileDialogFilterMaker | getFiltersForAddFilesDialog ()=0 |
Returns a set of filters for the "Add files" dialog. | |
virtual wxString | getUIString (UIStrings id)=0 |
Gets the string for the specified UI element. | |
void | lvwFilesColumnClick (wxListEvent &event) |
Processes a click on a header of a column of the list of files. | |
void | lvwFilesDeselectItem (wxListEvent &event) |
Event handler for the deselection of an item. | |
void | lvwFilesKeyDown (wxListEvent &event) |
Event handler for the key down event. | |
void | lvwFilesSelectItem (wxListEvent &event) |
Event handler for the selection of an item. | |
void | rbxSortBySelect (wxCommandEvent &event) |
Processes a selection of the column to sort. | |
void | rbxSortOrderSelect (wxCommandEvent &event) |
Processes a selection of the sort order. | |
Static Protected Member Functions | |
long | getID () |
Gets a new unique identifier. | |
Protected Attributes | |
wxButton * | btnAdd |
Button for adding files. | |
wxButton * | btnRemove |
Button for removing files. | |
wxButton * | btnSearchAndAdd |
Search and add files to the list of files. | |
wxComboBox * | cboLookIn |
Directory to begin the search. | |
wxComboBox * | cboNamed |
Name of the file to search. | |
bool | extend |
Is the dialog will be extended ? | |
wxBoxSizer * | extendSizer |
Sizer where controls should be added (it is positionned before the validation buttons). | |
wxArrayString | fileNames |
Names of the files given by the validator. | |
wxSortableListView * | lvwFiles |
List of selected files. | |
wxRadioBox * | rbxSortBy |
Sort by radio box buttons. | |
wxRadioBox * | rbxSortOrder |
Sort order radio box buttons. | |
wxSpinCtrl * | spnDepth |
Search depth. | |
Private Member Functions | |
void | getLastDirectoryAndFilter (const wxString &configKey, wxString &lastDirKey, wxString &lastDir, wxFileDialogFilterMaker &fltMaker) |
Gets the last directory used and the filter for the open or save dialog. | |
Static Private Member Functions | |
void | addLineToComboBox (wxComboBox *cboBox, const int maxLines) |
Adds a file or a directory or a match pattern to a combo box. |
Important: you must call the initialize()
method just after the constructor the create the widgets of the window (this can't be done in the constructor because createControls()
calls pure virtual methods.
Definition at line 56 of file dlgFilesSelector.hpp.
|
Controls IDs.
Definition at line 128 of file dlgFilesSelector.hpp. |
|
Preferences keys.
Definition at line 185 of file dlgFilesSelector.hpp. |
|
Custumised UI strings.
Definition at line 199 of file dlgFilesSelector.hpp. |
|
Creates a new dialog.
Definition at line 400 of file dlgFilesSelector.cpp. References extend. |
|
Creates a new dialog.
Definition at line 418 of file dlgFilesSelector.cpp. References extend. |
|
The class descructor.
Definition at line 599 of file dlgFilesSelector.cpp. |
|
Adds the given array of file names to the listview of file names. The names that already are in the list are not added.
Definition at line 1130 of file dlgFilesSelector.cpp. References addFileNamesToListView(), compareFileName(), filesListCmpFnct(), getID(), and lvwFiles. Referenced by addFileNamesToListView(), btnAddClick(), btnAddListClick(), btnLoadListClick(), and btnSearchAndAddClick(). |
|
Adds a file or a directory or a match pattern to a combo box.
Definition at line 878 of file dlgFilesSelector.cpp. References addLineToComboBox(), and compareFileName(). Referenced by addLineToComboBox(), and btnSearchAndAddClick(). |
|
Processes button Add.
Definition at line 610 of file dlgFilesSelector.cpp. References addFileNamesToListView(), btnAddClick(), wxFileDialogFilterMaker::GetFilters(), getFiltersForAddFilesDialog(), getRootConfigKey(), getUIString(), and AppPrefs::getUserDocumentsDirName(). Referenced by btnAddClick(). |
|
Processes button Add List.
Definition at line 697 of file dlgFilesSelector.cpp. References addFileNamesToListView(), btnAddListClick(), wxFileDialogFilterMaker::GetFilters(), getLastDirectoryAndFilter(), and getUIString(). Referenced by btnAddListClick(). |
|
Processes button Browse.
Definition at line 844 of file dlgFilesSelector.cpp. References btnBrowseClick(), cboLookIn, getRootConfigKey(), and AppPrefs::getUserDocumentsDirName(). Referenced by btnBrowseClick(). |
|
Processes button Load List.
Definition at line 743 of file dlgFilesSelector.cpp. References addFileNamesToListView(), btnLoadListClick(), wxFileDialogFilterMaker::GetFilters(), getLastDirectoryAndFilter(), getUIString(), and lvwFiles. Referenced by btnLoadListClick(). |
|
Processes button OK.
Reimplemented in dlgBatchCreationConf. Definition at line 1098 of file dlgFilesSelector.cpp. References btnOKClick(), wxSortableListView::GetColumnToSort(), getConfigKey(), wxSortableListView::GetSortOrder(), and lvwFiles. Referenced by btnOKClick(). |
|
Processes button Remove.
Definition at line 649 of file dlgFilesSelector.cpp. References btnRemoveClick(), and lvwFiles. Referenced by btnRemoveClick(). |
|
Processes button Save List.
Definition at line 792 of file dlgFilesSelector.cpp. References btnSaveListClick(), wxFileDialogFilterMaker::GetFilters(), getLastDirectoryAndFilter(), getUIString(), and lvwFiles. Referenced by btnSaveListClick(). |
|
Processes button Search and Add.
Definition at line 918 of file dlgFilesSelector.cpp. References addFileNamesToListView(), addLineToComboBox(), btnSearchAndAddClick(), cboLookIn, cboNamed, getHistoryMaxSize(), getLookInConfigKey(), getNamedConfigKey(), and spnDepth. Referenced by btnSearchAndAddClick(). |
|
Event handler for the enter key pressed on a search combo box.
Definition at line 1028 of file dlgFilesSelector.cpp. References btnSearchAndAdd, and cboSearchTextEnter(). Referenced by cboSearchTextEnter(). |
|
Creates and initializes the controls of the dialog.
Reimplemented in dlgBatchCreationConf. Definition at line 453 of file dlgFilesSelector.cpp. References btnAdd, btnRemove, btnSearchAndAdd, cboLookIn, cboNamed, CONTROL_SPACE, extend, extendSizer, wxSortableListView::GetColumnToSort(), getConfigKey(), getHistoryMaxSize(), getLookInConfigKey(), getNamedConfigKey(), wxSortableListView::GetSortOrder(), getUIString(), lvwFiles, rbxSortBy, rbxSortOrder, wxSortableListView::SetColumnToSort(), wxSortableListView::SetSortOrder(), and spnDepth. Referenced by initialize(). |
|
Gets the configuration key corresponding to the given preference key.
Definition at line 1246 of file dlgFilesSelector.cpp. References getConfigKey(), and getRootConfigKey(). Referenced by btnOKClick(), createControls(), getConfigKey(), and initialize(). |
|
Gets the names of the files.
Definition at line 1186 of file dlgFilesSelector.cpp. References fileNames, and getFileNames(). Referenced by getFileNames(), frmSums::itmToolsBatchCreationClick(), and frmSums::itmToolsCheckMultipleClick(). |
|
Returns a set of filters for the "Add files" dialog.
Implemented in dlgBatchCreationConf, and dlgMultiCheckConf. Referenced by btnAddClick(). |
|
Get the maximum size of the history of the last files' names and directories for searching files.
Definition at line 1232 of file dlgFilesSelector.cpp. Referenced by btnSearchAndAddClick(), createControls(), getLookInConfigKey(), and getNamedConfigKey(). |
|
Gets a new unique identifier.
Definition at line 1281 of file dlgFilesSelector.cpp. References getUniqueId(). Referenced by addFileNamesToListView(), and dlgFilesSelector::FilesListValidator::TransferToWindow(). |
|
Gets the last directory used and the filter for the open or save dialog.
Definition at line 671 of file dlgFilesSelector.cpp. References wxFileDialogFilterMaker::AddFilter(), getLastDirectoryAndFilter(), getRootConfigKey(), and AppPrefs::getUserDocumentsDirName(). Referenced by btnAddListClick(), btnLoadListClick(), btnSaveListClick(), and getLastDirectoryAndFilter(). |
|
Gets the configuration key for the last directories for searching files.
Definition at line 1215 of file dlgFilesSelector.cpp. References getHistoryMaxSize(), getLookInConfigKey(), and getRootConfigKey(). Referenced by btnSearchAndAddClick(), createControls(), and getLookInConfigKey(). |
|
Gets the configuration key for the last files' names for searching files.
Definition at line 1199 of file dlgFilesSelector.cpp. References getHistoryMaxSize(), getNamedConfigKey(), and getRootConfigKey(). Referenced by btnSearchAndAddClick(), createControls(), and getNamedConfigKey(). |
|
Gets the root configuration key for parameters of this dialog.
The returned string must be ended the a '
Implemented in dlgBatchCreationConf, and dlgMultiCheckConf. Referenced by btnAddClick(), btnBrowseClick(), getConfigKey(), getLastDirectoryAndFilter(), getLookInConfigKey(), and getNamedConfigKey(). |
|
Gets the string for the specified UI element.
Implemented in dlgBatchCreationConf, and dlgMultiCheckConf. Referenced by btnAddClick(), btnAddListClick(), btnLoadListClick(), btnSaveListClick(), and createControls(). |
|
Initializes the dialog. If you derivate this method, please call the one of the parent class before doing anything. Reimplemented in dlgBatchCreationConf. Definition at line 433 of file dlgFilesSelector.cpp. References createControls(), and getConfigKey(). Referenced by dlgBatchCreationConf::initialize(), and frmSums::itmToolsCheckMultipleClick(). |
|
Processes a click on a header of a column of the list of files.
Definition at line 1065 of file dlgFilesSelector.cpp. References filesListCmpFnct(), wxSortableListView::GetColumnToSort(), wxSortableListView::GetSortOrder(), lvwFiles, lvwFilesColumnClick(), rbxSortBy, rbxSortOrder, wxSortableListView::SetColumnToSort(), and wxSortableListView::SetSortOrder(). Referenced by lvwFilesColumnClick(). |
|
Event handler for the deselection of an item.
Definition at line 978 of file dlgFilesSelector.cpp. References btnRemove, lvwFiles, and lvwFilesDeselectItem(). Referenced by lvwFilesDeselectItem(). |
|
Event handler for the key down event.
Definition at line 1041 of file dlgFilesSelector.cpp. References btnAdd, btnRemove, and lvwFilesKeyDown(). Referenced by lvwFilesKeyDown(). |
|
Event handler for the selection of an item.
Definition at line 966 of file dlgFilesSelector.cpp. References btnRemove, and lvwFilesSelectItem(). Referenced by lvwFilesSelectItem(). |
|
Processes a selection of the column to sort.
Definition at line 991 of file dlgFilesSelector.cpp. References filesListCmpFnct(), lvwFiles, rbxSortBySelect(), and wxSortableListView::SetColumnToSort(). Referenced by rbxSortBySelect(). |
|
Processes a selection of the sort order.
Definition at line 1004 of file dlgFilesSelector.cpp. References filesListCmpFnct(), lvwFiles, rbxSortOrderSelect(), and wxSortableListView::SetSortOrder(). Referenced by rbxSortOrderSelect(). |
|
Button for adding files.
Definition at line 79 of file dlgFilesSelector.hpp. Referenced by createControls(), and lvwFilesKeyDown(). |
|
Button for removing files.
Definition at line 80 of file dlgFilesSelector.hpp. Referenced by createControls(), lvwFilesDeselectItem(), lvwFilesKeyDown(), and lvwFilesSelectItem(). |
|
Search and add files to the list of files.
Definition at line 83 of file dlgFilesSelector.hpp. Referenced by cboSearchTextEnter(), and createControls(). |
|
Directory to begin the search.
Definition at line 85 of file dlgFilesSelector.hpp. Referenced by btnBrowseClick(), btnSearchAndAddClick(), and createControls(). |
|
Name of the file to search.
Definition at line 84 of file dlgFilesSelector.hpp. Referenced by btnSearchAndAddClick(), and createControls(). |
|
Is the dialog will be extended ?
Definition at line 76 of file dlgFilesSelector.hpp. Referenced by createControls(), and dlgFilesSelector(). |
|
Sizer where controls should be added (it is positionned before the validation buttons).
Definition at line 87 of file dlgFilesSelector.hpp. Referenced by createControls(). |
|
Names of the files given by the validator.
Definition at line 78 of file dlgFilesSelector.hpp. Referenced by getFileNames(). |
|
List of selected files.
Definition at line 77 of file dlgFilesSelector.hpp. Referenced by addFileNamesToListView(), btnLoadListClick(), btnOKClick(), btnRemoveClick(), btnSaveListClick(), createControls(), lvwFilesColumnClick(), lvwFilesDeselectItem(), rbxSortBySelect(), and rbxSortOrderSelect(). |
|
Sort by radio box buttons.
Definition at line 81 of file dlgFilesSelector.hpp. Referenced by createControls(), and lvwFilesColumnClick(). |
|
Sort order radio box buttons.
Definition at line 82 of file dlgFilesSelector.hpp. Referenced by createControls(), and lvwFilesColumnClick(). |
|
Search depth.
Definition at line 86 of file dlgFilesSelector.hpp. Referenced by btnSearchAndAddClick(), and createControls(). |