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
27This file defines several dialogs that are used by the TGTextEdit
28widget via its associated context popup menu.
29The following dialogs are available: TGSearchDialog, TGGotoDialog
30and 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);
82
83 fSearchButton = new TGTextButton(fF1, new TGHotString("&Search"), 1);
84 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
86
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
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);
114
115 fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
116 fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
117
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
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
160
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);
337
338 fPrintButton = new TGTextButton(fF1, new TGHotString("&Print"), 1);
339 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
341
342 fPrintButton->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:"));
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
395
396 GetPrinters();
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 }
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);
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
601 AddFrame(fF2, fL1);
602
605
607
608 SetWindowName("Goto");
609 SetIconName("Print");
610
614
615 MapWindow();
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
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
long Long_t
Definition: CPyCppyy.h:50
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:364
@ kButtonDown
Definition: TGButton.h:54
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
@ kMWMFuncAll
Definition: TGFrame.h:49
@ kMWMFuncResize
Definition: TGFrame.h:50
@ kMWMDecorMaximize
Definition: TGFrame.h:69
@ kMWMDecorMenu
Definition: TGFrame.h:67
@ kMWMDecorAll
Definition: TGFrame.h:63
@ kMWMFuncMaximize
Definition: TGFrame.h:53
@ kMWMInputModeless
Definition: TGFrame.h:57
@ kLHintsRight
Definition: TGLayout.h:26
@ kLHintsLeft
Definition: TGLayout.h:24
@ kLHintsCenterY
Definition: TGLayout.h:28
@ kLHintsBottom
Definition: TGLayout.h:29
@ kLHintsTop
Definition: TGLayout.h:27
@ kLHintsExpandX
Definition: TGLayout.h:30
@ kMBOk
Definition: TGMsgBox.h:33
@ kMBIconExclamation
Definition: TGMsgBox.h:24
static TString gLastSearchString
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2515
@ kExecutePermission
Definition: TSystem.h:45
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
#define gVirtualX
Definition: TVirtualX.h:338
Int_t GET_MSG(Long_t val)
@ kTE_TEXTCHANGED
@ kTE_ENTER
@ kC_COMMAND
@ kCM_BUTTON
@ kC_TEXTENTRY
@ kCM_RADIOBUTTON
@ kCM_CHECKBUTTON
Int_t GET_SUBMSG(Long_t val)
#define snprintf
Definition: civetweb.c:1540
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:235
Selects different options.
Definition: TGButton.h:264
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:226
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Definition: TGClient.cxx:711
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
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
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:86
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:111
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
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
Definition: TGComboBox.cxx:663
virtual void Layout()
layout combobox
Definition: TGComboBox.cxx:541
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1043
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:316
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:314
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1022
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:190
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:191
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:276
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
virtual void MapWindow()
map window
Definition: TGFrame.h:204
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
virtual void CloseWindow()
Close the dialog.
TGLabel * fLGoTo
goto label
TGCompositeFrame * fF2
sub frames
TGTextBuffer * fBGoTo
goto line number text buffer
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
TGCompositeFrame * fF1
TGTextEntry * fGoTo
goto line number entry widget
TGLayoutHints * fL1
TGLayoutHints * fL21
layout hints
TGButton * fGotoButton
goto button
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.
virtual ~TGGotoDialog()
Clean up goto dialog.
Long_t * fRetCode
return code
TGButton * fCancelButton
cancel button
TGLayoutHints * fL5
TGLayoutHints * fL6
A composite frame with a border and a title.
Definition: TGFrame.h:522
TGHotString is a string with a "hot" character underlined.
Definition: TGString.h:42
This class handles GUI icons.
Definition: TGIcon.h:22
This class handles GUI labels.
Definition: TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1783
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition: TGFrame.cxx:1848
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1770
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
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.
TGTextEntry * fPrintCommandEntry
command text entry widget
char ** fPrinter
printer to be used
TGLayoutHints * fL1
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
TGLabel * fLPrintCommand
printer and command labels
TGTextBuffer * fBPrintCommand
printer and command text buffers
char ** fPrintCommand
printer command to be used
TGCompositeFrame * fF4
TGButton * fPrintButton
print button
virtual ~TGPrintDialog()
Clean up print dialog.
virtual void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
TGLayoutHints * fL2
TGCompositeFrame * fF3
TGButton * fCancelButton
cancel button
TGIcon * fPrinterIcon
printer icon
virtual void CloseWindow()
Close the dialog.
TGLayoutHints * fL6
layout hints
TGTextBuffer * fBPrinter
TGLabel * fLPrinter
Int_t * fRetCode
return code
TGComboBox * fPrinterEntry
printer list combo widget
TGLayoutHints * fL3
TGLayoutHints * fL5
TGLayoutHints * fL21
layout hints
TGLayoutHints * fL7
TGCompositeFrame * fF1
TGCompositeFrame * fF5
sub frames
TGCompositeFrame * fF2
Selects different options.
Definition: TGButton.h:322
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set radio button state.
Definition: TGButton.cxx:1613
TGLabel * fLSearch
label
TGLayoutHints * fL2
TGButton * fSearchButton
search button
TGLayoutHints * fL21
static TGSearchDialog *& SearchDialog()
Return global search dialog.
TGTextEntry * fSearch
search text entry widget
TGLayoutHints * fL10
layout hints
TGCompositeFrame * fF3
TGSearchType * fType
search type structure
Int_t * fRetCode
return code
TGLayoutHints * fL1
TGRadioButton * fDirectionRadio[2]
search direction radio buttons
TGCheckButton * fCaseCheck
case check box
TGLayoutHints * fL4
layout hints
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process search dialog widget messages.
TGCompositeFrame * fF1
TGLayoutHints * fL3
static TGSearchDialog * fgSearchDialog
global singleton
TGCompositeFrame * fF2
TGLayoutHints * fL6
TGGroupFrame * fG2
group frame
TGTextBuffer * fBSearch
search text buffer
virtual void TextEntered(const char *text)
emit signal when search text entered
TGButton * fCancelButton
cancel button
TGCompositeFrame * fF4
sub frames
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.
TGLayoutHints * fL5
virtual ~TGSearchDialog()
Clean up search dialog.
TGComboBox * fCombo
text entry combobox
virtual void CloseWindow()
Close the dialog.
TGLayoutHints * fL9
layout hints
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Definition: TGTextBuffer.h:19
void AddText(Int_t pos, const char *text)
Definition: TGTextBuffer.h:36
const char * GetString() const
Definition: TGTextBuffer.h:34
UInt_t GetTextLength() const
Definition: TGTextBuffer.h:32
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
virtual void SelectAll()
Selects all text (i.e.
TGTextBuffer * GetBuffer() const
Definition: TGTextEntry.h:112
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.
Defines transient windows that typically are used for dialogs windows.
Definition: TGFrame.h:498
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition: TGFrame.cxx:1937
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:72
ROOT GUI Window base class.
Definition: TGWindow.h:23
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:152
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
virtual void RequestFocus()
request focus
Definition: TGWindow.cxx:232
@ kEditDisable
disable edit of this window
Definition: TGWindow.h:50
UInt_t fEditDisabled
flags used for "guibuilding"
Definition: TGWindow.h:32
An array of TObjects.
Definition: TObjArray.h:37
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:149
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
void MakeZombie()
Definition: TObject.h:49
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
Basic string class.
Definition: TString.h:136
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2202
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition: TString.cxx:523
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
@ kTrailing
Definition: TString.h:267
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:916
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2222
const char * Data() const
Definition: TString.h:369
Bool_t IsNull() const
Definition: TString.h:407
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1663
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Definition: TSystem.cxx:683
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1546
TText * text
TLine * line
int main()