File indexing completed on 2025-01-18 10:11:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_TGFileDialog
0014 #define ROOT_TGFileDialog
0015
0016
0017 #include "TGFrame.h"
0018
0019
0020 enum EFileDialogMode {
0021 kFDOpen,
0022 kFDSave,
0023 kDOpen,
0024 kDSave
0025 };
0026
0027
0028 class TGTextBuffer;
0029 class TGTextEntry;
0030 class TGComboBox;
0031 class TGPictureButton;
0032 class TGTextButton;
0033 class TGCheckButton;
0034 class TGListView;
0035 class TGFileContainer;
0036 class TGFSComboBox;
0037
0038
0039 class TGFileInfo {
0040
0041 private:
0042 TGFileInfo(const TGFileInfo&) = delete;
0043 TGFileInfo& operator=(const TGFileInfo&) = delete;
0044
0045 public:
0046 char *fFilename{nullptr};
0047 char *fIniDir{nullptr};
0048 const char **fFileTypes{nullptr};
0049 Int_t fFileTypeIdx{0};
0050 Bool_t fOverwrite{kFALSE};
0051 Bool_t fMultipleSelection{kFALSE};
0052 TList *fFileNamesList{nullptr};
0053
0054 TGFileInfo() = default;
0055 ~TGFileInfo();
0056
0057 void SetFilename(const char *fname);
0058 void SetIniDir(const char *inidir);
0059 void DeleteFileNamesList();
0060
0061 void SetMultipleSelection(Bool_t option);
0062 };
0063
0064
0065 class TGFileDialog : public TGTransientFrame {
0066
0067 protected:
0068 TGTextBuffer *fTbfname;
0069 TGTextEntry *fName;
0070 TGComboBox *fTypes;
0071 TGFSComboBox *fTreeLB;
0072 TGPictureButton *fCdup;
0073 TGPictureButton *fNewf;
0074 TGPictureButton *fList;
0075 TGPictureButton *fDetails;
0076 TGCheckButton *fCheckB;
0077
0078 const TGPicture *fPcdup;
0079 const TGPicture *fPnewf;
0080 const TGPicture *fPlist;
0081 const TGPicture *fPdetails;
0082 TGTextButton *fOk;
0083 TGTextButton *fCancel;
0084 TGListView *fFv;
0085 TGFileContainer *fFc;
0086 TGFileInfo *fFileInfo;
0087 EFileDialogMode fDlgType;
0088
0089 private:
0090 TGFileDialog(const TGFileDialog&) = delete;
0091 TGFileDialog& operator=(const TGFileDialog&) = delete;
0092
0093 public:
0094 TGFileDialog(const TGWindow *p = nullptr, const TGWindow *main = nullptr,
0095 EFileDialogMode dlg_type = kFDOpen, TGFileInfo *file_info = nullptr);
0096 ~TGFileDialog() override;
0097
0098 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0099 void CloseWindow() override;
0100
0101 ClassDefOverride(TGFileDialog,0)
0102 };
0103
0104 #endif