59 "ROOT files",
"*.root",
133 fTypes(0), fTreeLB(0), fCdup(0), fNewf(0), fList(0), fDetails(0), fCheckB(0),
134 fPcdup(0), fPnewf(0), fPlist(0), fPdetails(0), fOk(0), fCancel(0), fFv(0),
135 fFc(0), fFileInfo(0), fDlgType(dlg_type)
138 Connect(
"CloseWindow()",
"TGFileDialog",
this,
"CloseWindow()");
148 Error(
"TGFileDialog",
"file_info argument not set");
166 ?
"S&ave in:" :
"&Look in:"));
176 Error(
"TGFileDialog",
"missing toolbar pixmap(s).\n");
213 }
else if (dlg_type ==
kFDOpen) {
239 buttons[0]->
Connect(
"Clicked()",
"TGFileContainer",
fFc,
"Sort(=kSortByName)");
240 buttons[1]->
Connect(
"Clicked()",
"TGFileContainer",
fFc,
"Sort(=kSortByType)");
241 buttons[2]->
Connect(
"Clicked()",
"TGFileContainer",
fFc,
"Sort(=kSortBySize)");
242 buttons[3]->
Connect(
"Clicked()",
"TGFileContainer",
fFc,
"Sort(=kSortByOwner)");
243 buttons[4]->
Connect(
"Clicked()",
"TGFileContainer",
fFc,
"Sort(=kSortByGroup)");
244 buttons[5]->
Connect(
"Clicked()",
"TGFileContainer",
fFc,
"Sort(=kSortByDate)");
258 fCheckB->
Connect(
"Toggled(Bool_t)",
"TGFileContainer",
fFc,
"SetMultipleSelection(Bool_t)");
271 (dlg_type ==
kDOpen || dlg_type ==
kDSave ) ?
"Folder &name:" :
"File &name:"));
334 ?
"&Save" :
"&Open"),
kIDF_OK);
366 const char *wname = (dlg_type ==
kFDSave || dlg_type ==
kDSave) ?
"Save As..." :
"Open";
415 static inline void pExpandUnixPathName(
TGFileInfo &file_info) {
444 txt =
"Please provide file name or use \"Cancel\"";
453 txt =
TString::Format(
"File name %s already exists, OK to overwrite it?",
502 strlcpy(answer,
"(empty)",
sizeof(answer));
504 "Enter directory name:",
507 while ( strcmp(answer,
"(empty)") == 0 ) {
509 "Please enter a valid directory name.",
512 "Enter directory name:",
515 if ( strcmp(answer,
"") == 0 )
616 tmpString +=
"\"" + el->
GetString() +
"\" ";
652 txt =
TString::Format(
"File name %s already exists, OK to overwrite it?",
695 const char *txt2 =
"Please provide file name or use \"Cancel\"";
715 txt =
TString::Format(
"File name %s already exists, OK to overwrite it?",
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
static const char * gDefTypes[]
char * StrDup(const char *str)
Duplicate the string str.
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
TGViewPort * GetViewPort() const
const TGWindow * GetRoot() const
Returns current root (i.e.
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
void FreePicture(const TGPicture *pic)
Free picture resource.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
virtual TGLBEntry * GetSelectedEntry() const
virtual void AddEntry(TGString *s, Int_t id)
virtual TGListBox * GetListBox() const
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
virtual void SetEnabled(Bool_t on=kTRUE)
Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual UInt_t GetDefaultHeight() const
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
virtual void Associate(const TGWindow *w)
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
virtual Int_t NumSelected() const
This is a combo box that is used in the File Selection dialog box.
virtual void Update(const char *path)
Update file system combo box.
virtual void SetDisplayStat(Bool_t stat=kTRUE)
virtual void Sort(EFSSortMode sortType)
Sort file system list view container according to sortType.
virtual void ChangeDirectory(const char *path)
Change current directory.
virtual void DisplayDirectory()
Display the contents of the current directory in the container.
virtual void SetFilter(const char *filter)
Set file selection filter.
const char * GetDirectory() const
This class creates a file selection dialog.
const TGPicture * fPcdup
picture for fCdup
const TGPicture * fPdetails
picture for fDetails
TGFileContainer * fFc
file list view container (containing the files)
TGPictureButton * fDetails
top toolbar button
TGPictureButton * fNewf
top toolbar button
EFileDialogMode fDlgType
the dialog type passed
TGTextBuffer * fTbfname
text buffer of file name
TGTextButton * fCancel
cancel button
TGFSComboBox * fTreeLB
file system path combo box
virtual void CloseWindow()
Close file dialog.
TGFileInfo * fFileInfo
file info passed to this dialog
TGTextEntry * fName
file name text entry
const TGPicture * fPnewf
picture for fNewf
TGPictureButton * fList
top toolbar button
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process messages generated by the user input in the file dialog.
TGPictureButton * fCdup
top toolbar button
TGListView * fFv
file list view
const TGPicture * fPlist
picture for fList
virtual ~TGFileDialog()
Delete file dialog.
TGTextButton * fOk
ok button
TGCheckButton * fCheckB
set on/off file overwriting for Open dialog OR set on/off multiple file selection for SaveAs dialog
TGFileDialog(const TGFileDialog &)=delete
TGComboBox * fTypes
file type combo box
TList * fFileNamesList
list of selected file names
char * fFilename
selected file name
void SetMultipleSelection(Bool_t option)
Turn on/off multiple selection.
Int_t fFileTypeIdx
selected file type, index in fFileTypes
const char ** fFileTypes
file types used to filter selectable files
char * fIniDir
on input: initial directory, on output: new directory
~TGFileInfo()
TGFileInfo Destructor.
Bool_t fOverwrite
if true overwrite the file with existing name on save
void DeleteFileNamesList()
Delete file names list.
void SetFilename(const char *fname)
Set file name.
Bool_t fMultipleSelection
if true, allow multiple file selection
void SetIniDir(const char *inidir)
Set directory name.
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
virtual void DeleteWindow()
Delete window.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual void MapWindow()
map window
static Pixel_t fgWhitePixel
A composite frame that layout their children in horizontal way.
TGHotString is a string with a "hot" character underlined.
TList * GetSelectedItems()
Get list of selected items in container.
void SetMultipleSelection(Bool_t multi=kTRUE)
TGString * GetItemName() const
This class handles GUI labels.
This class describes layout hints used by the layout classes.
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
A list view is a widget that can contain a number of items arranged in a grid or list.
virtual void SetIncrements(Int_t hInc, Int_t vInc)
Set horizontal and vertical scrollbar increments.
TGTextButton ** GetHeaderButtons()
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode.
virtual void SetContainer(TGFrame *f)
Set list view container.
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
TGClient * fClient
Connection to display server.
const char * GetString() const
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
void AddText(Int_t pos, const char *text)
const char * GetString() const
UInt_t GetTextLength() const
Yield an action as soon as it is clicked.
virtual const char * GetTitle() const
Returns title of object.
TString GetString() const
A TGTextEntry is a one line text input widget.
virtual void SetFocus()
Set focus to this text entry.
virtual void SelectAll()
Selects all text (i.e.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Text string listbox entries.
Defines transient windows that typically are used for dialogs windows.
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
@ kEditDisable
disable edit of this window
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Collectable string class.
const TString & GetString() const
R__ALWAYS_INLINE Bool_t IsZombie() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Bool_t cd(const char *path)
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual int MakeDirectory(const char *name)
Make a directory.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual const char * WorkingDirectory()
Return working directory.
Short_t Max(Short_t a, Short_t b)