Logo ROOT  
Reference Guide
TGTextEditDialogs.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 10/7/2000
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 /** \class TGTextEditDialogs
25  \ingroup guiwidgets
26 
27 This file defines several dialogs that are used by the TGTextEdit
28 widget via its associated context popup menu.
29 The following dialogs are available: TGSearchDialog, TGGotoDialog
30 and TGPrintDialog.
31 
32 */
33 
34 
35 #include "TGTextEditDialogs.h"
36 #include "TGButton.h"
37 #include "TGLabel.h"
38 #include "TGTextEntry.h"
39 #include "TGIcon.h"
40 #include "TGMsgBox.h"
41 #include "TGComboBox.h"
42 #include "TSystem.h"
43 #include "TObjArray.h"
44 #include "TVirtualX.h"
45 #include "strlcpy.h"
46 #include "snprintf.h"
47 
48 #include <cstdlib>
49 
50 
54 
57 
58 ////////////////////////////////////////////////////////////////////////////////
59 /// Create a search dialog box. Used to get from the user the required
60 /// search instructions. Ret_code is kTRUE when sstruct has been set,
61 /// kFALSE otherwise (like when dialog was canceled).
62 
64  UInt_t w, UInt_t h, TGSearchType *sstruct,
65  Int_t *ret_code, UInt_t options) :
66  TGTransientFrame(p, main, w, h, options)
67 {
68  if (!p && !main) {
69  MakeZombie();
70  // coverity [uninit_ctor]
71  return;
72  }
73  fRetCode = ret_code;
74  fType = sstruct;
75 
77 
78  fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
79  fF2 = new TGCompositeFrame(this, 60, 20, kVerticalFrame);
80  fF3 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
81  fF4 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
82 
83  fSearchButton = new TGTextButton(fF1, new TGHotString("&Search"), 1);
84  fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
86 
87  fSearchButton->Associate(this);
88  fCancelButton->Associate(this);
89 
90  fL1 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0);
92  2, 5, 0, 2);
93  fL21 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
94 
97 
98  AddFrame(fF1, fL21);
99 
100  fLSearch = new TGLabel(fF3, new TGHotString("Search &for:"));
101 
102  fCombo = new TGComboBox(fF3, "");
105  if (sstruct && sstruct->fBuffer)
106  fBSearch->AddText(0, sstruct->fBuffer);
107  else if (!gLastSearchString.IsNull())
109  else
111  fSearch->Associate(this);
113  fSearch->SelectAll();
114 
115  fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
116  fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
117 
119  fF3->AddFrame(fCombo, fL6);
120 
121  fG2 = new TGGroupFrame(fF4, new TGString("Direction"), kHorizontalFrame);
122 
123  fL3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 2, 2);
124  fL9 = new TGLayoutHints(kLHintsBottom | kLHintsLeft, 0, 0, 0, 0);
125  fL4 = new TGLayoutHints(kLHintsBottom | kLHintsLeft, 0, 0, 5, 0);
126  fL10 = new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 0);
127 
128  fCaseCheck = new TGCheckButton(fF4, new TGHotString("&Case sensitive"), 1);
129  fCaseCheck->Associate(this);
131 
132  fDirectionRadio[0] = new TGRadioButton(fG2, new TGHotString("Forward"), 1);
133  fDirectionRadio[1] = new TGRadioButton(fG2, new TGHotString("Backward"), 2);
134 
137  fDirectionRadio[0]->Associate(this);
138  fDirectionRadio[1]->Associate(this);
139 
140  if (fType->fCaseSensitive == kFALSE)
142  else
144 
145  if (fType->fDirection)
147  else
149 
150  fF4->AddFrame(fG2, fL3);
151 
152  fF2->AddFrame(fF3, fL1);
153  fF2->AddFrame(fF4, fL1);
154 
155  AddFrame(fF2, fL2);
156 
157  MapSubwindows();
160 
161  CenterOnParent();
162 
163  SetWindowName("Search");
164  SetIconName("Search");
165 
169 
170  if (fType->fClose) {
171  MapWindow();
173  fClient->WaitFor(this);
174  }
175 }
176 
177 ////////////////////////////////////////////////////////////////////////////////
178 /// Clean up search dialog.
179 
181 {
182  if (IsZombie()) return;
183  delete fSearchButton;
184  delete fCancelButton;
185  delete fDirectionRadio[0]; delete fDirectionRadio[1];
186  delete fCaseCheck;
187  delete fCombo;
188  delete fLSearch;
189  delete fG2;
190  delete fF1; delete fF2; delete fF3; delete fF4;
191  delete fL1; delete fL2; delete fL3; delete fL4; delete fL5; delete fL6;
192  delete fL21;delete fL9; delete fL10;
193 }
194 
195 ////////////////////////////////////////////////////////////////////////////////
196 /// Close the dialog. On close the dialog will be deleted and cannot be
197 /// re-used.
198 
200 {
201  if (fType->fClose) {
202  DeleteWindow();
203  } else {
204  UnmapWindow();
205  }
206 }
207 
208 ////////////////////////////////////////////////////////////////////////////////
209 /// emit signal when search text entered
210 
212 {
213  Emit("TextEntered(const char *)", text);
214 }
215 
216 ////////////////////////////////////////////////////////////////////////////////
217 /// Process search dialog widget messages.
218 
220 {
221  const char *string;
222 
223  switch (GET_MSG(msg)) {
224  case kC_COMMAND:
225  switch (GET_SUBMSG(msg)) {
226  case kCM_BUTTON:
227  switch (parm1) {
228  case 1:
229  string = fBSearch->GetString();
230  if (fType->fBuffer)
231  delete [] fType->fBuffer;
232  fType->fBuffer = StrDup(string);
233  gLastSearchString = string;
234  *fRetCode = kTRUE;
235  TextEntered(string);
237  if (fType->fClose) CloseWindow();
238  break;
239  case 2:
240  *fRetCode = kFALSE;
241  CloseWindow();
242  break;
243  }
244  break;
245 
246  case kCM_CHECKBUTTON:
248  break;
249 
250  case kCM_RADIOBUTTON:
251  switch (parm1) {
252  case 1:
255  break;
256  case 2:
259  break;
260  }
261  break;
262 
263  default:
264  break;
265  }
266  break;
267 
268  case kC_TEXTENTRY:
269  switch (GET_SUBMSG(msg)) {
270  case kTE_TEXTCHANGED:
271  string = fBSearch->GetString();
272  if (!string[0]) {
274  } else {
276  }
277  break;
278  case kTE_ENTER:
279  string = fBSearch->GetString();
280  if (fType->fBuffer)
281  delete [] fType->fBuffer;
282  fType->fBuffer = StrDup(string);
283  gLastSearchString = string;
284  *fRetCode = kTRUE;
285  TextEntered(string);
286  if (fType->fClose) CloseWindow();
287  break;
288  default:
289  break;
290  }
291  break;
292 
293  default:
294  break;
295  }
296 
297  return kTRUE;
298 }
299 
300 ////////////////////////////////////////////////////////////////////////////////
301 /// Return global search dialog.
302 
304 {
305  return fgSearchDialog;
306 }
307 
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Create the printer dialog box. Returns kTRUE in ret_code when
311 /// printerName and printProg have been set and cancel was not pressed,
312 /// kFALSE otherwise.
313 
315  UInt_t w, UInt_t h, char **printerName,
316  char **printProg, Int_t *ret_code,
317  UInt_t options) :
318  TGTransientFrame(p, main, w, h, options)
319 {
320  if (!p && !main) {
321  MakeZombie();
322  // coverity [uninit_ctor]
323  return;
324  }
325  fPrinter = printerName;
326  fPrintCommand = printProg;
327  fRetCode = ret_code;
329 
331 
332  fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
333  fF5 = new TGCompositeFrame(this, 60, 20, kHorizontalFrame);
334  fF2 = new TGCompositeFrame(fF5, 60, 20, kVerticalFrame);
335  fF3 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
336  fF4 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
337 
338  fPrintButton = new TGTextButton(fF1, new TGHotString("&Print"), 1);
339  fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
341 
342  fPrintButton->Associate(this);
343  fCancelButton->Associate(this);
344 
345  fL1 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2);
347  2, 5, 0, 2);
348  fL3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 4, 4);
349  fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
350  fL6 = new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 2, 0, 0);
351  fL7 = new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10);
352 
353  fL21 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
354 
357  AddFrame(fF1, fL3);
358 
359 
360  fLPrintCommand = new TGLabel(fF3, new TGHotString("Print command:"));
361  fBPrintCommand = new TGTextBuffer(50);
362  if ((printProg) && (*printProg))
363  fBPrintCommand->AddText(0, *printProg);
367 
370 
371  fLPrinter = new TGLabel(fF4, new TGHotString("Printer:"));
372  if ((printerName) && (*printerName))
373  fPrinterEntry = new TGComboBox(fF4, *printerName);
378 
379  fF2->AddFrame(fF3, fL1);
380  fF2->AddFrame(fF4, fL1);
381 
382  const TGPicture *printerPicture = fClient->GetPicture("printer_s.xpm");
383  if (!printerPicture) {
384  Error("TGPrintDialog", "printer_s.xpm not found");
385  fPrinterIcon = 0;
386  } else {
387  fPrinterIcon = new TGIcon(fF5, printerPicture, 32, 32);
389  }
390  fF5->AddFrame(fF2, fL1);
391  AddFrame(fF5, fL1);
392 
393  MapSubwindows();
395 
396  GetPrinters();
397  CenterOnParent();
398 
399  SetWindowName("Print");
400  SetIconName("Print");
401 
405 
407  MapWindow();
408  fClient->WaitFor(this);
409 }
410 
411 ////////////////////////////////////////////////////////////////////////////////
412 /// Clean up print dialog.
413 
415 {
416  if (IsZombie()) return;
417  delete fPrinterIcon;
418  delete fPrintButton;
419  delete fCancelButton;
420  delete fPrinterEntry; // deletes also fBPrinter
421  delete fPrintCommandEntry; // deletes also fBPrintCommand
422  delete fLPrinter; delete fLPrintCommand;
423  delete fF1; delete fF2; delete fF3; delete fF4; delete fF5;
424  delete fL1; delete fL2; delete fL3; delete fL5; delete fL6; delete fL7;
425  delete fL21;
426 }
427 
428 ////////////////////////////////////////////////////////////////////////////////
429 /// Close the dialog. On close the dialog will be deleted and cannot be
430 /// re-used.
431 
433 {
434  DeleteWindow();
435 }
436 
437 ////////////////////////////////////////////////////////////////////////////////
438 /// Ask the system fo the list of available printers and populate the combo
439 /// box. If there is a default printer, select it in the list.
440 
442 {
443  TObject *obj;
444  Int_t idx = 1, dflt =1;
445 
446  if (gVirtualX->InheritsFrom("TGX11") || gVirtualX->InheritsFrom("TGCocoa")) {
447  char *lpstat = gSystem->Which(gSystem->Getenv("PATH"), "lpstat",
449  if (lpstat == 0) return;
450  TString defaultprinter = gSystem->GetFromPipe("lpstat -d");
451  TString printerlist = gSystem->GetFromPipe("lpstat -v");
452  TObjArray *tokens = printerlist.Tokenize("\n");
453  TIter iter(tokens);
454  while((obj = iter())) {
455  TString line = obj->GetName();
456  TObjArray *tk = line.Tokenize(" ");
457  TString pname = ((TObject*)tk->At(2))->GetName();
458  if (pname.EndsWith(":")) pname.Remove(pname.Last(':'));
459  //if (pname.Contains(":")) pname.Remove(pname.Last(':'));
460  if (defaultprinter.Contains(pname)) {
461  dflt = idx;
463  }
464  fPrinterEntry->AddEntry(pname.Data(), idx++);
465  }
466  delete [] lpstat;
467  }
468  else {
469  TString defaultprinter = gSystem->GetFromPipe("WMIC Path Win32_Printer where Default=TRUE Get DeviceID");
470  TString printerlist = gSystem->GetFromPipe("WMIC Path Win32_Printer Get DeviceID");
471  defaultprinter.Remove(0, defaultprinter.First('\n')); // remove "Default"
472  printerlist.Remove(0, printerlist.First('\n')); // remove "DeviceID"
473  printerlist.ReplaceAll("\r", "");
474  TObjArray *tokens = printerlist.Tokenize("\n");
475  TIter iter(tokens);
476  while((obj = iter())) {
477  TString pname = obj->GetName();
478  pname.Remove(TString::kTrailing, ' ');
479  if (defaultprinter.Contains(pname)) {
480  dflt = idx;
482  }
483  fPrinterEntry->AddEntry(pname.Data(), idx++);
484  }
485  }
486  fPrinterEntry->Select(dflt, kFALSE);
488 }
489 
490 ////////////////////////////////////////////////////////////////////////////////
491 /// Process print dialog widget messages.
492 
494 {
495  const char *string, *txt;
496 
497  switch (GET_MSG(msg)) {
498  case kC_COMMAND:
499  switch (GET_SUBMSG(msg)) {
500  case kCM_BUTTON:
501  switch (parm1) {
502  case 1:
503  *fRetCode = kTRUE;
504  {
505  string = fBPrinter->GetString();
506  delete [] *fPrinter;
507  const size_t prSize = strlen(string) + 1;
508  *fPrinter = new char[prSize];
509  strlcpy(*fPrinter, string, prSize);
510  }
511  {
512  string = fBPrintCommand->GetString();
513  delete [] *fPrintCommand;
514  const size_t cmdSize = strlen(string) + 1;
515  *fPrintCommand = new char[cmdSize];
516  strlcpy(*fPrintCommand, string, cmdSize);
517  }
518 
519  if (fBPrintCommand->GetTextLength() == 0) {
520  txt = "Please provide print command or use \"Cancel\"";
522  "Missing Print Parameters", txt, kMBIconExclamation,
523  kMBOk);
524  return kTRUE;
525  }
526  CloseWindow();
527  break;
528  case 2:
529  *fRetCode = kFALSE;
530  CloseWindow();
531  break;
532  }
533  break;
534  }
535  break;
536 
537  default:
538  break;
539  }
540 
541  return kTRUE;
542 }
543 
544 ////////////////////////////////////////////////////////////////////////////////
545 /// Create a dialog to GoTo a specific line number. Returns -1 in
546 /// ret_code in case no valid line number was given or in case
547 /// cancel was pressed. If on input *ret_code is > 0 then this value
548 /// will be used as default value.
549 
551  UInt_t w, UInt_t h, Long_t *ret_code,
552  UInt_t options) :
553  TGTransientFrame(p, main, w, h, options)
554 {
555  if (!p && !main) {
556  MakeZombie();
557  // coverity [uninit_ctor]
558  return;
559  }
560  fRetCode = ret_code;
562 
564 
565  fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
566  fF2 = new TGCompositeFrame(this, 60, 20, kHorizontalFrame);
567 
568  fGotoButton = new TGTextButton(fF1, new TGHotString("&Goto"), 1);
569  fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
571 
572  fGotoButton->Associate(this);
573  fCancelButton->Associate(this);
574 
575  fL1 = new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 2, 2, 3, 0);
576  fL21 = new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 5, 10, 0);
577 
580  AddFrame(fF1, fL21);
581 
582  fLGoTo = new TGLabel(fF2, new TGHotString("&Goto Line:"));
583 
584  fBGoTo = new TGTextBuffer(50);
585  if (*fRetCode > 0) {
586  char curline[32];
587  snprintf(curline, 32, "%ld", *fRetCode);
588  fBGoTo->AddText(0, curline);
589  } else
591  fGoTo = new TGTextEntry(fF2, fBGoTo);
592  fGoTo->Associate(this);
594  fGoTo->SelectAll();
595 
596  fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
597  fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
598 
599  fF2->AddFrame(fLGoTo, fL5);
600  fF2->AddFrame(fGoTo, fL5);
601  AddFrame(fF2, fL1);
602 
603  MapSubwindows();
605 
606  CenterOnParent();
607 
608  SetWindowName("Goto");
609  SetIconName("Print");
610 
614 
615  MapWindow();
616  fGoTo->RequestFocus();
617  fClient->WaitFor(this);
618 }
619 
620 ////////////////////////////////////////////////////////////////////////////////
621 /// Clean up goto dialog
622 
624 {
625  if (IsZombie()) return;
626  delete fGotoButton;
627  delete fCancelButton;
628  delete fGoTo;
629  delete fLGoTo;
630  delete fF1; delete fF2;
631  delete fL1; delete fL5; delete fL6; delete fL21;
632 }
633 
634 ////////////////////////////////////////////////////////////////////////////////
635 /// Close the dialog. On close the dialog will be deleted and cannot be
636 /// re-used.
637 
639 {
640  DeleteWindow();
641 }
642 
643 ////////////////////////////////////////////////////////////////////////////////
644 /// Process goto dialog widget messages.
645 
647 {
648  const char *string;
649 
650  switch (GET_MSG(msg)) {
651  case kC_COMMAND:
652  switch (GET_SUBMSG(msg)) {
653  case kCM_BUTTON:
654  switch (parm1) {
655  case 1:
656  string = fBGoTo->GetString();
657  *fRetCode = (Long_t) atof(string);
658  CloseWindow();
659  break;
660  case 2:
661  *fRetCode = -1;
662  CloseWindow();
663  break;
664  }
665  break;
666 
667  default:
668  break;
669  }
670  break;
671 
672  case kC_TEXTENTRY:
673  switch (GET_SUBMSG(msg)) {
674  case kTE_TEXTCHANGED:
675  string = fBGoTo->GetString();
676  if (!string[0])
678  else
680  break;
681  case kTE_ENTER:
682  string = fBGoTo->GetString();
683  *fRetCode = (Long_t) atof(string);
684  CloseWindow();
685  break;
686  default:
687  break;
688  }
689  break;
690 
691  default:
692  break;
693  }
694 
695  return kTRUE;
696 }
697 
TGComboBox.h
TGCompositeFrame::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:316
TGPrintDialog::fPrinterIcon
TGIcon * fPrinterIcon
printer icon
Definition: TGTextEditDialogs.h:86
TGPrintDialog::fCancelButton
TGButton * fCancelButton
cancel button
Definition: TGTextEditDialogs.h:88
TGRadioButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set radio button state.
Definition: TGButton.cxx:1613
TGTransientFrame
Defines transient windows that typically are used for dialogs windows.
Definition: TGFrame.h:498
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:110
TGPrintDialog::fPrinter
char ** fPrinter
printer to be used
Definition: TGTextEditDialogs.h:81
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGSearchDialog::fL4
TGLayoutHints * fL4
layout hints
Definition: TGTextEditDialogs.h:42
TGPrintDialog::fL21
TGLayoutHints * fL21
layout hints
Definition: TGTextEditDialogs.h:85
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGTextEntry::SetText
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.
Definition: TGTextEntry.cxx:611
TGSearchDialog::fBSearch
TGTextBuffer * fBSearch
search text buffer
Definition: TGTextEditDialogs.h:51
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
snprintf
#define snprintf
Definition: civetweb.c:1540
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
TGPrintDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:84
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
TGMainFrame::SetIconName
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1777
TGGotoDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:115
TGGotoDialog::fGoTo
TGTextEntry * fGoTo
goto line number entry widget
Definition: TGTextEditDialogs.h:116
TGWindow::RequestFocus
virtual void RequestFocus()
request focus
Definition: TGWindow.cxx:232
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
TGSearchDialog::fCancelButton
TGButton * fCancelButton
cancel button
Definition: TGTextEditDialogs.h:46
TString::Data
const char * Data() const
Definition: TString.h:369
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:27
TGPrintDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:83
TGTextBuffer::GetTextLength
UInt_t GetTextLength() const
Definition: TGTextBuffer.h:32
TGSearchDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:43
TSystem::Which
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1545
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGTextEditDialogs.h
TGPrintDialog
Definition: TGTextEditDialogs.h:78
TGComboBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:86
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGMsgBox
Definition: TGMsgBox.h:52
TGSearchDialog::fRetCode
Int_t * fRetCode
return code
Definition: TGTextEditDialogs.h:54
TGIcon.h
TGPrintDialog::fPrintCommandEntry
TGTextEntry * fPrintCommandEntry
command text entry widget
Definition: TGTextEditDialogs.h:90
TGHotString
TGHotString is a string with a "hot" character underlined.
Definition: TGString.h:42
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:24
kCM_CHECKBUTTON
@ kCM_CHECKBUTTON
Definition: WidgetMessageTypes.h:35
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
TGSearchDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:199
TGLabel
This class handles GUI labels.
Definition: TGLabel.h:24
TGSearchType::fBuffer
char * fBuffer
Definition: TGTextEditDialogs.h:23
TGFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:191
TGGotoDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:115
TGSearchDialog::fL10
TGLayoutHints * fL10
layout hints
Definition: TGTextEditDialogs.h:44
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TGWindow::kEditDisable
@ kEditDisable
disable edit of this window
Definition: TGWindow.h:50
TGClient::WaitFor
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Definition: TGClient.cxx:711
TGSearchDialog::fF4
TGCompositeFrame * fF4
sub frames
Definition: TGTextEditDialogs.h:41
TGGotoDialog::TGGotoDialog
TGGotoDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, Long_t *ret_code=nullptr, UInt_t options=kVerticalFrame)
Create a dialog to GoTo a specific line number.
Definition: TGTextEditDialogs.cxx:550
TGPrintDialog::fPrintCommand
char ** fPrintCommand
printer command to be used
Definition: TGTextEditDialogs.h:82
TGTextButton
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
TGGotoDialog::fLGoTo
TGLabel * fLGoTo
goto label
Definition: TGTextEditDialogs.h:118
TGComboBox::GetTextEntry
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:111
TGSearchDialog::TextEntered
virtual void TextEntered(const char *text)
emit signal when search text entered
Definition: TGTextEditDialogs.cxx:211
TGSearchDialog::SearchDialog
static TGSearchDialog *& SearchDialog()
Return global search dialog.
Definition: TGTextEditDialogs.cxx:303
TGSearchDialog::TGSearchDialog
TGSearchDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, TGSearchType *sstruct=0, Int_t *ret_code=0, UInt_t options=kVerticalFrame)
Create a search dialog box.
Definition: TGTextEditDialogs.cxx:63
gLastSearchString
static TString gLastSearchString
Definition: TGTextEditDialogs.cxx:55
TGPrintDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
Definition: TGTextEditDialogs.cxx:493
kCM_RADIOBUTTON
@ kCM_RADIOBUTTON
Definition: WidgetMessageTypes.h:36
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TString::EndsWith
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2202
TGGotoDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:638
TGComboBox::Select
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...
Definition: TGComboBox.cxx:456
TGPrintDialog::fPrintButton
TGButton * fPrintButton
print button
Definition: TGTextEditDialogs.h:87
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1022
TSystem::GetFromPipe
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Definition: TSystem.cxx:682
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1764
TGSearchDialog::fG2
TGGroupFrame * fG2
group frame
Definition: TGTextEditDialogs.h:49
TVirtualX.h
TGPrintDialog::fL6
TGLayoutHints * fL6
layout hints
Definition: TGTextEditDialogs.h:84
TGTextEntry::GetBuffer
TGTextBuffer * GetBuffer() const
Definition: TGTextEntry.h:112
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TGGotoDialog::fRetCode
Long_t * fRetCode
return code
Definition: TGTextEditDialogs.h:119
TGPrintDialog::fF5
TGCompositeFrame * fF5
sub frames
Definition: TGTextEditDialogs.h:83
TString
Basic string class.
Definition: TString.h:136
text
TText * text
Definition: entrylist_figure1.C:10
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:204
bool
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TGTextBuffer
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Definition: TGTextBuffer.h:19
TGGotoDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
Definition: TGTextEditDialogs.cxx:646
TGTextEntry::SelectAll
virtual void SelectAll()
Selects all text (i.e.
Definition: TGTextEntry.cxx:1028
TGPrintDialog::fBPrintCommand
TGTextBuffer * fBPrintCommand
printer and command text buffers
Definition: TGTextEditDialogs.h:91
kMWMDecorMenu
@ kMWMDecorMenu
Definition: TGFrame.h:67
TString::Last
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:916
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
TGSearchDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:42
kMWMInputModeless
@ kMWMInputModeless
Definition: TGFrame.h:57
TGSearchDialog::fDirectionRadio
TGRadioButton * fDirectionRadio[2]
search direction radio buttons
Definition: TGTextEditDialogs.h:47
TGGotoDialog::~TGGotoDialog
virtual ~TGGotoDialog()
Clean up goto dialog.
Definition: TGTextEditDialogs.cxx:623
TGIcon
This class handles GUI icons.
Definition: TGIcon.h:22
kLHintsBottom
@ kLHintsBottom
Definition: TGLayout.h:29
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TGCheckButton
Selects different options.
Definition: TGButton.h:264
TGSearchDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process search dialog widget messages.
Definition: TGTextEditDialogs.cxx:219
TGSearchDialog::~TGSearchDialog
virtual ~TGSearchDialog()
Clean up search dialog.
Definition: TGTextEditDialogs.cxx:180
TGSearchDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:42
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:276
TGCompositeFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1043
TString::Tokenize
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2222
kExecutePermission
@ kExecutePermission
Definition: TSystem.h:45
TGPrintDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:432
TSystem.h
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:28
TString::kTrailing
@ kTrailing
Definition: TString.h:267
TGRadioButton
Selects different options.
Definition: TGButton.h:322
h
#define h(i)
Definition: RSha256.hxx:106
TGPrintDialog::TGPrintDialog
TGPrintDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, char **printerName=nullptr, char **printProg=nullptr, Int_t *ret_code=nullptr, UInt_t options=kVerticalFrame)
Create the printer dialog box.
Definition: TGTextEditDialogs.cxx:314
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
TGGotoDialog::fCancelButton
TGButton * fCancelButton
cancel button
Definition: TGTextEditDialogs.h:114
TGGotoDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:112
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:72
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGPrintDialog::fLPrintCommand
TGLabel * fLPrintCommand
printer and command labels
Definition: TGTextEditDialogs.h:92
TGTextEntry
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
kMBIconExclamation
@ kMBIconExclamation
Definition: TGMsgBox.h:24
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGPrintDialog::fPrinterEntry
TGComboBox * fPrinterEntry
printer list combo widget
Definition: TGTextEditDialogs.h:89
TGSearchDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:41
kCM_BUTTON
@ kCM_BUTTON
Definition: WidgetMessageTypes.h:34
Long_t
long Long_t
Definition: RtypesCore.h:54
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:26
TString::First
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition: TString.cxx:523
TGComboBox::Layout
virtual void Layout()
layout combobox
Definition: TGComboBox.cxx:541
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGSearchType::fClose
Bool_t fClose
Definition: TGTextEditDialogs.h:24
TGGroupFrame
A composite frame with a border and a title.
Definition: TGFrame.h:522
StrDup
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2515
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
TGSearchDialog::fSearch
TGTextEntry * fSearch
search text entry widget
Definition: TGTextEditDialogs.h:50
kTE_ENTER
@ kTE_ENTER
Definition: WidgetMessageTypes.h:50
TGSearchDialog::fLSearch
TGLabel * fLSearch
label
Definition: TGTextEditDialogs.h:52
TObject::MakeZombie
void MakeZombie()
Definition: TObject.h:49
TGPrintDialog::~TGPrintDialog
virtual ~TGPrintDialog()
Clean up print dialog.
Definition: TGTextEditDialogs.cxx:414
line
TLine * line
Definition: entrylistblock_figure1.C:235
TGGotoDialog::fGotoButton
TGButton * fGotoButton
goto button
Definition: TGTextEditDialogs.h:113
TGSearchDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:41
TGSearchDialog::fCaseCheck
TGCheckButton * fCaseCheck
case check box
Definition: TGTextEditDialogs.h:48
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:314
kMBOk
@ kMBOk
Definition: TGMsgBox.h:33
TGComboBox
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition: TGComboBox.h:47
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:235
TGGotoDialog
Definition: TGTextEditDialogs.h:109
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TObject::IsZombie
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:149
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGLabel.h
TGPrintDialog::fF4
TGCompositeFrame * fF4
Definition: TGTextEditDialogs.h:83
TSystem::Getenv
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1662
TGPrintDialog::fRetCode
Int_t * fRetCode
return code
Definition: TGTextEditDialogs.h:93
TGGotoDialog::fBGoTo
TGTextBuffer * fBGoTo
goto line number text buffer
Definition: TGTextEditDialogs.h:117
TGPrintDialog::fL7
TGLayoutHints * fL7
Definition: TGTextEditDialogs.h:85
kC_TEXTENTRY
@ kC_TEXTENTRY
Definition: WidgetMessageTypes.h:48
TGPrintDialog::GetPrinters
virtual void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
Definition: TGTextEditDialogs.cxx:441
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TGSearchType::fCaseSensitive
Bool_t fCaseSensitive
Definition: TGTextEditDialogs.h:22
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
TObjArray.h
TGPrintDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:84
TGMsgBox.h
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
TGWindow::GetMainFrame
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:152
TGTransientFrame::CenterOnParent
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition: TGFrame.cxx:1931
TGPrintDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:84
kC_COMMAND
@ kC_COMMAND
Definition: WidgetMessageTypes.h:31
TGMainFrame::SetMWMHints
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition: TGFrame.cxx:1842
kMWMFuncAll
@ kMWMFuncAll
Definition: TGFrame.h:49
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGTextEntry.h
TGButton.h
kMWMDecorAll
@ kMWMDecorAll
Definition: TGFrame.h:63
TGPrintDialog::fLPrinter
TGLabel * fLPrinter
Definition: TGTextEditDialogs.h:92
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:111
TGGotoDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:115
TGSearchDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:42
kMWMDecorMaximize
@ kMWMDecorMaximize
Definition: TGFrame.h:69
TIter
Definition: TCollection.h:233
TGGotoDialog::fF2
TGCompositeFrame * fF2
sub frames
Definition: TGTextEditDialogs.h:112
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TGSearchDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:41
TGPrintDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:83
TGSearchType::fDirection
Bool_t fDirection
Definition: TGTextEditDialogs.h:21
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)=delete
kMWMFuncResize
@ kMWMFuncResize
Definition: TGFrame.h:50
TGSearchDialog::fgSearchDialog
static TGSearchDialog * fgSearchDialog
global singleton
Definition: TGTextEditDialogs.h:57
TGWindow::fEditDisabled
UInt_t fEditDisabled
flags used for "guibuilding"
Definition: TGWindow.h:32
TGSearchDialog
Definition: TGTextEditDialogs.h:38
kMWMFuncMaximize
@ kMWMFuncMaximize
Definition: TGFrame.h:53
TGSearchDialog::fL9
TGLayoutHints * fL9
layout hints
Definition: TGTextEditDialogs.h:43
TGClient::GetRoot
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:226
TGTextBuffer::AddText
void AddText(Int_t pos, const char *text)
Definition: TGTextBuffer.h:36
TGSearchDialog::fSearchButton
TGButton * fSearchButton
search button
Definition: TGTextEditDialogs.h:45
kTE_TEXTCHANGED
@ kTE_TEXTCHANGED
Definition: WidgetMessageTypes.h:49
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:190
TGString
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
TGSearchDialog::fCombo
TGComboBox * fCombo
text entry combobox
Definition: TGTextEditDialogs.h:55
TGPrintDialog::fBPrinter
TGTextBuffer * fBPrinter
Definition: TGTextEditDialogs.h:91
TGPrintDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:84
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:56
TGTextBuffer::GetString
const char * GetString() const
Definition: TGTextBuffer.h:34
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGSearchDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:43
TGSearchType
Definition: TGTextEditDialogs.h:19
main
int main(int argc, char *argv[])
Definition: cef_main.cxx:54
TGPrintDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:83
TGGotoDialog::fL21
TGLayoutHints * fL21
layout hints
Definition: TGTextEditDialogs.h:115
TGSearchDialog::fType
TGSearchType * fType
search type structure
Definition: TGTextEditDialogs.h:53
int
TGSearchDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:43
TGComboBox::ReturnPressed
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
Definition: TGComboBox.cxx:663