1 #ifndef PATHLINKER_H
2 #define PATHLINKER_H
3 
4 #include <vector>
5 #include "TextLabel.h"
6 #include "FileList.h"
7 #include "DirPanel.h"
8 #include "xfedefs.h"
9 
10 class FXAPI PathLinker : public FXHorizontalFrame
11 {
12     FXDECLARE(PathLinker)
13 
14 protected:
15     typedef std::vector<FXButton*>   vector_FXButton;
16     vector_FXButton linkButtons;
17     FXuint          nbActiveButtons;
18     FXuint          currentButton;
19     FXString        visitedPath;
20     TextLabel*      focusButton;
21     FXFont*         normalFont;
22     FXFont*         highlightFont;
23     FileList*       filelist;
24     DirList*        dirlist;
PathLinker()25     PathLinker() : nbActiveButtons(0), currentButton(0), focusButton(NULL), normalFont(NULL), highlightFont(NULL), filelist(NULL), dirlist(NULL)
26     {}
27 
28 private:
29     void updatePath(FXString, FXuint);
30     void setText(FXuint, FXString);
31 
32 public:
33     enum ButtonIds
34     {
35         ID_START_LINK = FXHorizontalFrame::ID_LAST,
36         // Note: Place any additional id's AFTER ID_END_LINK
37         ID_END_LINK = ID_START_LINK + MAX_LINKS - 1,
38         ID_FOCUS_BUTTON,
39         ID_LAST
40     };
41 
42     PathLinker(FXComposite* a, FileList* flist, DirList* dlist = NULL, FXuint opts = 0);
43     virtual void create();
44 
45     virtual ~PathLinker();
46     long pathButtonPressed(FXObject*, FXSelector, void*);
47     long onCmdFocusButton(FXObject*, FXSelector, void*);
48     long onUpdPath(FXObject*, FXSelector, void*);
49     void setPath(FXString);
50     void focus();
51     void unfocus();
52 };
53 
54 #endif
55