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 // //
25 // TGTextEditDialogs //
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 #include "TGTextEditDialogs.h"
35 #include "TGButton.h"
36 #include "TGLabel.h"
37 #include "TGTextEntry.h"
38 #include "TGIcon.h"
39 #include "TGMsgBox.h"
40 #include "TGComboBox.h"
41 #include "TSystem.h"
42 #include "TObjArray.h"
43 #include "TVirtualX.h"
44 #include "strlcpy.h"
45 #include "snprintf.h"
46 
47 #include <cstdlib>
48 
49 
53 
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 /// Create a search dialog box. Used to get from the user the required
59 /// search instructions. Ret_code is kTRUE when sstruct has been set,
60 /// kFALSE otherwise (like when dialog was canceled).
61 
63  UInt_t w, UInt_t h, TGSearchType *sstruct,
64  Int_t *ret_code, UInt_t options) :
65  TGTransientFrame(p, main, w, h, options)
66 {
67  if (!p && !main) {
68  MakeZombie();
69  // coverity [uninit_ctor]
70  return;
71  }
72  fRetCode = ret_code;
73  fType = sstruct;
74 
76 
77  fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
78  fF2 = new TGCompositeFrame(this, 60, 20, kVerticalFrame);
79  fF3 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
80  fF4 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
81 
82  fSearchButton = new TGTextButton(fF1, new TGHotString("&Search"), 1);
83  fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
85 
86  fSearchButton->Associate(this);
87  fCancelButton->Associate(this);
88 
89  fL1 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0);
91  2, 5, 0, 2);
92  fL21 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
93 
96 
97  AddFrame(fF1, fL21);
98 
99  fLSearch = new TGLabel(fF3, new TGHotString("Search &for:"));
100 
101  fCombo = new TGComboBox(fF3, "");
104  if (sstruct && sstruct->fBuffer)
105  fBSearch->AddText(0, sstruct->fBuffer);
106  else if (!gLastSearchString.IsNull())
108  else
110  fSearch->Associate(this);
112  fSearch->SelectAll();
113 
114  fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
115  fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
116 
118  fF3->AddFrame(fCombo, fL6);
119 
120  fG2 = new TGGroupFrame(fF4, new TGString("Direction"), kHorizontalFrame);
121 
122  fL3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 2, 2);
123  fL9 = new TGLayoutHints(kLHintsBottom | kLHintsLeft, 0, 0, 0, 0);
124  fL4 = new TGLayoutHints(kLHintsBottom | kLHintsLeft, 0, 0, 5, 0);
125  fL10 = new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 0);
126 
127  fCaseCheck = new TGCheckButton(fF4, new TGHotString("&Case sensitive"), 1);
128  fCaseCheck->Associate(this);
130 
131  fDirectionRadio[0] = new TGRadioButton(fG2, new TGHotString("Forward"), 1);
132  fDirectionRadio[1] = new TGRadioButton(fG2, new TGHotString("Backward"), 2);
133 
136  fDirectionRadio[0]->Associate(this);
137  fDirectionRadio[1]->Associate(this);
138 
139  if (fType->fCaseSensitive == kFALSE)
141  else
143 
144  if (fType->fDirection)
146  else
148 
149  fF4->AddFrame(fG2, fL3);
150 
151  fF2->AddFrame(fF3, fL1);
152  fF2->AddFrame(fF4, fL1);
153 
154  AddFrame(fF2, fL2);
155 
156  MapSubwindows();
159 
160  CenterOnParent();
161 
162  SetWindowName("Search");
163  SetIconName("Search");
164 
168 
169  if (fType->fClose) {
170  MapWindow();
172  fClient->WaitFor(this);
173  }
174 }
175 
176 ////////////////////////////////////////////////////////////////////////////////
177 /// Clean up search dialog.
178 
180 {
181  if (IsZombie()) return;
182  delete fSearchButton;
183  delete fCancelButton;
184  delete fDirectionRadio[0]; delete fDirectionRadio[1];
185  delete fCaseCheck;
186  delete fCombo;
187  delete fLSearch;
188  delete fG2;
189  delete fF1; delete fF2; delete fF3; delete fF4;
190  delete fL1; delete fL2; delete fL3; delete fL4; delete fL5; delete fL6;
191  delete fL21;delete fL9; delete fL10;
192 }
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// Close the dialog. On close the dialog will be deleted and cannot be
196 /// re-used.
197 
199 {
200  if (fType->fClose) {
201  DeleteWindow();
202  } else {
203  UnmapWindow();
204  }
205 }
206 
207 ////////////////////////////////////////////////////////////////////////////////
208 /// emit signal when search text entered
209 
211 {
212  Emit("TextEntered(const char *)", text);
213 }
214 
215 ////////////////////////////////////////////////////////////////////////////////
216 /// Process search dialog widget messages.
217 
219 {
220  const char *string;
221 
222  switch (GET_MSG(msg)) {
223  case kC_COMMAND:
224  switch (GET_SUBMSG(msg)) {
225  case kCM_BUTTON:
226  switch (parm1) {
227  case 1:
228  string = fBSearch->GetString();
229  if (fType->fBuffer)
230  delete [] fType->fBuffer;
231  fType->fBuffer = StrDup(string);
232  gLastSearchString = string;
233  *fRetCode = kTRUE;
234  TextEntered(string);
236  if (fType->fClose) CloseWindow();
237  break;
238  case 2:
239  *fRetCode = kFALSE;
240  CloseWindow();
241  break;
242  }
243  break;
244 
245  case kCM_CHECKBUTTON:
247  break;
248 
249  case kCM_RADIOBUTTON:
250  switch (parm1) {
251  case 1:
254  break;
255  case 2:
258  break;
259  }
260  break;
261 
262  default:
263  break;
264  }
265  break;
266 
267  case kC_TEXTENTRY:
268  switch (GET_SUBMSG(msg)) {
269  case kTE_TEXTCHANGED:
270  string = fBSearch->GetString();
271  if (!string[0]) {
273  } else {
275  }
276  break;
277  case kTE_ENTER:
278  string = fBSearch->GetString();
279  if (fType->fBuffer)
280  delete [] fType->fBuffer;
281  fType->fBuffer = StrDup(string);
282  gLastSearchString = string;
283  *fRetCode = kTRUE;
284  TextEntered(string);
285  if (fType->fClose) CloseWindow();
286  break;
287  default:
288  break;
289  }
290  break;
291 
292  default:
293  break;
294  }
295 
296  return kTRUE;
297 }
298 
299 ////////////////////////////////////////////////////////////////////////////////
300 /// Return global search dialog.
301 
303 {
304  return fgSearchDialog;
305 }
306 
307 
308 ////////////////////////////////////////////////////////////////////////////////
309 /// Create the printer dialog box. Returns kTRUE in ret_code when
310 /// printerName and printProg have been set and cancel was not pressed,
311 /// kFALSE otherwise.
312 
314  UInt_t w, UInt_t h, char **printerName,
315  char **printProg, Int_t *ret_code,
316  UInt_t options) :
317  TGTransientFrame(p, main, w, h, options)
318 {
319  if (!p && !main) {
320  MakeZombie();
321  // coverity [uninit_ctor]
322  return;
323  }
324  fPrinter = printerName;
325  fPrintCommand = printProg;
326  fRetCode = ret_code;
328 
330 
331  fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
332  fF5 = new TGCompositeFrame(this, 60, 20, kHorizontalFrame);
333  fF2 = new TGCompositeFrame(fF5, 60, 20, kVerticalFrame);
334  fF3 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
335  fF4 = new TGCompositeFrame(fF2, 60, 20, kHorizontalFrame);
336 
337  fPrintButton = new TGTextButton(fF1, new TGHotString("&Print"), 1);
338  fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
340 
341  fPrintButton->Associate(this);
342  fCancelButton->Associate(this);
343 
344  fL1 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2);
346  2, 5, 0, 2);
347  fL3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 4, 4);
348  fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
349  fL6 = new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 2, 0, 0);
350  fL7 = new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10);
351 
352  fL21 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
353 
356  AddFrame(fF1, fL3);
357 
358 
359  fLPrintCommand = new TGLabel(fF3, new TGHotString("Print command:"));
360  fBPrintCommand = new TGTextBuffer(50);
361  if ((printProg) && (*printProg))
362  fBPrintCommand->AddText(0, *printProg);
366 
369 
370  fLPrinter = new TGLabel(fF4, new TGHotString("Printer:"));
371  if ((printerName) && (*printerName))
372  fPrinterEntry = new TGComboBox(fF4, *printerName);
377 
378  fF2->AddFrame(fF3, fL1);
379  fF2->AddFrame(fF4, fL1);
380 
381  const TGPicture *printerPicture = fClient->GetPicture("printer_s.xpm");
382  if (!printerPicture) {
383  Error("TGPrintDialog", "printer_s.xpm not found");
384  fPrinterIcon = 0;
385  } else {
386  fPrinterIcon = new TGIcon(fF5, printerPicture, 32, 32);
388  }
389  fF5->AddFrame(fF2, fL1);
390  AddFrame(fF5, fL1);
391 
392  MapSubwindows();
394 
395  GetPrinters();
396  CenterOnParent();
397 
398  SetWindowName("Print");
399  SetIconName("Print");
400 
404 
406  MapWindow();
407  fClient->WaitFor(this);
408 }
409 
410 ////////////////////////////////////////////////////////////////////////////////
411 /// Clean up print dialog.
412 
414 {
415  if (IsZombie()) return;
416  delete fPrinterIcon;
417  delete fPrintButton;
418  delete fCancelButton;
419  delete fPrinterEntry; // deletes also fBPrinter
420  delete fPrintCommandEntry; // deletes also fBPrintCommand
421  delete fLPrinter; delete fLPrintCommand;
422  delete fF1; delete fF2; delete fF3; delete fF4; delete fF5;
423  delete fL1; delete fL2; delete fL3; delete fL5; delete fL6; delete fL7;
424  delete fL21;
425 }
426 
427 ////////////////////////////////////////////////////////////////////////////////
428 /// Close the dialog. On close the dialog will be deleted and cannot be
429 /// re-used.
430 
432 {
433  DeleteWindow();
434 }
435 
436 ////////////////////////////////////////////////////////////////////////////////
437 /// Ask the system fo the list of available printers and populate the combo
438 /// box. If there is a default printer, select it in the list.
439 
441 {
442  TObject *obj;
443  Int_t idx = 1, dflt =1;
444 
445  if (gVirtualX->InheritsFrom("TGX11") || gVirtualX->InheritsFrom("TGCocoa")) {
446  char *lpstat = gSystem->Which(gSystem->Getenv("PATH"), "lpstat",
448  if (lpstat == 0) return;
449  TString defaultprinter = gSystem->GetFromPipe("lpstat -d");
450  TString printerlist = gSystem->GetFromPipe("lpstat -v");
451  TObjArray *tokens = printerlist.Tokenize("\n");
452  TIter iter(tokens);
453  while((obj = iter())) {
454  TString line = obj->GetName();
455  TObjArray *tk = line.Tokenize(" ");
456  TString pname = ((TObject*)tk->At(2))->GetName();
457  if (pname.EndsWith(":")) pname.Remove(pname.Last(':'));
458  //if (pname.Contains(":")) pname.Remove(pname.Last(':'));
459  if (defaultprinter.Contains(pname)) {
460  dflt = idx;
462  }
463  fPrinterEntry->AddEntry(pname.Data(), idx++);
464  }
465  delete [] lpstat;
466  }
467  else {
468  TString defaultprinter = gSystem->GetFromPipe("WMIC Path Win32_Printer where Default=TRUE Get DeviceID");
469  TString printerlist = gSystem->GetFromPipe("WMIC Path Win32_Printer Get DeviceID");
470  defaultprinter.Remove(0, defaultprinter.First('\n')); // remove "Default"
471  printerlist.Remove(0, printerlist.First('\n')); // remove "DeviceID"
472  printerlist.ReplaceAll("\r", "");
473  TObjArray *tokens = printerlist.Tokenize("\n");
474  TIter iter(tokens);
475  while((obj = iter())) {
476  TString pname = obj->GetName();
477  pname.Remove(TString::kTrailing, ' ');
478  if (defaultprinter.Contains(pname)) {
479  dflt = idx;
481  }
482  fPrinterEntry->AddEntry(pname.Data(), idx++);
483  }
484  }
485  fPrinterEntry->Select(dflt, kFALSE);
487 }
488 
489 ////////////////////////////////////////////////////////////////////////////////
490 /// Process print dialog widget messages.
491 
493 {
494  const char *string, *txt;
495 
496  switch (GET_MSG(msg)) {
497  case kC_COMMAND:
498  switch (GET_SUBMSG(msg)) {
499  case kCM_BUTTON:
500  switch (parm1) {
501  case 1:
502  *fRetCode = kTRUE;
503  {
504  string = fBPrinter->GetString();
505  delete [] *fPrinter;
506  const size_t prSize = strlen(string) + 1;
507  *fPrinter = new char[prSize];
508  strlcpy(*fPrinter, string, prSize);
509  }
510  {
511  string = fBPrintCommand->GetString();
512  delete [] *fPrintCommand;
513  const size_t cmdSize = strlen(string) + 1;
514  *fPrintCommand = new char[cmdSize];
515  strlcpy(*fPrintCommand, string, cmdSize);
516  }
517 
518  if (fBPrintCommand->GetTextLength() == 0) {
519  txt = "Please provide print command or use \"Cancel\"";
521  "Missing Print Parameters", txt, kMBIconExclamation,
522  kMBOk);
523  return kTRUE;
524  }
525  CloseWindow();
526  break;
527  case 2:
528  *fRetCode = kFALSE;
529  CloseWindow();
530  break;
531  }
532  break;
533  }
534  break;
535 
536  default:
537  break;
538  }
539 
540  return kTRUE;
541 }
542 
543 ////////////////////////////////////////////////////////////////////////////////
544 /// Create a dialog to GoTo a specific line number. Returns -1 in
545 /// ret_code in case no valid line number was given or in case
546 /// cancel was pressed. If on input *ret_code is > 0 then this value
547 /// will be used as default value.
548 
550  UInt_t w, UInt_t h, Long_t *ret_code,
551  UInt_t options) :
552  TGTransientFrame(p, main, w, h, options)
553 {
554  if (!p && !main) {
555  MakeZombie();
556  // coverity [uninit_ctor]
557  return;
558  }
559  fRetCode = ret_code;
561 
563 
564  fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
565  fF2 = new TGCompositeFrame(this, 60, 20, kHorizontalFrame);
566 
567  fGotoButton = new TGTextButton(fF1, new TGHotString("&Goto"), 1);
568  fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
570 
571  fGotoButton->Associate(this);
572  fCancelButton->Associate(this);
573 
574  fL1 = new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 2, 2, 3, 0);
575  fL21 = new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 5, 10, 0);
576 
579  AddFrame(fF1, fL21);
580 
581  fLGoTo = new TGLabel(fF2, new TGHotString("&Goto Line:"));
582 
583  fBGoTo = new TGTextBuffer(50);
584  if (*fRetCode > 0) {
585  char curline[32];
586  snprintf(curline, 32, "%ld", *fRetCode);
587  fBGoTo->AddText(0, curline);
588  } else
590  fGoTo = new TGTextEntry(fF2, fBGoTo);
591  fGoTo->Associate(this);
593  fGoTo->SelectAll();
594 
595  fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
596  fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
597 
598  fF2->AddFrame(fLGoTo, fL5);
599  fF2->AddFrame(fGoTo, fL5);
600  AddFrame(fF2, fL1);
601 
602  MapSubwindows();
604 
605  CenterOnParent();
606 
607  SetWindowName("Goto");
608  SetIconName("Print");
609 
613 
614  MapWindow();
615  fGoTo->RequestFocus();
616  fClient->WaitFor(this);
617 }
618 
619 ////////////////////////////////////////////////////////////////////////////////
620 /// Clean up goto dialog
621 
623 {
624  if (IsZombie()) return;
625  delete fGotoButton;
626  delete fCancelButton;
627  delete fGoTo;
628  delete fLGoTo;
629  delete fF1; delete fF2;
630  delete fL1; delete fL5; delete fL6; delete fL21;
631 }
632 
633 ////////////////////////////////////////////////////////////////////////////////
634 /// Close the dialog. On close the dialog will be deleted and cannot be
635 /// re-used.
636 
638 {
639  DeleteWindow();
640 }
641 
642 ////////////////////////////////////////////////////////////////////////////////
643 /// Process goto dialog widget messages.
644 
646 {
647  const char *string;
648 
649  switch (GET_MSG(msg)) {
650  case kC_COMMAND:
651  switch (GET_SUBMSG(msg)) {
652  case kCM_BUTTON:
653  switch (parm1) {
654  case 1:
655  string = fBGoTo->GetString();
656  *fRetCode = (Long_t) atof(string);
657  CloseWindow();
658  break;
659  case 2:
660  *fRetCode = -1;
661  CloseWindow();
662  break;
663  }
664  break;
665 
666  default:
667  break;
668  }
669  break;
670 
671  case kC_TEXTENTRY:
672  switch (GET_SUBMSG(msg)) {
673  case kTE_TEXTCHANGED:
674  string = fBGoTo->GetString();
675  if (!string[0])
677  else
679  break;
680  case kTE_ENTER:
681  string = fBGoTo->GetString();
682  *fRetCode = (Long_t) atof(string);
683  CloseWindow();
684  break;
685  default:
686  break;
687  }
688  break;
689 
690  default:
691  break;
692  }
693 
694  return kTRUE;
695 }
696 
TGComboBox.h
TGCompositeFrame::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
TGPrintDialog::fPrinterIcon
TGIcon * fPrinterIcon
Definition: TGTextEditDialogs.h:97
TGPrintDialog::fCancelButton
TGButton * fCancelButton
Definition: TGTextEditDialogs.h:99
TGRadioButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set radio button state.
Definition: TGButton.cxx:1566
TGTransientFrame
Definition: TGFrame.h:553
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:112
TGPrintDialog::fPrinter
char ** fPrinter
Definition: TGTextEditDialogs.h:92
TGWindow
Definition: TGWindow.h:31
TGSearchDialog::fL4
TGLayoutHints * fL4
Definition: TGTextEditDialogs.h:53
TGPrintDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:96
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1203
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
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:623
TGSearchDialog::fBSearch
TGTextBuffer * fBSearch
Definition: TGTextEditDialogs.h:62
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
snprintf
#define snprintf
Definition: civetweb.c:1540
TObjArray
Definition: TObjArray.h:37
TGPrintDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:95
TGPicture
Definition: TGPicture.h:36
TGMainFrame::SetIconName
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1762
TGGotoDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:126
TGGotoDialog::fGoTo
TGTextEntry * fGoTo
Definition: TGTextEditDialogs.h:127
TGWindow::RequestFocus
virtual void RequestFocus()
request focus
Definition: TGWindow.cxx:213
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)
kButtonDown
@ kButtonDown
Definition: TGButton.h:60
TGSearchDialog::fCancelButton
TGButton * fCancelButton
Definition: TGTextEditDialogs.h:57
TString::Data
const char * Data() const
Definition: TString.h:369
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:40
TGPrintDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:94
TGTextBuffer::GetTextLength
UInt_t GetTextLength() const
Definition: TGTextBuffer.h:51
TGSearchDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:54
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:1544
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGTextEditDialogs.h
TGPrintDialog
Definition: TGTextEditDialogs.h:89
TGComboBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGMsgBox
Definition: TGMsgBox.h:63
TGSearchDialog::fRetCode
Int_t * fRetCode
Definition: TGTextEditDialogs.h:65
TGIcon.h
TGPrintDialog::fPrintCommandEntry
TGTextEntry * fPrintCommandEntry
Definition: TGTextEditDialogs.h:101
TGHotString
Definition: TGString.h:52
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:37
kCM_CHECKBUTTON
@ kCM_CHECKBUTTON
Definition: WidgetMessageTypes.h:43
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGSearchDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:198
TGLabel
Definition: TGLabel.h:32
TGSearchType::fBuffer
char * fBuffer
Definition: TGTextEditDialogs.h:40
TGFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
TGGotoDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:126
TGSearchDialog::fL10
TGLayoutHints * fL10
Definition: TGTextEditDialogs.h:55
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
TGWindow::kEditDisable
@ kEditDisable
Definition: TGWindow.h:58
TGClient::WaitFor
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Definition: TGClient.cxx:709
TGSearchDialog::fF4
TGCompositeFrame * fF4
Definition: TGTextEditDialogs.h:52
TGPrintDialog::fPrintCommand
char ** fPrintCommand
Definition: TGTextEditDialogs.h:93
TGTextButton
Definition: TGButton.h:142
TGGotoDialog::fLGoTo
TGLabel * fLGoTo
Definition: TGTextEditDialogs.h:129
TGComboBox::GetTextEntry
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
TGSearchDialog::TextEntered
virtual void TextEntered(const char *text)
emit signal when search text entered
Definition: TGTextEditDialogs.cxx:210
TGSearchDialog::SearchDialog
static TGSearchDialog *& SearchDialog()
Return global search dialog.
Definition: TGTextEditDialogs.cxx:302
gLastSearchString
static TString gLastSearchString
Definition: TGTextEditDialogs.cxx:54
TGPrintDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
Definition: TGTextEditDialogs.cxx:492
kCM_RADIOBUTTON
@ kCM_RADIOBUTTON
Definition: WidgetMessageTypes.h:44
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:2177
TGGotoDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:637
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:451
TGPrintDialog::fPrintButton
TGButton * fPrintButton
Definition: TGTextEditDialogs.h:98
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1007
TSystem::GetFromPipe
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Definition: TSystem.cxx:681
TGGotoDialog::TGGotoDialog
TGGotoDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, Long_t *ret_code=0, UInt_t options=kVerticalFrame)
Create a dialog to GoTo a specific line number.
Definition: TGTextEditDialogs.cxx:549
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1749
TGSearchDialog::fG2
TGGroupFrame * fG2
Definition: TGTextEditDialogs.h:60
TVirtualX.h
TGPrintDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:95
TGTextEntry::GetBuffer
TGTextBuffer * GetBuffer() const
Definition: TGTextEntry.h:127
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TGGotoDialog::fRetCode
Long_t * fRetCode
Definition: TGTextEditDialogs.h:130
TGPrintDialog::fF5
TGCompositeFrame * fF5
Definition: TGTextEditDialogs.h:94
TString
Definition: TString.h:136
text
TText * text
Definition: entrylist_figure1.C:10
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:229
bool
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TGTextBuffer
Definition: TGTextBuffer.h:30
TGGotoDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
Definition: TGTextEditDialogs.cxx:645
TGTextEntry::SelectAll
virtual void SelectAll()
Selects all text (i.e.
Definition: TGTextEntry.cxx:1040
TGPrintDialog::fBPrintCommand
TGTextBuffer * fBPrintCommand
Definition: TGTextEditDialogs.h:102
kMWMDecorMenu
@ kMWMDecorMenu
Definition: TGFrame.h:76
TString::Last
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:892
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
TGSearchDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:53
kMWMInputModeless
@ kMWMInputModeless
Definition: TGFrame.h:66
TGSearchDialog::fDirectionRadio
TGRadioButton * fDirectionRadio[2]
Definition: TGTextEditDialogs.h:58
TGGotoDialog::~TGGotoDialog
virtual ~TGGotoDialog()
Clean up goto dialog.
Definition: TGTextEditDialogs.cxx:622
TGIcon
Definition: TGIcon.h:30
kLHintsBottom
@ kLHintsBottom
Definition: TGLayout.h:42
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TGCheckButton
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:218
TGSearchDialog::~TGSearchDialog
virtual ~TGSearchDialog()
Clean up search dialog.
Definition: TGTextEditDialogs.cxx:179
TGSearchDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:53
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:261
TGCompositeFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1028
TString::Tokenize
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2197
TGPrintDialog::TGPrintDialog
TGPrintDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, char **printerName=0, char **printProg=0, Int_t *ret_code=0, UInt_t options=kVerticalFrame)
Create the printer dialog box.
Definition: TGTextEditDialogs.cxx:313
kExecutePermission
@ kExecutePermission
Definition: TSystem.h:45
TGPrintDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:431
TSystem.h
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:41
TString::kTrailing
@ kTrailing
Definition: TString.h:267
TGRadioButton
Definition: TGButton.h:322
h
#define h(i)
Definition: RSha256.hxx:124
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
TGGotoDialog::fCancelButton
TGButton * fCancelButton
Definition: TGTextEditDialogs.h:125
TGGotoDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:123
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGPrintDialog::fLPrintCommand
TGLabel * fLPrintCommand
Definition: TGTextEditDialogs.h:103
TGTextEntry
Definition: TGTextEntry.h:39
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
kMBIconExclamation
@ kMBIconExclamation
Definition: TGMsgBox.h:41
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGPrintDialog::fPrinterEntry
TGComboBox * fPrinterEntry
Definition: TGTextEditDialogs.h:100
TGSearchDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:52
kCM_BUTTON
@ kCM_BUTTON
Definition: WidgetMessageTypes.h:42
Long_t
long Long_t
Definition: RtypesCore.h:54
main
int main(int argc, char **argv)
Definition: histspeedtest.cxx:751
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:39
TString::First
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition: TString.cxx:499
TGComboBox::Layout
virtual void Layout()
layout combobox
Definition: TGComboBox.cxx:535
TGLayoutHints
Definition: TGLayout.h:57
TGSearchType::fClose
Bool_t fClose
Definition: TGTextEditDialogs.h:41
TGGroupFrame
Definition: TGFrame.h:587
StrDup
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:290
TGSearchDialog::fSearch
TGTextEntry * fSearch
Definition: TGTextEditDialogs.h:61
kTE_ENTER
@ kTE_ENTER
Definition: WidgetMessageTypes.h:58
TGSearchDialog::fLSearch
TGLabel * fLSearch
Definition: TGTextEditDialogs.h:63
TObject::MakeZombie
void MakeZombie()
Definition: TObject.h:49
TGPrintDialog::~TGPrintDialog
virtual ~TGPrintDialog()
Clean up print dialog.
Definition: TGTextEditDialogs.cxx:413
line
TLine * line
Definition: entrylistblock_figure1.C:235
TGGotoDialog::fGotoButton
TGButton * fGotoButton
Definition: TGTextEditDialogs.h:124
TGSearchDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:52
TGSearchDialog::fCaseCheck
TGCheckButton * fCaseCheck
Definition: TGTextEditDialogs.h:59
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
kMBOk
@ kMBOk
Definition: TGMsgBox.h:44
TGComboBox
Definition: TGComboBox.h:67
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:188
TGGotoDialog
Definition: TGTextEditDialogs.h:120
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TObject::IsZombie
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:134
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGLabel.h
TGPrintDialog::fF4
TGCompositeFrame * fF4
Definition: TGTextEditDialogs.h:94
TSystem::Getenv
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1661
TGPrintDialog::fRetCode
Int_t * fRetCode
Definition: TGTextEditDialogs.h:104
TGGotoDialog::fBGoTo
TGTextBuffer * fBGoTo
Definition: TGTextEditDialogs.h:128
TGPrintDialog::fL7
TGLayoutHints * fL7
Definition: TGTextEditDialogs.h:96
kC_TEXTENTRY
@ kC_TEXTENTRY
Definition: WidgetMessageTypes.h:56
TGPrintDialog::GetPrinters
virtual void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
Definition: TGTextEditDialogs.cxx:440
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TGSearchType::fCaseSensitive
Bool_t fCaseSensitive
Definition: TGTextEditDialogs.h:39
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
TObjArray.h
TGPrintDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:95
TGMsgBox.h
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGWindow::GetMainFrame
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:133
TGTransientFrame::CenterOnParent
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition: TGFrame.cxx:1916
TGPrintDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:95
kC_COMMAND
@ kC_COMMAND
Definition: WidgetMessageTypes.h:39
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:1827
kMWMFuncAll
@ kMWMFuncAll
Definition: TGFrame.h:58
TObject
Definition: TObject.h:37
TGTextEntry.h
TGButton.h
kMWMDecorAll
@ kMWMDecorAll
Definition: TGFrame.h:72
TGPrintDialog::fLPrinter
TGLabel * fLPrinter
Definition: TGTextEditDialogs.h:103
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:113
TGGotoDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:126
TGSearchDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:53
kMWMDecorMaximize
@ kMWMDecorMaximize
Definition: TGFrame.h:78
TIter
Definition: TCollection.h:233
TGGotoDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:123
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:43
TGSearchDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:52
TGPrintDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:94
TGSearchType::fDirection
Bool_t fDirection
Definition: TGTextEditDialogs.h:38
TGSearchDialog::TGSearchDialog
TGSearchDialog(const TGWindow *p=0, const TGWindow *main=0, 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:62
kMWMFuncResize
@ kMWMFuncResize
Definition: TGFrame.h:59
TGSearchDialog::fgSearchDialog
static TGSearchDialog * fgSearchDialog
Definition: TGTextEditDialogs.h:68
TGWindow::fEditDisabled
UInt_t fEditDisabled
Definition: TGWindow.h:40
TGSearchDialog
Definition: TGTextEditDialogs.h:49
kMWMFuncMaximize
@ kMWMFuncMaximize
Definition: TGFrame.h:62
TGSearchDialog::fL9
TGLayoutHints * fL9
Definition: TGTextEditDialogs.h:54
TGClient::GetRoot
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:225
TGTextBuffer::AddText
void AddText(Int_t pos, const char *text)
Definition: TGTextBuffer.h:55
TGSearchDialog::fSearchButton
TGButton * fSearchButton
Definition: TGTextEditDialogs.h:56
kTE_TEXTCHANGED
@ kTE_TEXTCHANGED
Definition: WidgetMessageTypes.h:57
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TGFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:215
TGString
Definition: TGString.h:30
TGSearchDialog::fCombo
TGComboBox * fCombo
Definition: TGTextEditDialogs.h:66
TGPrintDialog::fBPrinter
TGTextBuffer * fBPrinter
Definition: TGTextEditDialogs.h:102
TGPrintDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:95
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:62
TGTextBuffer::GetString
const char * GetString() const
Definition: TGTextBuffer.h:53
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:54
TGSearchType
Definition: TGTextEditDialogs.h:30
TGPrintDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:94
TGGotoDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:126
TGSearchDialog::fType
TGSearchType * fType
Definition: TGTextEditDialogs.h:64
int
TGSearchDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:54
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:656