1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : QAD_DirListDlg.h
8 // Author : Vadim SANDLER
12 #if !defined(QAD_DirListDlg_h)
13 #define QAD_DirListDlg_h
16 #include <qtoolbutton.h>
17 #include <qlineedit.h>
19 #include <qcombobox.h>
21 class QAD_DirListDlg : public QDialog {
27 QAD_DirListDlg(QWidget* parent, const char* name = 0);
32 void getPathList(QStringList& list);
34 void setPathList(const QStringList& list);
36 bool eventFilter(QObject* object, QEvent* event);
39 // validates entered path, returns true if OK
41 // appends/changes path
42 void appendDir(QListBoxItem* item, const QString& dir);
43 // removes directory from list
44 void removeDir(QListBoxItem* item);
45 // KeyPress event handler, processes <Enter> and <Escape> keys
46 void keyPressEvent(QKeyEvent* event);
48 void resizeEvent(QResizeEvent* event);
51 // called when user clicks inside directories list box
52 void onMouseButtonClicked(int, QListBoxItem*, const QPoint&);
53 // called when user double-clicks on any item
54 void onDblClicked(QListBoxItem*);
55 // <...> (Browse dir) button slot
57 // called when user finises editing of path by pressing <Enter>
58 void onEditFinished();
59 // <Insert> button slot
61 // <Delete> button slot
63 // <Move up> button slot
65 // <Move down> button slot
71 QListBox* myDirList; // directory list
72 QLineEdit* myEdit; // path edit box
73 QToolButton* myBtn; // browse pah button
74 bool myEdited; // edit mode flag
75 QListBoxItem* myLastSelected; // last selected row
79 #endif // !defined(QAD_DirListDlg_h)