KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVFileDialog.cpp
Go to the documentation of this file.
1 // @(#)root/gui:$Id: KVFileDialog.cxx 43842 2012-04-19 13:09:11Z bellenot $
2 // Author: Fons Rademakers 20/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 
13 #include "KVFileDialog.h"
14 #include "TGLabel.h"
15 #include "TGButton.h"
16 #include "TGTextEntry.h"
17 #include "TGComboBox.h"
18 #include "TGListView.h"
19 #include "TGFSContainer.h"
20 #include "TGFSComboBox.h"
21 #include "TGMsgBox.h"
22 #include "TSystem.h"
23 #include "TGInputDialog.h"
24 #include "TObjString.h"
25 
26 #include <sys/stat.h>
27 
28 
30 
41 };
42 
43 
44 
46 
47 static const char* gDefTypes[] = { "All files", "*",
48  "ROOT files", "*.root",
49  "ROOT macros", "*.C",
50  0, 0
51  };
52 
53 
55 
56 
58 
59 
60 
61 
66  EKVFileDialogMode dlg_type, TGFileInfo* file_info) :
67  TGTransientFrame(p, main, 10, 10, kVerticalFrame)
68 {
69  // Create a file selection dialog. Depending on the dlg_type it can be
70  // used for opening or saving a file or selecting a directory.
71 
72  fDlgMode = dlg_type;
73  SetCleanup(kDeepCleanup);
74  Connect("CloseWindow()", "KVFileDialog", this, "CloseWindow()");
75  DontCallClose();
76 
77  int i;
78 
79  if (!p && !main) {
80  MakeZombie();
81  return;
82  }
83  if (!file_info) {
84  Error("KVFileDialog", "file_info argument not set");
85  fFileInfo = &gInfo;
86  if (fFileInfo->fIniDir) {
87  delete [] fFileInfo->fIniDir;
88  fFileInfo->fIniDir = 0;
89  }
90  if (fFileInfo->fFilename) {
91  delete [] fFileInfo->fFilename;
92  fFileInfo->fFilename = 0;
93  }
94  fFileInfo->fFileTypeIdx = 0;
95  }
96  else
97  fFileInfo = file_info;
98 
99  if (!fFileInfo->fFileTypes)
100  fFileInfo->fFileTypes = gDefTypes;
101 
102  if (!fFileInfo->fIniDir)
103  fFileInfo->fIniDir = StrDup(".");
104 
105  TGHorizontalFrame* fHtop = new TGHorizontalFrame(this, 10, 10);
106 
107  //--- top toolbar elements
108  TGLabel* fLookin = new TGLabel(fHtop, new TGHotString((dlg_type == kKVFDSave)
109  ? "S&ave in:" : "&Look in:"));
110  fTreeLB = new TGFSComboBox(fHtop, kIDF_FSLB);
111  fTreeLB->Associate(this);
112 
113  fPcdup = fClient->GetPicture("tb_uplevel.xpm");
114  fPnewf = fClient->GetPicture("tb_newfolder.xpm");
115  fPlist = fClient->GetPicture("tb_list.xpm");
116  fPdetails = fClient->GetPicture("tb_details.xpm");
117 
118  if (!(fPcdup && fPnewf && fPlist && fPdetails))
119  Error("KVFileDialog", "missing toolbar pixmap(s).\n");
120 
121  fCdup = new TGPictureButton(fHtop, fPcdup, kIDF_CDUP);
122  fNewf = new TGPictureButton(fHtop, fPnewf, kIDF_NEW_FOLDER);
123  fList = new TGPictureButton(fHtop, fPlist, kIDF_LIST);
124  fDetails = new TGPictureButton(fHtop, fPdetails, kIDF_DETAILS);
125 
126  fCdup->SetStyle(gClient->GetStyle());
127  fNewf->SetStyle(gClient->GetStyle());
128  fList->SetStyle(gClient->GetStyle());
129  fDetails->SetStyle(gClient->GetStyle());
130 
131  fCdup->SetToolTipText("Up One Level");
132  fNewf->SetToolTipText("Create New Folder");
133  fList->SetToolTipText("List");
134  fDetails->SetToolTipText("Details");
135 
136  fCdup->Associate(this);
137  fNewf->Associate(this);
138  fList->Associate(this);
139  fDetails->Associate(this);
140 
141  fList->AllowStayDown(kTRUE);
142  fDetails->AllowStayDown(kTRUE);
143 
144  fTreeLB->Resize(200, fTreeLB->GetDefaultHeight());
145 
146  fHtop->AddFrame(fLookin, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 5, 2, 2));
147  fHtop->AddFrame(fTreeLB, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 3, 0, 2, 2));
148  fHtop->AddFrame(fCdup, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 2, 2));
149  fHtop->AddFrame(fNewf, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 2, 2));
150  fHtop->AddFrame(fList, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 2, 2));
151  fHtop->AddFrame(fDetails, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 8, 2, 2));
152 
153  if (dlg_type == kKVFDSave) {
154  fCheckB = new TGCheckButton(fHtop, "&Overwrite", kIDF_CHECKB);
155  fCheckB->SetToolTipText("Overwrite a file without displaying a message if selected");
156  }
157  else {
158  fCheckB = new TGCheckButton(fHtop, "&Multiple files", kIDF_CHECKB);
159  fCheckB->SetToolTipText("Allows multiple file selection when SHIFT is pressed");
160  fCheckB->Connect("Toggled(Bool_t)", "TGFileInfo", fFileInfo, "SetMultipleSelection(Bool_t)");
161  }
162  fHtop->AddFrame(fCheckB, new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
163  fCheckB->SetOn(fFileInfo->fMultipleSelection);
164  AddFrame(fHtop, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 4, 4, 3, 1));
165 
166  //--- file view
167 
168  fFv = new TGListView(this, 400, 161);
169 
170  fFc = new TGFileContainer(fFv->GetViewPort(),
171  10, 10, kHorizontalFrame, fgWhitePixel);
172  fFc->Associate(this);
173 
174  fFv->GetViewPort()->SetBackgroundColor(fgWhitePixel);
175  fFv->SetContainer(fFc);
176  fFv->SetViewMode(kLVList);
177  fFv->SetIncrements(1, 19); // set vertical scroll one line height at a time
178 
179  TGTextButton** buttons = fFv->GetHeaderButtons();
180  if (buttons) {
181  buttons[0]->Connect("Clicked()", "TGFileContainer", fFc, "Sort(=kSortByName)");
182  buttons[1]->Connect("Clicked()", "TGFileContainer", fFc, "Sort(=kSortByType)");
183  buttons[2]->Connect("Clicked()", "TGFileContainer", fFc, "Sort(=kSortBySize)");
184  buttons[3]->Connect("Clicked()", "TGFileContainer", fFc, "Sort(=kSortByOwner)");
185  buttons[4]->Connect("Clicked()", "TGFileContainer", fFc, "Sort(=kSortByGroup)");
186  buttons[5]->Connect("Clicked()", "TGFileContainer", fFc, "Sort(=kSortByDate)");
187  }
188 
189  fFc->SetFilter(fFileInfo->fFileTypes[fFileInfo->fFileTypeIdx + 1]);
190  fFc->Sort(kSortByName);
191  fFc->ChangeDirectory(fFileInfo->fIniDir);
192  fFc->SetMultipleSelection(fFileInfo->fMultipleSelection);
193  fTreeLB->Update(fFc->GetDirectory());
194 
195  fList->SetState(kButtonEngaged);
196 
197  AddFrame(fFv, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 4, 4, 3, 1));
198 
199  if (dlg_type == kKVFDOpen) {
200  fCheckB->Connect("Toggled(Bool_t)", "TGFileContainer", fFc, "SetMultipleSelection(Bool_t)");
201  fCheckB->Connect("Toggled(Bool_t)", "TGFileContainer", fFc, "UnSelectAll()");
202  }
203 
204  //--- file name and types
205 
206  TGHorizontalFrame* fHf = new TGHorizontalFrame(this, 10, 10);
207 
208  TGVerticalFrame* fVf = new TGVerticalFrame(fHf, 10, 10);
209 
210  TGHorizontalFrame* fHfname = new TGHorizontalFrame(fVf, 10, 10);
211 
212  TGLabel* fLfname = new TGLabel(fHfname, new TGHotString("File &name:"));
213  fTbfname = new TGTextBuffer(1034);
214  fName = new TGTextEntry(fHfname, fTbfname);
215  fName->Resize(230, fName->GetDefaultHeight());
216  fName->Associate(this);
217 
218  fHfname->AddFrame(fLfname, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 5, 2, 2));
219  fHfname->AddFrame(fName, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 0, 20, 2, 2));
220 
222 
223  TGHorizontalFrame* fHftype = new TGHorizontalFrame(fVf, 10, 10);
224 
225  TGLabel* fLftypes = new TGLabel(fHftype, new TGHotString("Files of &type:"));
226  fTypes = new TGComboBox(fHftype, kIDF_FTYPESLB);
227  fTypes->Associate(this);
228  fTypes->Resize(230, fName->GetDefaultHeight());
229 
230  TString s;
231  for (i = 0; fFileInfo->fFileTypes[i] != 0; i += 2) {
232  s.Form("%s (%s)", fFileInfo->fFileTypes[i], fFileInfo->fFileTypes[i + 1]);
233  fTypes->AddEntry(s.Data(), i);
234  }
235  fTypes->Select(fFileInfo->fFileTypeIdx);
236 
237  // Show all items in combobox without scrollbar
238  //TGDimension fw = fTypes->GetListBox()->GetContainer()->GetDefaultSize();
239  //fTypes->GetListBox()->Resize(fw.fWidth, fw.fHeight);
240 
241  if (fFileInfo->fFilename && fFileInfo->fFilename[0])
242  fTbfname->AddText(0, fFileInfo->fFilename);
243  else
244  fTbfname->Clear();
245 
246  fTypes->GetListBox()->Resize(230, 120);
247  fHftype->AddFrame(fLftypes, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 5, 2, 2));
248  fHftype->AddFrame(fTypes, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 0, 20, 2, 2));
249 
251 
253 
254  //--- Open/Save and Cancel buttons
255 
256  TGVerticalFrame* fVbf = new TGVerticalFrame(fHf, 10, 10, kFixedWidth);
257 
258  fOk = new TGTextButton(fVbf, new TGHotString((dlg_type == kKVFDSave)
259  ? "&Save" : "&Open"), kIDF_OK);
260  fCancel = new TGTextButton(fVbf, new TGHotString("Cancel"), kIDF_CANCEL);
261 
262  fOk->Associate(this);
263  fCancel->Associate(this);
264 
265  fVbf->AddFrame(fOk, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 2, 2));
266  fVbf->AddFrame(fCancel, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 2, 2));
267 
268  UInt_t width = TMath::Max(fOk->GetDefaultWidth(), fCancel->GetDefaultWidth()) + 20;
269  fVbf->Resize(width + 20, fVbf->GetDefaultHeight());
270 
272 
273  AddFrame(fHf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 4, 4, 3, 1));
274  SetEditDisabled(kEditDisable);
275 
276  MapSubwindows();
277 
278  TGDimension size = GetDefaultSize();
279 
280  Resize(size);
281 
282  //---- position relative to the parent's window
283 
284  CenterOnParent();
285 
286  //---- make the message box non-resizable
287 
288  SetWMSize(size.fWidth, size.fHeight);
289  SetWMSizeHints(size.fWidth, size.fHeight, 10000, 10000, 1, 1);
290 
291  const char* wname = ((dlg_type == kKVFDSave) ? "Save As..." : (dlg_type == kKVFDOpen) ? "Open" : "Choose directory...");
292  SetWindowName(wname);
293  SetIconName(wname);
294  SetClassHints("FileDialog", "FileDialog");
295 
301 
302  MapWindow();
303  fFc->DisplayDirectory();
304  fClient->WaitFor(this);
305 }
306 
307 
308 
311 
313 {
314  // Delete file dialog.
315 
316  if (IsZombie()) return;
318  if (str.Contains("Multiple"))
319  fCheckB->Disconnect("Toggled(Bool_t)");
324  delete fFc;
325 }
326 
327 
328 
331 
333 {
334  // Close file dialog.
335 
336  if (fFileInfo->fFilename)
337  delete [] fFileInfo->fFilename;
338  fFileInfo->fFilename = 0;
339  if (fFileInfo->fFileNamesList != 0) {
342  }
343  DeleteWindow();
344 }
345 
346 
347 
350 
352 {
353  // Process messages generated by the user input in the file dialog.
354 
355  if (!fFc->GetDisplayStat()) return kTRUE; // Cancel button was pressed
356 
357  TGTreeLBEntry* e;
358  TGTextLBEntry* te;
359  TGFileItem* f;
360  void* p = 0;
361  TString txt;
362  TString sdir = gSystem->WorkingDirectory();
363 
364  switch (GET_MSG(msg)) {
365  case kC_COMMAND:
366  switch (GET_SUBMSG(msg)) {
367  case kCM_BUTTON:
368  switch (parm1) {
369  case kIDF_OK:
370  // same code as under kTE_ENTER
371  if ((fDlgMode != kKVFDDirectory) && (fTbfname->GetTextLength() == 0)) {
372  txt = "Please provide file name or use \"Cancel\"";
374  "Missing File Name", txt, kMBIconExclamation,
375  kMBOk);
376  return kTRUE;
377  }
379  !strcmp(fOk->GetTitle(), "Save") &&
380  (!(fCheckB->GetState() == kButtonDown))) {
381  Int_t ret;
382  txt = TString::Format("File name %s already exists, OK to overwrite it?",
383  fTbfname->GetString());
385  "File Name Exist", txt.Data(), kMBIconExclamation,
386  kMBYes | kMBNo, &ret);
387  if (ret == kMBNo)
388  return kTRUE;
389  }
391  if (fFileInfo->fFilename)
392  delete [] fFileInfo->fFilename;
393  fFileInfo->fFilename = 0;
394  }
395  else {
396  if (fFileInfo->fFilename)
397  delete [] fFileInfo->fFilename;
400  else
402  fTbfname->GetString());
404  }
405  if (fCheckB && (fCheckB->GetState() == kButtonDown))
407  else
409  DeleteWindow();
410  break;
411 
412  case kIDF_CANCEL:
413  if (fFileInfo->fFilename)
414  delete [] fFileInfo->fFilename;
415  fFileInfo->fFilename = 0;
416  if (fFc->GetDisplayStat())
418  if (fFileInfo->fFileNamesList != 0) {
421  }
422  DeleteWindow();
423  return kTRUE; //no need to redraw fFc
424  break;
425 
426  case kIDF_CDUP:
427  fFc->ChangeDirectory("..");
429  if (fFileInfo->fIniDir) delete [] fFileInfo->fIniDir;
431  if (strcmp(gSystem->WorkingDirectory(), fFc->GetDirectory())) {
432  gSystem->cd(fFc->GetDirectory());
433  }
434  break;
435 
436  case kIDF_NEW_FOLDER: {
437  char answer[128];
438  strlcpy(answer, "(empty)", sizeof(answer));
439  new TGInputDialog(gClient->GetRoot(), GetMainFrame(),
440  "Enter directory name:",
441  answer/*"(empty)"*/, answer);
442 
443  while (strcmp(answer, "(empty)") == 0) {
444  new TGMsgBox(gClient->GetRoot(), GetMainFrame(), "Error",
445  "Please enter a valid directory name.",
446  kMBIconStop, kMBOk);
447  new TGInputDialog(gClient->GetRoot(), GetMainFrame(),
448  "Enter directory name:",
449  answer, answer);
450  }
451  if (strcmp(answer, "") == 0) // Cancel button was pressed
452  break;
453 
454  if (strcmp(gSystem->WorkingDirectory(), fFc->GetDirectory())) {
455  gSystem->cd(fFc->GetDirectory());
456  }
457  if (gSystem->MakeDirectory(answer) != 0)
458  new TGMsgBox(gClient->GetRoot(), GetMainFrame(), "Error",
459  TString::Format("Directory name \'%s\' already exists!", answer),
460  kMBIconStop, kMBOk);
461  else {
463  }
464  gSystem->ChangeDirectory(sdir.Data());
465  break;
466  }
467 
468  case kIDF_LIST:
471  break;
472 
473  case kIDF_DETAILS:
476  break;
477  }
478  break;
479 
480  case kCM_COMBOBOX:
481  switch (parm1) {
482  case kIDF_FSLB:
484  if (e) {
485  fFc->ChangeDirectory(e->GetPath()->GetString());
487  if (fFileInfo->fIniDir) delete [] fFileInfo->fIniDir;
489  if (strcmp(gSystem->WorkingDirectory(), fFc->GetDirectory())) {
490  gSystem->cd(fFc->GetDirectory());
491  }
492  }
493  break;
494 
495  case kIDF_FTYPESLB:
497  if (te) {
498  //fTbfname->Clear();
499  //fTbfname->AddText(0, fFileInfo->fFileTypes[te->EntryId()+1]);
500  fFileInfo->fFileTypeIdx = te->EntryId();
504  }
505  break;
506  }
507  break;
508 
509  default:
510  break;
511  } // switch(GET_SUBMSG(msg))
512  break;
513 
514  case kC_CONTAINER:
515  switch (GET_SUBMSG(msg)) {
516  case kCT_ITEMCLICK:
517  if (parm1 == kButton1) {
518  if (fFc->NumSelected() > 0) {
520  TGLVEntry* e2 = (TGLVEntry*) fFc->GetNextSelected(&p);
521  if ((e2) && !R_ISDIR(((TGFileItem*)e2)->GetType())) {
522  fTbfname->Clear();
523  if (e2->GetItemName())
524  fTbfname->AddText(0, e2->GetItemName()->GetString());
526  }
527  }
528  else {
529  TString tmpString;
530  TList* tmp = fFc->GetSelectedItems();
531  TObjString* el;
532  TIter next(tmp);
533  if (fFileInfo->fFileNamesList != 0) {
535  }
536  else {
537  fFileInfo->fFileNamesList = new TList();
538  }
539  while ((el = (TObjString*) next())) {
541  el->GetString());
542  tmpString += "\"" + el->GetString() + "\" ";
544  delete [] s;
545  }
546  fTbfname->Clear();
547  fTbfname->AddText(0, tmpString);
549  }
550  }
551  }
552  break;
553 
554  case kCT_ITEMDBLCLICK:
555 
556  if (parm1 == kButton1) {
557  if (fFc->NumSelected() == 1) {
558  f = (TGFileItem*) fFc->GetNextSelected(&p);
559  if (f && R_ISDIR(f->GetType())) {
560  fFc->ChangeDirectory(f->GetItemName()->GetString());
562  if (fFileInfo->fIniDir) delete [] fFileInfo->fIniDir;
564  if (strcmp(gSystem->WorkingDirectory(), fFc->GetDirectory())) {
565  gSystem->cd(fFc->GetDirectory());
566  }
567  }
568  else {
569  if (!strcmp(fOk->GetTitle(), "Save") &&
570  (!(fCheckB->GetState() == kButtonDown))) {
571 
572  Int_t ret;
573  txt = TString::Format("File name %s already exists, OK to overwrite it?",
574  fTbfname->GetString());
576  "File Name Exist", txt.Data(), kMBIconExclamation,
577  kMBYes | kMBNo, &ret);
578  if (ret == kMBNo)
579  return kTRUE;
580  }
581  if (fFileInfo->fFilename)
582  delete [] fFileInfo->fFilename;
585  else
587  fTbfname->GetString());
589  if (fCheckB && (fCheckB->GetState() == kButtonDown))
591  else
593 
594  DeleteWindow();
595  }
596  }
597  }
598 
599  break;
600 
601  default:
602  break;
603 
604  } // switch(GET_SUBMSG(msg))
605  break;
606 
607  case kC_TEXTENTRY:
608  switch (GET_SUBMSG(msg)) {
609  case kTE_ENTER:
610  // same code as under kIDF_OK
611  if ((fDlgMode != kKVFDDirectory) && (fTbfname->GetTextLength() == 0)) {
612  const char* txt2 = "Please provide file name or use \"Cancel\"";
614  "Missing File Name", txt2, kMBIconExclamation,
615  kMBOk);
616  return kTRUE;
617  }
619  FileStat_t buf;
620  if (!gSystem->GetPathInfo(fTbfname->GetString(), buf) &&
621  R_ISDIR(buf.fMode)) {
624  if (strcmp(gSystem->WorkingDirectory(), fFc->GetDirectory())) {
625  gSystem->cd(fFc->GetDirectory());
626  }
627  fName->SetText("", kFALSE);
628  return kTRUE;
629  }
630  else if (!strcmp(fOk->GetTitle(), "Save") &&
631  (!(fCheckB->GetState() == kButtonDown))) {
632  Int_t ret;
633  txt = TString::Format("File name %s already exists, OK to overwrite it?",
634  fTbfname->GetString());
636  "File Name Exist", txt.Data(), kMBIconExclamation,
637  kMBYes | kMBNo, &ret);
638  if (ret == kMBNo)
639  return kTRUE;
640  }
641  }
642  if (fFileInfo->fFilename)
643  delete [] fFileInfo->fFilename;
645  fTbfname->GetString());
647  if (fCheckB && (fCheckB->GetState() == kButtonDown))
649  else
651  DeleteWindow();
652  break;
653 
654  default:
655  break;
656  }
657  break;
658 
659  default:
660  break;
661 
662  } // switch(GET_MSG(msg))
663 
665  return kTRUE;
666 }
667 
668 
int Int_t
unsigned int UInt_t
long Long_t
kFixedWidth
kHorizontalFrame
kButton1
#define str(s)
Definition: KVBase.cpp:57
@ kIDF_OK
@ kIDF_FTYPESLB
@ kIDF_FSLB
@ kIDF_CDUP
@ kIDF_DETAILS
@ kIDF_NEW_FOLDER
@ kIDF_CHECKB
@ kIDF_LIST
@ kIDF_CANCEL
static TGFileInfo gInfo
static const char * gDefTypes[]
EKVFileDialogMode
Definition: KVFileDialog.h:31
@ kKVFDOpen
Definition: KVFileDialog.h:32
@ kKVFDDirectory
Definition: KVFileDialog.h:33
@ kKVFDSave
Definition: KVFileDialog.h:34
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define f(i)
#define e(i)
size_t size(const MatrixT &matrix)
const Bool_t kFALSE
bool Bool_t
const Bool_t kTRUE
include TDocParser_001 C image html pict1_TDocParser_001 png width
kButtonDown
kButtonUp
kButtonEngaged
#define gClient
kSortByName
EFileFialog
kMWMDecorResizeH
kMWMFuncAll
kMWMFuncResize
kMWMDecorMaximize
kMWMDecorMinimize
kMWMDecorMenu
kMWMDecorAll
kMWMFuncMaximize
kMWMInputModeless
kMWMFuncMinimize
kDeepCleanup
kLHintsRight
kLHintsExpandY
kLHintsLeft
kLHintsCenterY
kLHintsTop
kLHintsExpandX
kLVDetails
kLVList
kMBNo
kMBYes
kMBOk
kMBIconExclamation
kMBIconStop
char * StrDup(const char *str)
kFileExists
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
Int_t GET_MSG(Long_t val)
kCM_COMBOBOX
kTE_ENTER
kCT_ITEMCLICK
kC_COMMAND
kCM_BUTTON
kC_TEXTENTRY
kCT_ITEMDBLCLICK
kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
Modified version of TGFileDialog file selection dialog.
Definition: KVFileDialog.h:48
virtual ~KVFileDialog()
Delete file dialog.
TGPictureButton * fList
top toolbar button
Definition: KVFileDialog.h:57
const TGPicture * fPlist
picture for fList
Definition: KVFileDialog.h:63
TGTextBuffer * fTbfname
text buffer of file name
Definition: KVFileDialog.h:51
TGTextButton * fOk
ok button
Definition: KVFileDialog.h:65
TGCheckButton * fCheckB
Definition: KVFileDialog.h:59
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the user input in the file dialog.
TGTextEntry * fName
file name text entry
Definition: KVFileDialog.h:52
TGFileInfo * fFileInfo
file info passed to this dialog
Definition: KVFileDialog.h:69
EKVFileDialogMode fDlgMode
Definition: KVFileDialog.h:70
TGComboBox * fTypes
file type combo box
Definition: KVFileDialog.h:53
TGFSComboBox * fTreeLB
file system path combo box
Definition: KVFileDialog.h:54
TGListView * fFv
file list view
Definition: KVFileDialog.h:67
TGPictureButton * fDetails
top toolbar button
Definition: KVFileDialog.h:58
const TGPicture * fPcdup
OR set on/off multiple file selection for SaveAs dialog.
Definition: KVFileDialog.h:61
TGFileContainer * fFc
file list view container (containing the files)
Definition: KVFileDialog.h:68
virtual void CloseWindow()
Close file dialog.
const TGPicture * fPdetails
picture for fDetails
Definition: KVFileDialog.h:64
const TGPicture * fPnewf
picture for fNewf
Definition: KVFileDialog.h:62
virtual EButtonState GetState() const
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
const TGWindow * GetRoot() const
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
void FreePicture(const TGPicture *pic)
virtual TGLBEntry * GetSelectedEntry() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
virtual UInt_t GetDefaultHeight() const
virtual const TGFrame * GetNextSelected(void **current)
virtual Int_t NumSelected() const
virtual void Update(const char *path)
virtual void SetDisplayStat(Bool_t stat=kTRUE)
const char * GetDirectory() const
virtual void ChangeDirectory(const char *path)
virtual void DisplayDirectory()
virtual void SetFilter(const char *filter)
Bool_t GetDisplayStat()
TList * fFileNamesList
char * fFilename
Int_t fFileTypeIdx
const char ** fFileTypes
char * fIniDir
Bool_t fOverwrite
Bool_t fMultipleSelection
virtual void Resize(TGDimension size)
virtual void DeleteWindow()
Int_t EntryId() const
TList * GetSelectedItems()
TGString * GetItemName() const
virtual void SetViewMode(EListViewMode viewMode)
TGClient * fClient
const char * GetString() const
void AddText(Int_t pos, const char *text)
const char * GetString() const
UInt_t GetTextLength() const
virtual const char * GetTitle() const
TString GetString() const
virtual void SetText(const char *text, Bool_t emit=kTRUE)
virtual const TGWindow * GetMainFrame() const
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
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)
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
const char * Data() const
static TString Format(const char *fmt,...)
Bool_t cd(const char *path)
virtual char * ConcatFileName(const char *dir, const char *name)
virtual int MakeDirectory(const char *name)
virtual int GetPathInfo(const char *path, FileStat_t &buf)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
virtual Bool_t ChangeDirectory(const char *path)
virtual const char * UnixPathName(const char *unixpathname)
virtual Bool_t IsAbsoluteFileName(const char *dir)
virtual char * ExpandPathName(const char *path)
virtual const char * WorkingDirectory()
int main(int argc, char **argv)
const long double s
Definition: KVUnits.h:94
void Error(const char *location, const char *va_(fmt),...)
Type GetType(const std::string &Name)
Double_t Max(Double_t a, Double_t b)