Logo ROOT   6.10/09
Reference Guide
TGTextEditor.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id: ca18aae7f02ae8574b0c5414c78ede465425855d $
2 // Author: Bertrand Bellenot 20/06/06
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  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 //////////////////////////////////////////////////////////////////////////
24 // //
25 // TGTextEditor //
26 // //
27 // A simple text editor that uses the TGTextEdit widget. //
28 // It provides all functionalities of TGTextEdit as copy, paste, cut, //
29 // search, go to a given line number. In addition, it provides the //
30 // possibilities for compiling, executing or interrupting a running //
31 // macro. //
32 // //
33 // This class can be used in following ways: //
34 // - with file name as argument: //
35 // new TGTextEditor("hsimple.C"); //
36 // - with a TMacro* as argument: //
37 // TMacro *macro = new TMacro("hsimple.C"); //
38 // new TGTextEditor(macro); //
39 // //
40 // Basic Features: //
41 // //
42 // New Document //
43 // //
44 // To create a new blank document, select File menu / New, or click //
45 // the New toolbar button. It will create a new instance of //
46 // TGTextEditor. //
47 // //
48 // Open/Save File //
49 // //
50 // To open a file, select File menu / Open or click on the Open //
51 // toolbar button. This will bring up the standard File Dialog for //
52 // opening files. //
53 // If the current document has not been saved yet, you will be asked //
54 // either to save or abandon the changes. //
55 // To save the file using the same name, select File menu / Save or //
56 // the toolbar Save button. To change the file name use File menu / //
57 // Save As... or corresponding SaveAs button on the toolbar. //
58 // //
59 // Text Selection //
60 // //
61 // You can move the cursor by simply clicking on the desired location //
62 // with the left mouse button. To highlight some text, press the mouse //
63 // and drag the mouse while holding the left button pressed. //
64 // To select a word, double-click on it; //
65 // to select the text line - triple-click on it; //
66 // to select all do quadruple-click. //
67 // //
68 // Cut, Copy, Paste //
69 // //
70 // After selecting some text, you can cut or copy it to the clipboard. //
71 // A subsequent paste operation will insert the contents of the //
72 // clipboard at the current cursor location. //
73 // //
74 // Text Search //
75 // //
76 // The editor uses a standard Search dialog. You can specify a forward //
77 // or backward search direction starting from the current cursor //
78 // location according to the selection made of a case sensitive mode //
79 // or not. The last search can be repeated by pressing F3. //
80 // //
81 // Text Font //
82 // //
83 // You can change the text font by selecting Edit menu / Set Font. //
84 // The Font Dialog pops up and shows the Name, Style, and Size of any //
85 // available font. The selected font sample is shown in the preview //
86 // area. //
87 // //
88 // Executing Macros //
89 // //
90 // You can execute the currently loaded macro in the editor by //
91 // selecting Tools menu / Execute Macro; by clicking on the //
92 // corresponding toolbar button, or by using Ctrl+F5 accelerator keys. //
93 // This is identical to the command ".x macro.C" in the root prompt //
94 // command line. //
95 // //
96 // Compiling Macros //
97 // //
98 // The currently loaded macro can be compiled with ACLiC if you select //
99 // Tools menu / Compile Macro; by clicking on the corresponding //
100 // toolbar button, or by using Ctrl+F7 accelerator keys. //
101 // This is identical to the command ".L macro.C++" in the root prompt //
102 // command line. //
103 // //
104 // Interrupting a Running Macro //
105 // //
106 // You can interrupt a running macro by selecting the Tools menu / //
107 // Interrupt; by clicking on the corresponding toolbar button, or by //
108 // using Shift+F5 accelerator keys. //
109 // //
110 // Interface to CINT Interpreter //
111 // //
112 // Any command entered in the Command combo box will be passed to //
113 // the CINT interpreter. This combo box will keep the commands history //
114 // and will allow you to re-execute the same commands during an editor //
115 // session. //
116 // //
117 // Keyboard Bindings //
118 // //
119 // The following table lists the keyboard shortcuts and accelerator //
120 // keys. //
121 // //
122 // Key: Action: //
123 // ==== ======= //
124 // //
125 // Up Move cursor up. //
126 // Shift+Up Move cursor up and extend selection. //
127 // Down Move cursor down. //
128 // Shift+Down Move cursor down and extend selection. //
129 // Left Move cursor left. //
130 // Shift+Left Move cursor left and extend selection. //
131 // Right Move cursor right. //
132 // Shift+Right Move cursor right and extend selection. //
133 // Home Move cursor to begin of line. //
134 // Shift+Home Move cursor to begin of line and extend selection.//
135 // Ctrl+Home Move cursor to top of page. //
136 // End Move cursor to end of line. //
137 // Shift+End Move cursor to end of line and extend selection. //
138 // Ctrl+End Move cursor to end of page. //
139 // PgUp Move cursor up one page. //
140 // Shift+PgUp Move cursor up one page and extend selection. //
141 // PgDn Move cursor down one page. //
142 // Shift+PgDn Move cursor down one page and extend selection. //
143 // Delete Delete character after cursor, or text selection. //
144 // BackSpace Delete character before cursor, or text selection.//
145 // Ctrl+B Move cursor left. //
146 // Ctrl+D Delete character after cursor, or text selection. //
147 // Ctrl+E Move cursor to end of line. //
148 // Ctrl+H Delete character before cursor, or text selection.//
149 // Ctrl+K Delete characters from current position to the //
150 // end of line. //
151 // Ctrl+U Delete current line. //
152 // //
153 //Begin_Html
154 /*
155 <img src="gif/TGTextEditor.gif">
156 */
157 //End_Html
158 // //
159 //////////////////////////////////////////////////////////////////////////
160 
161 
162 #include "TROOT.h"
163 #include "TApplication.h"
164 #include "TSystem.h"
165 #include "TMacro.h"
166 #include "TInterpreter.h"
167 #include "TGMsgBox.h"
168 #include "TGFileDialog.h"
169 #include "TGFontDialog.h"
170 #include "TGTextEdit.h"
171 #include "TGMenu.h"
172 #include "TGButton.h"
173 #include "TGStatusBar.h"
174 #include "KeySymbols.h"
175 #include "TGToolBar.h"
176 #include "TG3DLine.h"
177 #include "TGLabel.h"
178 #include "TGTextEntry.h"
179 #include "TGTextEditDialogs.h"
180 #include "TGTextEditor.h"
181 #include "TGComboBox.h"
182 #include "TObjString.h"
183 #include "TRootHelpDialog.h"
184 #include "HelpText.h"
185 #ifdef WIN32
186 #include "TWin32SplashThread.h"
187 #endif
188 
189 const char *ed_filetypes[] = {
190  "ROOT Macros", "*.C",
191  "Source files", "*.cxx",
192  "Text files", "*.txt",
193  "All files", "*",
194  0, 0
195 };
196 
203 };
204 
206  { "ed_new.png", "New File", kFALSE, kM_FILE_NEW, 0 },
207  { "ed_open.png", "Open File", kFALSE, kM_FILE_OPEN, 0 },
208  { "ed_save.png", "Save File", kFALSE, kM_FILE_SAVE, 0 },
209  { "ed_saveas.png", "Save File As...", kFALSE, kM_FILE_SAVEAS, 0 },
210  { "", 0, 0, -1, 0 },
211  { "ed_print.png", "Print", kFALSE, kM_FILE_PRINT, 0 },
212  { "", 0, 0, -1, 0 },
213  { "ed_cut.png", "Cut selection", kFALSE, kM_EDIT_CUT, 0 },
214  { "ed_copy.png", "Copy selection", kFALSE, kM_EDIT_COPY, 0 },
215  { "ed_paste.png", "Paste selection", kFALSE, kM_EDIT_PASTE, 0 },
216  { "ed_delete.png", "Delete selection", kFALSE, kM_EDIT_DELETE, 0 },
217  { "", 0, 0, -1, 0 },
218  { "ed_find.png", "Find...", kFALSE, kM_SEARCH_FIND, 0 },
219  { "ed_findnext.png", "Find next", kFALSE, kM_SEARCH_FINDNEXT, 0 },
220  { "ed_goto.png", "Goto...", kFALSE, kM_SEARCH_GOTO, 0 },
221  { "", 0, 0, -1, 0 },
222  { "ed_compile.png", "Compile Macro", kFALSE, kM_TOOLS_COMPILE, 0 },
223  { "ed_execute.png", "Execute Macro", kFALSE, kM_TOOLS_EXECUTE, 0 },
224  { "ed_interrupt.png", "Interrupt", kFALSE, kM_TOOLS_INTERRUPT, 0 },
225  { "", 0, 0, -1, 0 },
226  { "ed_help.png", "Help Contents", kFALSE, kM_HELP_CONTENTS, 0 },
227  { "", 0, 0, -1, 0 },
228  { "ed_quit.png", "Close Editor", kFALSE, kM_FILE_EXIT, 0 },
229  { 0, 0, 0, 0, 0 }
230 };
231 
232 static char *gEPrinter = 0;
233 static char *gEPrintCommand = 0;
234 
236 
237 ////////////////////////////////////////////////////////////////////////////////
238 /// TGTextEditor constructor with file name as first argument.
239 
240 TGTextEditor::TGTextEditor(const char *filename, const TGWindow *p, UInt_t w,
241  UInt_t h) : TGMainFrame(p, w, h)
242 {
243  Build();
244  if (p && p != gClient->GetDefaultRoot()) {
245  // special case for TRootBrowser
246  // remove the command line combo box and its associated label
247  fComboCmd->UnmapWindow();
248  fToolBar->RemoveFrame(fComboCmd);
249  fLabel->UnmapWindow();
250  fToolBar->RemoveFrame(fLabel);
251  fToolBar->GetButton(kM_FILE_EXIT)->SetState(kButtonDisabled);
252  fToolBar->Layout();
253  }
254  if (filename) {
255  LoadFile(filename);
256  }
257  MapWindow();
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 /// TGTextEditor constructor with pointer to a TMacro as first argument.
262 
264  TGMainFrame(p, w, h)
265 {
266  TString tmp;
267  Build();
268  if (p && p != gClient->GetDefaultRoot()) {
269  // special case for TRootBrowser
270  // remove the command line combo box and its associated label
272  fLabel->UnmapWindow();
275  fToolBar->Layout();
276  }
277  if (macro) {
278  fMacro = macro;
279  TIter next(macro->GetListOfLines());
280  TObjString *obj;
281  while ((obj = (TObjString*) next())) {
282  fTextEdit->AddLine(obj->GetName());
283  }
284  tmp.Form("TMacro : %s: %ld lines read.",
285  macro->GetName(), fTextEdit->ReturnLineCount());
286  fStatusBar->SetText(tmp.Data(), 0);
287  fFilename = macro->GetName();
288  fFilename += ".C";
289  tmp.Form("TMacro : %s - TGTextEditor", macro->GetName());
290  SetWindowName(tmp.Data());
291  }
292  MapWindow();
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// TGTextEditor destructor.
297 
299 {
300  gApplication->Disconnect("Terminate(Int_t)");
301  if (fTimer) delete fTimer;
302  if (fMenuFile) delete fMenuFile;
303  if (fMenuEdit) delete fMenuEdit;
304  if (fMenuSearch) delete fMenuSearch;
305  if (fMenuTools) delete fMenuTools;
306  if (fMenuHelp) delete fMenuHelp;
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Delete TGTextEditor Window.
311 
313 {
314  gApplication->Disconnect("Terminate(Int_t)");
315  delete fTimer; fTimer = 0;
316  delete fMenuFile; fMenuFile = 0;
317  delete fMenuEdit; fMenuEdit = 0;
318  delete fMenuSearch; fMenuSearch = 0;
319  delete fMenuTools; fMenuTools = 0;
320  delete fMenuHelp; fMenuHelp = 0;
321  Cleanup();
323 }
324 
325 ////////////////////////////////////////////////////////////////////////////////
326 /// Build TGTextEditor widget.
327 
329 {
333 
335  fMenuFile->AddEntry("&New", kM_FILE_NEW);
337  fMenuFile->AddEntry("&Open...", kM_FILE_OPEN);
338  fMenuFile->AddEntry("&Close", kM_FILE_CLOSE);
339  fMenuFile->AddEntry("&Save", kM_FILE_SAVE);
340  fMenuFile->AddEntry("Save &As...", kM_FILE_SAVEAS);
342  fMenuFile->AddEntry("&Print...", kM_FILE_PRINT);
344  fMenuFile->AddEntry("E&xit", kM_FILE_EXIT);
345 
347  fMenuEdit->AddEntry("Cu&t\tCtrl+X", kM_EDIT_CUT);
348  fMenuEdit->AddEntry("&Copy\tCtrl+C", kM_EDIT_COPY);
349  fMenuEdit->AddEntry("&Paste\tCtrl+V", kM_EDIT_PASTE);
350  fMenuEdit->AddEntry("De&lete\tDel", kM_EDIT_DELETE);
352  fMenuEdit->AddEntry("Select &All\tCtrl+A", kM_EDIT_SELECTALL);
354  fMenuEdit->AddEntry("Set &Font", kM_EDIT_SELFONT);
355 
357  fMenuTools->AddEntry("&Compile Macro\tCtrl+F7", kM_TOOLS_COMPILE);
358  fMenuTools->AddEntry("&Execute Macro\tCtrl+F5", kM_TOOLS_EXECUTE);
359  fMenuTools->AddEntry("&Interrupt\tShift+F5", kM_TOOLS_INTERRUPT);
360 
365 
367  fMenuSearch->AddEntry("&Find...\tCtrl+F", kM_SEARCH_FIND);
368  fMenuSearch->AddEntry("Find &Next\tF3", kM_SEARCH_FINDNEXT);
370  fMenuSearch->AddEntry("&Goto Line...\tCtrl+L", kM_SEARCH_GOTO);
371 
373  fMenuHelp->AddEntry("&Help Topics\tF1", kM_HELP_CONTENTS);
375  fMenuHelp->AddEntry("&About...", kM_HELP_ABOUT);
376 
377  fMenuFile->Associate(this);
378  fMenuEdit->Associate(this);
379  fMenuSearch->Associate(this);
380  fMenuTools->Associate(this);
381  fMenuHelp->Associate(this);
382 
383  fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
390  kLHintsRight));
392 
393  //---- toolbar
394 
395  AddFrame(new TGHorizontal3DLine(this),
396  new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,2));
397  Int_t i,spacing = 8;
398  fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
400  for (i = 0; fTbData[i].fPixmap; i++) {
401  if (strlen(fTbData[i].fPixmap) == 0) {
402  spacing = 8;
403  continue;
404  }
405  fToolBar->AddButton(this, &fTbData[i], spacing);
406  spacing = 0;
407  }
408  fComboCmd = new TGComboBox(fToolBar, "");
411  fCommand->Associate(this);
414  kLHintsRight, 5, 5, 1, 1));
415 
416  fToolBar->AddFrame(fLabel = new TGLabel(fToolBar, "Command :"),
417  new TGLayoutHints(kLHintsCenterY | kLHintsRight, 5, 5, 1, 1));
419  0, 0, 0, 0));
420  AddFrame(new TGHorizontal3DLine(this),
421  new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,2));
422 
427 
428  fTextEdit = new TGTextEdit(this, 10, 10, 1);
429  if (gClient->GetStyle() < 2) {
430  Pixel_t pxl;
431  gClient->GetColorByName("#3399ff", pxl);
432  fTextEdit->SetSelectBack(pxl);
434  }
435  fTextEdit->Associate(this);
437 
438  Int_t parts[] = { 75, 25 };
439  fStatusBar = new TGStatusBar(this);
441  fStatusBar->SetParts(parts, 2);
443 
444  SetClassHints("ROOT", "TGTextEditor");
445  SetWindowName("Untitled - TGTextEditor");
446 
447  fMacro = 0;
448  fFilename = "Untitled";
450 
451  fTextEdit->SetFocus();
454  fTextEdit->Connect("DataChanged()", "TGTextEditor", this, "DataChanged()");
455  fTextEdit->Connect("Closed()", "TGTextEditor", this, "ClearText()");
456  fTextEdit->Connect("Opened()", "TGTextEditor", this, "ClearText()");
457  fTextEdit->Connect("DataDropped(char *)", "TGTextEditor", this, "DataDropped(char *)");
458  fTextEdit->MapWindow();
459 
460  MapSubwindows();
461  Resize(GetDefaultWidth() + 50, GetDefaultHeight() > 500 ? GetDefaultHeight() : 500);
462  Layout();
463 
464  gApplication->Connect("Terminate(Int_t)", "TGTextEditor", this, "ClearText()");
465  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_F3), 0, kTRUE);
466 
469 
470  fTimer = new TTimer(this, 250);
471  fTimer->Reset();
472  fTimer->TurnOn();
473 
474  fExiting = kFALSE;
476 }
477 
478 ////////////////////////////////////////////////////////////////////////////////
479 /// Update file information when receiving the signal
480 /// DataDropped from TGTextEdit widget.
481 
482 void TGTextEditor::DataDropped(char *fname)
483 {
484  TString tmp;
485  fFilename = fname;
486  tmp.Form("%s: %ld lines read.", fname, fTextEdit->ReturnLineCount());
487  fStatusBar->SetText(tmp, 0);
488  tmp.Form("%s - TGTextEditor", fname);
489  SetWindowName(tmp.Data());
490 }
491 
492 ////////////////////////////////////////////////////////////////////////////////
493 /// Slot setting the fTextChanged flag to true when the text has been
494 /// modified in fTextEdit
495 
497 {
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Load a file into the editor. If fname is 0, a TGFileDialog will popup.
503 
504 void TGTextEditor::LoadFile(const char *fname)
505 {
506  TString tmp;
507  TGFileInfo fi;
509  switch (IsSaved()) {
510  case kMBCancel:
511  return;
512  case kMBYes:
513  if (!fFilename.CompareTo("Untitled"))
514  SaveFileAs();
515  else
517  if (fTextChanged) {
518  return;
519  }
520  break;
521  case kMBNo:
522  break;
523  default:
524  return;
525  }
526  if (fname == 0) {
527  new TGFileDialog(fClient->GetDefaultRoot(), this, kFDOpen, &fi);
528  if (fi.fFilename && strlen(fi.fFilename)) {
529  fname = fi.fFilename;
530  }
531  }
532  if (fname) {
533  if (!fTextEdit->LoadFile(fname)) {
534  tmp.Form("Error opening file \"%s\"", fname);
535  new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
536  tmp.Data(), kMBIconExclamation, kMBOk);
537  } else {
538  fFilename = fname;
539  tmp.Form("%s: %ld lines read.", fname, fTextEdit->ReturnLineCount());
540  fStatusBar->SetText(tmp.Data(), 0);
541  tmp.Form("%s - TGTextEditor", fname);
542  SetWindowName(tmp.Data());
544  }
545  }
546  fTextEdit->Layout();
547 }
548 
549 ////////////////////////////////////////////////////////////////////////////////
550 /// Save the edited text in the file "fname".
551 
552 void TGTextEditor::SaveFile(const char *fname)
553 {
554  char *p;
555  TString tmp;
556 
557  if (!fTextEdit->SaveFile(fname)) {
558  tmp.Form("Error saving file \"%s\"", fname);
559  new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
560  tmp.Data(), kMBIconExclamation, kMBOk);
561  return;
562  }
563  if ((p = (char *)strrchr(fname, '/')) == 0) {
564  p = (char *)fname;
565  } else {
566  ++p;
567  }
568  tmp.Form("%s: %ld lines written.", p, fTextEdit->ReturnLineCount());
569  fStatusBar->SetText(tmp.Data(), 0);
570 
571  tmp.Form("%s - TGTextEditor", p);
572  SetWindowName(tmp.Data());
574 }
575 
576 ////////////////////////////////////////////////////////////////////////////////
577 /// Save the edited text in a file selected with TGFileDialog.
578 /// Shouldn't we create a backup file?
579 
581 {
582  TString workdir = gSystem->WorkingDirectory();
583  static TString dir(".");
584  static Bool_t overwr = kFALSE;
585  TGFileInfo fi;
587  fi.fIniDir = StrDup(dir);
588  fi.fOverwrite = overwr;
589  new TGFileDialog(fClient->GetDefaultRoot(), this, kFDSave, &fi);
590  gSystem->ChangeDirectory(workdir.Data());
591  overwr = fi.fOverwrite;
592  if (fi.fFilename && strlen(fi.fFilename)) {
593  SaveFile(fi.fFilename);
594  fFilename = fi.fFilename;
595  return kTRUE;
596  }
597  return kFALSE;
598 }
599 
600 ////////////////////////////////////////////////////////////////////////////////
601 /// Check if file has to be saved in case of modifications.
602 
604 {
605  Int_t ret;
606  TString tmp;
607  Int_t opt = (kMBYes | kMBNo);
608 
609  tmp.Form("The text has been modified. Do you want to save the changes?");
610 
611  if (!fTextChanged) {
612  return kMBNo;
613  } else {
614  if (fParent == gClient->GetDefaultRoot())
615  opt |= kMBCancel;
616  new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
617  tmp.Data(), kMBIconExclamation, opt, &ret);
618  return ret;
619  }
620 }
621 
622 ////////////////////////////////////////////////////////////////////////////////
623 /// Open the print dialog and send current buffer to printer.
624 
626 {
627  TString tmp;
628  Int_t ret = 0;
629  if (!gEPrinter) {
630  gEPrinter = StrDup("892_2_cor"); // use gEnv
631  gEPrintCommand = StrDup("xprint");
632  }
633  new TGPrintDialog(fClient->GetDefaultRoot(), this, 400, 150,
634  &gEPrinter, &gEPrintCommand, &ret);
635  if (ret) {
636  fTextEdit->Print();
637  tmp.Form("Printed: %s", fFilename.Data());
638  fStatusBar->SetText(tmp.Data(), 0);
639  }
640 }
641 
642 ////////////////////////////////////////////////////////////////////////////////
643 /// Close TGTextEditor window.
644 
646 {
647  if (fExiting) {
648  return;
649  }
650  fExiting = kTRUE;
651  switch (IsSaved()) {
652  case kMBYes:
653  if (!fFilename.CompareTo("Untitled"))
654  SaveFileAs();
655  else
657  if ((fTextChanged) && (fParent == gClient->GetDefaultRoot()))
658  break;
659  case kMBCancel:
660  if (fParent == gClient->GetDefaultRoot())
661  break;
662  case kMBNo:
663  gApplication->Disconnect("Terminate(Int_t)");
665  }
666  fExiting = kFALSE;
667 }
668 
669 ////////////////////////////////////////////////////////////////////////////////
670 /// Keyboard event handler.
671 
673 {
674  char input[10];
675  UInt_t keysym;
676 
677  if (event->fType == kGKeyPress) {
678  gVirtualX->LookupString(event, input, sizeof(input), keysym);
679 
680  switch ((EKeySym)keysym) { // ignore these keys
681  case kKey_Shift:
682  case kKey_Control:
683  case kKey_Meta:
684  case kKey_Alt:
685  case kKey_CapsLock:
686  case kKey_NumLock:
687  case kKey_ScrollLock:
688  return kTRUE;
689  case kKey_F1:
691  kM_HELP_CONTENTS, 0);
692  return kTRUE;
693  case kKey_F3:
694  Search(kTRUE);
695  return kTRUE;
696  default:
697  break;
698  }
699  if (event->fState & kKeyControlMask) { // Ctrl key modifier pressed
700  switch((EKeySym)keysym) {
701  case kKey_F5:
702  ExecuteMacro();
703  return kTRUE;
704  case kKey_F7:
705  CompileMacro();
706  return kTRUE;
707  default:
708  break;
709  }
710  }
711  if (event->fState & kKeyShiftMask) { // Shift key modifier pressed
712  switch((EKeySym)keysym) {
713  case kKey_F5:
714  InterruptMacro();
715  return kTRUE;
716  default:
717  break;
718  }
719  }
720  }
721  return TGMainFrame::HandleKey(event);
722 }
723 
724 ////////////////////////////////////////////////////////////////////////////////
725 /// Clear text edit widget.
726 
728 {
729  fTextEdit->Clear();
730  fMacro = 0;
731  fFilename = "Untitled";
732  SetWindowName("Untitled - TGTextEditor");
733  fStatusBar->SetText("New File", 0);
735 }
736 
737 ////////////////////////////////////////////////////////////////////////////////
738 /// Invokes search dialog, or just search previous string if again is true.
739 
741 {
742  if (again) {
745  }
746  else {
748  }
749 }
750 
751 ////////////////////////////////////////////////////////////////////////////////
752 /// Invokes goto dialog, and go to the specified line.
753 
755 {
756  Long_t ret;
757 
758  new TGGotoDialog(fClient->GetDefaultRoot(), this, 400, 150, &ret);
759 
760  if (ret >= 0)
761  fTextEdit->Goto(ret-1);
762 }
763 
764 ////////////////////////////////////////////////////////////////////////////////
765 /// Save the edited text in a temporary macro, then compile it.
766 
768 {
769  if (fTextEdit->ReturnLineCount() < 3)
770  return;
771  if ((fMacro) || (!fFilename.CompareTo("Untitled"))) {
772  if (!SaveFileAs())
773  return;
774  }
775  char *tmpfile = gSystem->ConcatFileName(gSystem->TempDirectory(),
777  fTextEdit->SaveFile(tmpfile, kFALSE);
778  gSystem->CompileMacro(tmpfile);
779  gSystem->Unlink(tmpfile);
780  delete [] tmpfile;
781 }
782 
783 ////////////////////////////////////////////////////////////////////////////////
784 /// Save the edited text in a temporary macro, execute it, and then delete
785 /// the temporary file.
786 
788 {
789  if (fTextEdit->ReturnLineCount() < 3)
790  return;
791  if (fMacro) {
792  fMacro->Exec();
793  return;
794  }
795  if (fTextChanged) {
796  Int_t ret;
797  new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
798  "The text has been modified. Do you want to save the changes?",
800  if (ret == kMBYes) {
801  if (!fFilename.CompareTo("Untitled"))
802  SaveFileAs();
803  else
806  }
807  if (ret == kMBCancel)
808  return;
809  }
810  if (!fFilename.CompareTo("Untitled")) {
811  //if (!SaveFileAs())
812  // return;
813  fFilename += ".C";
814  }
815  gInterpreter->SaveContext();
816  TString savdir = gSystem->WorkingDirectory();
817  TString tmpfile = gSystem->BaseName(fFilename.Data());
818  tmpfile += "_exec";
820  fTextEdit->SaveFile(tmpfile.Data(), kFALSE);
821  gROOT->SetExecutingMacro(kTRUE);
822  gROOT->Macro(tmpfile.Data());
823  gROOT->SetExecutingMacro(kFALSE);
824  if (gInterpreter->IsLoaded(tmpfile.Data()))
825  gInterpreter->UnloadFile(tmpfile.Data());
826  gSystem->Unlink(tmpfile.Data());
827  gSystem->ChangeDirectory(savdir.Data());
828  gInterpreter->Reset();
829 }
830 
831 ////////////////////////////////////////////////////////////////////////////////
832 /// Interrupt execution of a macro.
833 
835 {
836  gROOT->SetInterrupt(kTRUE);
837 }
838 
839 ////////////////////////////////////////////////////////////////////////////////
840 /// Display ROOT splash screen.
841 
843 {
844 #ifdef R__UNIX
845  TString rootx = TROOT::GetBinDir() + "/root -a &";
846  gSystem->Exec(rootx);
847 #else
848 #ifdef WIN32
850 #else
851  char str[32];
852  sprintf(str, "About ROOT %s...", gROOT->GetVersion());
853  TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
854  hd->SetText(gHelpAbout);
855  hd->Popup();
856 #endif
857 #endif
858 }
859 
860 ////////////////////////////////////////////////////////////////////////////////
861 /// Handle timer event.
862 
864 {
865  TString tmp;
866  if (t != fTimer) return kTRUE;
867  // check if some text is available in the clipboard
868  if ((gVirtualX->InheritsFrom("TGX11")) &&
869  (gVirtualX->GetPrimarySelectionOwner() == kNone)) {
872  }
873  else {
877  }
878  // check if text is selected in the editor
879  if (fTextEdit->IsMarked()) {
887  }
888  }
889  else {
897  }
898  }
899  // get cursor position
901  tmp.Form("Ln %ld, Ch %ld", pos.fY, pos.fX);
902  fStatusBar->SetText(tmp.Data(), 1);
903  fTimer->Reset();
904  return kTRUE;
905 }
906 
907 ////////////////////////////////////////////////////////////////////////////////
908 /// Handle menu and other command generated by the user.
909 
911 {
912  TRootHelpDialog *hd;
913 
914  switch(GET_MSG(msg)) {
915  case kC_COMMAND:
916  switch(GET_SUBMSG(msg)) {
917  case kCM_BUTTON:
918  case kCM_MENU:
919  switch (parm1) {
920  // "File" menu related events
921  case kM_FILE_NEW:
922  new TGTextEditor();
923  break;
924  case kM_FILE_OPEN:
925  LoadFile();
926  break;
927  case kM_FILE_CLOSE:
928  ClearText();
929  break;
930  case kM_FILE_SAVE:
931  if (!fFilename.CompareTo("Untitled"))
932  SaveFileAs();
933  else
935  break;
936  case kM_FILE_SAVEAS:
937  SaveFileAs();
938  break;
939  case kM_FILE_PRINT:
940  PrintText();
941  break;
942  case kM_FILE_EXIT:
943  CloseWindow();
944  break;
945 
946  // "Edit" menu related events
947  case kM_EDIT_CUT:
948  fTextEdit->Cut();
949  break;
950  case kM_EDIT_COPY:
951  fTextEdit->Copy();
952  break;
953  case kM_EDIT_PASTE:
954  fTextEdit->Paste();
955  break;
956  case kM_EDIT_DELETE:
957  fTextEdit->Delete();
958  break;
959  case kM_EDIT_SELECTALL:
960  fTextEdit->SelectAll();
961  if (fTextEdit->IsMarked()) {
969  }
970  }
971  break;
972  case kM_EDIT_SELFONT:
973  {
974  Int_t count;
975  TString fontname;
977  new TGFontDialog(fClient->GetRoot(), this, &prop);
978  if (prop.fName != "") {
979  fontname.Form("-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
980  prop.fName.Data(),
981  prop.fBold ? "bold" : "medium",
982  prop.fItalic ? 'i' : 'r',
983  prop.fSize);
984  if (!gVirtualX->ListFonts(fontname, 10, count)) {
985  fontname.Form("-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
986  prop.fName.Data(),
987  prop.fBold ? "bold" : "medium",
988  prop.fItalic ? 'o' : 'r',
989  prop.fSize);
990  }
991  TGFont *font = fClient->GetFont(fontname);
992  if (font) {
993  FontStruct_t editorfont = font->GetFontStruct();
994  fTextEdit->SetFont(editorfont);
995  fTextEdit->Update();
996  }
997  }
998  }
999  break;
1000 
1001  // "Tools" menu related events
1002  case kM_TOOLS_COMPILE:
1003  CompileMacro();
1004  break;
1005  case kM_TOOLS_EXECUTE:
1006  ExecuteMacro();
1007  break;
1008  case kM_TOOLS_INTERRUPT:
1009  InterruptMacro();
1010  break;
1011 
1012  // "Search" menu related events
1013  case kM_SEARCH_FIND:
1014  Search(kFALSE);
1015  break;
1016  case kM_SEARCH_FINDNEXT:
1017  Search(kTRUE);
1018  break;
1019  case kM_SEARCH_GOTO:
1020  Goto();
1021  break;
1022 
1023  // "Help" menu related events
1024  case kM_HELP_CONTENTS:
1025  hd = new TRootHelpDialog(this, "Help on Editor...", 600, 400);
1026  hd->SetText(gHelpTextEditor);
1027  hd->Popup();
1028  break;
1029  case kM_HELP_ABOUT:
1030  About();
1031  break;
1032  }
1033  break;
1034  }
1035  break;
1036  case kC_TEXTENTRY:
1037  switch (GET_SUBMSG(msg)) {
1038  case kTE_ENTER:
1039  {
1040  // here copy the string from text buffer to return variable
1041  const char *string = fCommandBuf->GetString();
1042  if(strlen(string) > 1) {
1043  gROOT->ProcessLine(string);
1045  }
1046  }
1047  break;
1048  default:
1049  break;
1050  }
1051  break;
1052 
1053  default:
1054  break;
1055  }
1056  return kTRUE;
1057 }
TGToolBar * fToolBar
Definition: TGTextEditor.h:45
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:931
virtual void Print(Option_t *="") const
Send current buffer to printer.
Definition: TGTextEdit.cxx:476
R__EXTERN const char gHelpTextEditor[]
Definition: HelpText.h:24
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Handle_t FontStruct_t
Definition: GuiTypes.h:38
TList * GetListOfLines() const
Definition: TMacro.h:51
const TGWindow * fParent
Definition: TGWindow.h:37
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
void Search(Bool_t ret)
Invokes search dialog, or just search previous string if again is true.
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Definition: TGToolBar.cxx:156
TGPopupMenu * fMenuFile
Definition: TGTextEditor.h:54
void Goto()
Invokes goto dialog, and go to the specified line.
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:868
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
void CompileMacro()
Save the edited text in a temporary macro, then compile it.
Collectable string class.
Definition: TObjString.h:28
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:321
Bool_t fOverwrite
Definition: TGFileDialog.h:65
void ClearText()
Clear text edit widget.
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1564
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition: TGToolBar.cxx:91
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
virtual void CloseWindow()
Close TGTextEditor window.
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:222
TTimer * fTimer
Definition: TGTextEditor.h:43
virtual Bool_t HandleTimer(TTimer *t)
Handle timer event.
virtual void SetSelectBack(Pixel_t p)
set selected text background color
Definition: TGTextView.cxx:177
TH1 * h
Definition: legend2.C:5
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:691
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1714
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
TGLabel * fLabel
Definition: TGTextEditor.h:47
virtual Bool_t HandleKey(Event_t *event)
Keyboard event handler.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:859
virtual Long_t Exec(const char *params=0, Int_t *error=0)
Execute this macro with params, if params is 0, default parameters (set via SetParams) are used...
Definition: TMacro.cxx:266
#define gROOT
Definition: TROOT.h:375
TGTextBuffer * fCommandBuf
Definition: TGTextEditor.h:50
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
Basic string class.
Definition: TString.h:129
#define gClient
Definition: TGClient.h:166
TGMenuBar * fMenuBar
Definition: TGTextEditor.h:53
int Int_t
Definition: RtypesCore.h:41
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1003
bool Bool_t
Definition: RtypesCore.h:59
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:373
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:987
#define gInterpreter
Definition: TInterpreter.h:499
virtual void Delete(Option_t *="")
Delete selection.
Definition: TGTextEdit.cxx:531
Bool_t fTextChanged
Definition: TGTextEditor.h:60
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle menu and other command generated by the user.
R__EXTERN TApplication * gApplication
Definition: TApplication.h:165
TGLongPosition GetCurrentPos() const
Definition: TGTextEdit.h:122
Bool_t IsMarked() const
Definition: TGTextView.h:130
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1057
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
R__EXTERN const char gHelpAbout[]
Definition: HelpText.h:14
void DataChanged()
Slot setting the fTextChanged flag to true when the text has been modified in fTextEdit.
TGLayoutHints * fMenuBarLayout
Definition: TGTextEditor.h:51
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Definition: TSystem.cxx:1353
TGPopupMenu * fMenuSearch
Definition: TGTextEditor.h:56
ULong_t Pixel_t
Definition: GuiTypes.h:39
const char ** fFileTypes
Definition: TGFileDialog.h:63
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename"...
Definition: TSystem.cxx:2811
virtual void AddLine(const char *string)
Add a line of text to the view widget.
Definition: TGTextView.cxx:227
const char * GetString() const
Definition: TGTextBuffer.h:47
static char * gEPrintCommand
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:627
virtual void Update()
update the whole window of text view
Definition: TGTextView.cxx:260
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:452
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1814
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition: TSystem.cxx:1454
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual EButtonState GetState() const
Definition: TGButton.h:112
Definition: TGMsgBox.h:43
TGTextBuffer * GetBuffer() const
Definition: TGTextEntry.h:127
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition: TGMenu.cxx:1695
void ExecuteMacro()
Save the edited text in a temporary macro, execute it, and then delete the temporary file...
Bool_t fExiting
Definition: TGTextEditor.h:59
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
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...
Definition: TQObject.cxx:867
void About()
Display ROOT splash screen.
virtual void Layout()
Layout the components of view.
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:371
R__EXTERN TSystem * gSystem
Definition: TSystem.h:539
void Popup()
Show help dialog.
EGEventType fType
Definition: GuiTypes.h:174
virtual void Build()
Build TGTextEditor widget.
Int_t GET_SUBMSG(Long_t val)
virtual void SetFont(FontStruct_t font)
Changes text entry font.
Definition: TGTextView.cxx:331
virtual Bool_t SelectAll()
Select all text in the viewer.
Definition: TGTextView.cxx:515
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
virtual void Associate(const TGWindow *w)
Definition: TGMenu.h:219
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1728
void LoadFile(const char *fname=0)
Load a file into the editor. If fname is 0, a TGFileDialog will popup.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2332
unsigned int UInt_t
Definition: RtypesCore.h:42
TGStatusBar * fStatusBar
Definition: TGTextEditor.h:44
const Handle_t kNone
Definition: GuiTypes.h:87
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TMacro * fMacro
Definition: TGTextEditor.h:62
void SaveFile(const char *fname)
Save the edited text in the file "fname".
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:660
Bool_t SaveFileAs()
Save the edited text in a file selected with TGFileDialog.
static char * gEPrinter
#define gVirtualX
Definition: TVirtualX.h:350
virtual void Clear(Option_t *="")
Clear text edit widget.
Definition: TGTextEdit.cxx:375
virtual void SetSelectFore(Pixel_t p)
set selected text color
Definition: TGTextView.cxx:186
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2524
Int_t GET_MSG(Long_t val)
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual Long_t ReturnLineCount()
Definition: TGTextView.h:105
EKeySym
Definition: KeySymbols.h:25
long Long_t
Definition: RtypesCore.h:50
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
TGPopupMenu * fMenuTools
Definition: TGTextEditor.h:57
virtual void SetFocus()
Definition: TGTextEdit.h:119
virtual Bool_t Search(const char *string, Bool_t direction=kTRUE, Bool_t caseSensitive=kFALSE)
Search for string in the specified direction.
Definition: TGTextEdit.cxx:633
#define ClassImp(name)
Definition: Rtypes.h:336
TGTextEntry * fCommand
Definition: TGTextEditor.h:49
TGLayoutHints * fMenuBarItemLayout
Definition: TGTextEditor.h:52
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
TGPopupMenu * GetMenu() const
Definition: TGTextEdit.h:110
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
TGComboBox * fComboCmd
Definition: TGTextEditor.h:48
ToolBarData_t fTbData[]
Definition: TGFont.h:149
char * fFilename
Definition: TGFileDialog.h:61
FontStruct_t GetFontStruct() const
Definition: TGFont.h:193
TString fFilename
Definition: TGTextEditor.h:61
void PrintText()
Open the print dialog and send current buffer to printer.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1025
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:396
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void Copy(TObject &) const
Copy this to obj.
Definition: TGTextEdit.h:70
const char * ed_filetypes[]
Handle_t fId
Definition: TGObject.h:36
virtual Bool_t Cut()
Cut text.
Definition: TGTextEdit.cxx:441
virtual void UnmapWindow()
Definition: TGFrame.h:253
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted...
Definition: TGComboBox.cxx:648
TGTextEdit * fTextEdit
Definition: TGTextEditor.h:46
TGTextEditor(const char *filename=0, const TGWindow *p=0, UInt_t w=900, UInt_t h=600)
TGTextEditor constructor with file name as first argument.
Int_t IsSaved()
Check if file has to be saved in case of modifications.
virtual void MapWindow()
Definition: TGFrame.h:251
TGClient * fClient
Definition: TGObject.h:37
TGPopupMenu * fMenuEdit
Definition: TGTextEditor.h:55
const Mask_t kFocusChangeMask
Definition: GuiTypes.h:168
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:232
void InterruptMacro()
Interrupt execution of a macro.
const char * fPixmap
Definition: TGToolBar.h:33
UInt_t fState
Definition: GuiTypes.h:180
ETextEditorCommands
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
virtual void DeleteWindow()
Delete TGTextEditor Window.
virtual Bool_t Paste()
Paste text into widget.
Definition: TGTextEdit.cxx:454
virtual Bool_t Goto(Long_t line, Long_t column=0)
Goto the specified line.
Definition: TGTextEdit.cxx:737
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2728
const Mask_t kKeyControlMask
Definition: GuiTypes.h:196
virtual ~TGTextEditor()
TGTextEditor destructor.
virtual Bool_t SaveFile(const char *fname, Bool_t saveas=kFALSE)
Save file.
Definition: TGTextEdit.cxx:387
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:258
virtual void TurnOn()
Add the timer to the system timer list.
Definition: TTimer.cxx:241
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Definition: TSystem.cxx:1051
void DataDropped(char *fname)
Update file information when receiving the signal DataDropped from TGTextEdit widget.
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:415
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
Definition: TGClient.cxx:346
char * fIniDir
Definition: TGFileDialog.h:62
TGPopupMenu * fMenuHelp
Definition: TGTextEditor.h:58
Definition: TGMsgBox.h:44
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:185
const char * Data() const
Definition: TString.h:347