Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
51
54
55////////////////////////////////////////////////////////////////////////////////
56/// Create a search dialog box. Used to get from the user the required
57/// search instructions. Ret_code is kTRUE when sstruct has been set,
58/// kFALSE otherwise (like when dialog was canceled).
59
62 Int_t *ret_code, UInt_t options) :
63 TGTransientFrame(p, main, w, h, options)
64{
65 if (!p && !main) {
66 MakeZombie();
67 // coverity [uninit_ctor]
68 return;
69 }
71 fType = sstruct;
72
74
75 fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
76 fF2 = new TGCompositeFrame(this, 60, 20, kVerticalFrame);
79
80 fSearchButton = new TGTextButton(fF1, new TGHotString("&Search"), 1);
81 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
83
86
87 fL1 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0);
89 2, 5, 0, 2);
90 fL21 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
91
94
96
97 fLSearch = new TGLabel(fF3, new TGHotString("Search &for:"));
98
99 fCombo = new TGComboBox(fF3, "");
102 if (sstruct && sstruct->fBuffer)
103 fBSearch->AddText(0, sstruct->fBuffer);
104 else if (!gLastSearchString.IsNull())
106 else
108 fSearch->Associate(this);
111
112 fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
113 fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
114
117
118 fG2 = new TGGroupFrame(fF4, new TGString("Direction"), kHorizontalFrame);
119
120 fL3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 2, 2);
121 fL9 = new TGLayoutHints(kLHintsBottom | kLHintsLeft, 0, 0, 0, 0);
122 fL4 = new TGLayoutHints(kLHintsBottom | kLHintsLeft, 0, 0, 5, 0);
123 fL10 = new TGLayoutHints(kLHintsBottom | kLHintsRight, 0, 0, 5, 0);
124
125 fCaseCheck = new TGCheckButton(fF4, new TGHotString("&Case sensitive"), 1);
126 fCaseCheck->Associate(this);
128
129 fDirectionRadio[0] = new TGRadioButton(fG2, new TGHotString("Forward"), 1);
130 fDirectionRadio[1] = new TGRadioButton(fG2, new TGHotString("Backward"), 2);
131
134 fDirectionRadio[0]->Associate(this);
135 fDirectionRadio[1]->Associate(this);
136
139 else
141
142 if (fType->fDirection)
144 else
146
147 fF4->AddFrame(fG2, fL3);
148
149 fF2->AddFrame(fF3, fL1);
150 fF2->AddFrame(fF4, fL1);
151
152 AddFrame(fF2, fL2);
153
157
159
160 SetWindowName("Search");
161 SetIconName("Search");
162
166
167 if (fType->fClose) {
168 MapWindow();
170 fClient->WaitFor(this);
171 }
172}
173
174////////////////////////////////////////////////////////////////////////////////
175/// Clean up search dialog.
176
178{
179 if (IsZombie()) return;
180 delete fSearchButton;
181 delete fCancelButton;
182 delete fDirectionRadio[0]; delete fDirectionRadio[1];
183 delete fCaseCheck;
184 delete fCombo;
185 delete fLSearch;
186 delete fG2;
187 delete fF1; delete fF2; delete fF3; delete fF4;
188 delete fL1; delete fL2; delete fL3; delete fL4; delete fL5; delete fL6;
189 delete fL21;delete fL9; delete fL10;
190}
191
192////////////////////////////////////////////////////////////////////////////////
193/// Close the dialog. On close the dialog will be deleted and cannot be
194/// re-used.
195
197{
198 if (fType->fClose) {
199 DeleteWindow();
200 } else {
201 UnmapWindow();
202 }
203}
204
205////////////////////////////////////////////////////////////////////////////////
206/// emit signal when search text entered
207
209{
210 Emit("TextEntered(const char *)", text);
211}
212
213////////////////////////////////////////////////////////////////////////////////
214/// Process search dialog widget messages.
215
217{
218 const char *string;
219
220 switch (GET_MSG(msg)) {
221 case kC_COMMAND:
222 switch (GET_SUBMSG(msg)) {
223 case kCM_BUTTON:
224 switch (parm1) {
225 case 1:
226 string = fBSearch->GetString();
227 if (fType->fBuffer)
228 delete [] fType->fBuffer;
229 fType->fBuffer = StrDup(string);
230 gLastSearchString = string;
231 *fRetCode = kTRUE;
232 TextEntered(string);
234 if (fType->fClose) CloseWindow();
235 break;
236 case 2:
237 *fRetCode = kFALSE;
238 CloseWindow();
239 break;
240 }
241 break;
242
243 case kCM_CHECKBUTTON:
245 break;
246
247 case kCM_RADIOBUTTON:
248 switch (parm1) {
249 case 1:
252 break;
253 case 2:
256 break;
257 }
258 break;
259
260 default:
261 break;
262 }
263 break;
264
265 case kC_TEXTENTRY:
266 switch (GET_SUBMSG(msg)) {
267 case kTE_TEXTCHANGED:
268 string = fBSearch->GetString();
269 if (!string[0]) {
271 } else {
273 }
274 break;
275 case kTE_ENTER:
276 string = fBSearch->GetString();
277 if (fType->fBuffer)
278 delete [] fType->fBuffer;
279 fType->fBuffer = StrDup(string);
280 gLastSearchString = string;
281 *fRetCode = kTRUE;
282 TextEntered(string);
283 if (fType->fClose) CloseWindow();
284 break;
285 default:
286 break;
287 }
288 break;
289
290 default:
291 break;
292 }
293
294 return kTRUE;
295}
296
297////////////////////////////////////////////////////////////////////////////////
298/// Return global search dialog.
299
304
305
306////////////////////////////////////////////////////////////////////////////////
307/// Create the printer dialog box. Returns kTRUE in ret_code when
308/// printerName and printProg have been set and cancel was not pressed,
309/// kFALSE otherwise.
310
312 UInt_t w, UInt_t h, char **printerName,
313 char **printProg, Int_t *ret_code,
314 UInt_t options) :
315 TGTransientFrame(p, main, w, h, options)
316{
317 if (!p && !main) {
318 MakeZombie();
319 // coverity [uninit_ctor]
320 return;
321 }
326
328
329 fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
330 fF5 = new TGCompositeFrame(this, 60, 20, kHorizontalFrame);
331 fF2 = new TGCompositeFrame(fF5, 60, 20, kVerticalFrame);
334
335 fPrintButton = new TGTextButton(fF1, new TGHotString("&Print"), 1);
336 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
338
339 fPrintButton->Associate(this);
341
342 fL1 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2);
344 2, 5, 0, 2);
345 fL3 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 4, 4);
346 fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
347 fL6 = new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 0, 2, 0, 0);
348 fL7 = new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10);
349
350 fL21 = new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
351
354 AddFrame(fF1, fL3);
355
356
357 fLPrintCommand = new TGLabel(fF3, new TGHotString("Print command:"));
359 if ((printProg) && (*printProg))
364
367
368 fLPrinter = new TGLabel(fF4, new TGHotString("Printer:"));
369 if ((printerName) && (*printerName))
371 fBPrinter = fPrinterEntry->GetTextEntry()->GetBuffer();
372 fPrinterEntry->Resize(150, fPrinterEntry->GetTextEntry()->GetDefaultHeight());
375
376 fF2->AddFrame(fF3, fL1);
377 fF2->AddFrame(fF4, fL1);
378
379 const TGPicture *printerPicture = fClient->GetPicture("printer_s.xpm");
380 if (!printerPicture) {
381 Error("TGPrintDialog", "printer_s.xpm not found");
382 fPrinterIcon = 0;
383 } else {
384 fPrinterIcon = new TGIcon(fF5, printerPicture, 32, 32);
386 }
387 fF5->AddFrame(fF2, fL1);
388 AddFrame(fF5, fL1);
389
392
393 GetPrinters();
395
396 SetWindowName("Print");
397 SetIconName("Print");
398
402
404 MapWindow();
405 fClient->WaitFor(this);
406}
407
408////////////////////////////////////////////////////////////////////////////////
409/// Clean up print dialog.
410
412{
413 if (IsZombie()) return;
414 delete fPrinterIcon;
415 delete fPrintButton;
416 delete fCancelButton;
417 delete fPrinterEntry; // deletes also fBPrinter
418 delete fPrintCommandEntry; // deletes also fBPrintCommand
419 delete fLPrinter; delete fLPrintCommand;
420 delete fF1; delete fF2; delete fF3; delete fF4; delete fF5;
421 delete fL1; delete fL2; delete fL3; delete fL5; delete fL6; delete fL7;
422 delete fL21;
423}
424
425////////////////////////////////////////////////////////////////////////////////
426/// Close the dialog. On close the dialog will be deleted and cannot be
427/// re-used.
428
433
434////////////////////////////////////////////////////////////////////////////////
435/// Ask the system fo the list of available printers and populate the combo
436/// box. If there is a default printer, select it in the list.
437
439{
440 TObject *obj;
441 Int_t idx = 1, dflt =1;
442
443 if (gVirtualX->InheritsFrom("TGX11") || gVirtualX->InheritsFrom("TGCocoa")) {
444 char *lpstat = gSystem->Which(gSystem->Getenv("PATH"), "lpstat",
446 if (lpstat == 0) return;
448 TString printerlist = gSystem->GetFromPipe("lpstat -v");
449 TObjArray *tokens = printerlist.Tokenize("\n");
450 TIter iter(tokens);
451 while((obj = iter())) {
452 TString line = obj->GetName();
453 TObjArray *tk = line.Tokenize(" ");
454 TString pname = ((TObject*)tk->At(2))->GetName();
455 if (pname.EndsWith(":")) pname.Remove(pname.Last(':'));
456 //if (pname.Contains(":")) pname.Remove(pname.Last(':'));
457 if (defaultprinter.Contains(pname)) {
458 dflt = idx;
459 fPrinterEntry->GetTextEntry()->SetText(pname.Data(), kFALSE);
460 }
461 fPrinterEntry->AddEntry(pname.Data(), idx++);
462 }
463 delete [] lpstat;
464 }
465 else {
466 TString defaultprinter = gSystem->GetFromPipe("WMIC Path Win32_Printer where Default=TRUE Get DeviceID");
467 TString printerlist = gSystem->GetFromPipe("WMIC Path Win32_Printer Get DeviceID");
468 defaultprinter.Remove(0, defaultprinter.First('\n')); // remove "Default"
469 printerlist.Remove(0, printerlist.First('\n')); // remove "DeviceID"
470 printerlist.ReplaceAll("\r", "");
471 TObjArray *tokens = printerlist.Tokenize("\n");
472 TIter iter(tokens);
473 while((obj = iter())) {
474 TString pname = obj->GetName();
475 pname.Remove(TString::kTrailing, ' ');
476 if (defaultprinter.Contains(pname)) {
477 dflt = idx;
478 fPrinterEntry->GetTextEntry()->SetText(pname.Data(), kFALSE);
479 }
480 fPrinterEntry->AddEntry(pname.Data(), idx++);
481 }
482 }
485}
486
487////////////////////////////////////////////////////////////////////////////////
488/// Process print dialog widget messages.
489
491{
492 const char *string, *txt;
493
494 switch (GET_MSG(msg)) {
495 case kC_COMMAND:
496 switch (GET_SUBMSG(msg)) {
497 case kCM_BUTTON:
498 switch (parm1) {
499 case 1:
500 *fRetCode = kTRUE;
501 {
502 string = fBPrinter->GetString();
503 delete [] *fPrinter;
504 const size_t prSize = strlen(string) + 1;
505 *fPrinter = new char[prSize];
506 strlcpy(*fPrinter, string, prSize);
507 }
508 {
509 string = fBPrintCommand->GetString();
510 delete [] *fPrintCommand;
511 const size_t cmdSize = strlen(string) + 1;
512 *fPrintCommand = new char[cmdSize];
513 strlcpy(*fPrintCommand, string, cmdSize);
514 }
515
516 if (fBPrintCommand->GetTextLength() == 0) {
517 txt = "Please provide print command or use \"Cancel\"";
519 "Missing Print Parameters", txt, kMBIconExclamation,
520 kMBOk);
521 return kTRUE;
522 }
523 CloseWindow();
524 break;
525 case 2:
526 *fRetCode = kFALSE;
527 CloseWindow();
528 break;
529 }
530 break;
531 }
532 break;
533
534 default:
535 break;
536 }
537
538 return kTRUE;
539}
540
541////////////////////////////////////////////////////////////////////////////////
542/// Create a dialog to GoTo a specific line number. Returns -1 in
543/// ret_code in case no valid line number was given or in case
544/// cancel was pressed. If on input *ret_code is > 0 then this value
545/// will be used as default value.
546
549 UInt_t options) :
550 TGTransientFrame(p, main, w, h, options)
551{
552 if (!p && !main) {
553 MakeZombie();
554 // coverity [uninit_ctor]
555 return;
556 }
559
561
562 fF1 = new TGCompositeFrame(this, 60, 20, kVerticalFrame | kFixedWidth);
563 fF2 = new TGCompositeFrame(this, 60, 20, kHorizontalFrame);
564
565 fGotoButton = new TGTextButton(fF1, new TGHotString("&Goto"), 1);
566 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
568
569 fGotoButton->Associate(this);
571
572 fL1 = new TGLayoutHints(kLHintsCenterY | kLHintsExpandX, 2, 2, 3, 0);
573 fL21 = new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 5, 10, 0);
574
577 AddFrame(fF1, fL21);
578
579 fLGoTo = new TGLabel(fF2, new TGHotString("&Goto Line:"));
580
581 fBGoTo = new TGTextBuffer(50);
582 if (*fRetCode > 0) {
583 char curline[32];
584 snprintf(curline, 32, "%ld", *fRetCode);
586 } else
588 fGoTo = new TGTextEntry(fF2, fBGoTo);
589 fGoTo->Associate(this);
591 fGoTo->SelectAll();
592
593 fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
594 fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
595
598 AddFrame(fF2, fL1);
599
602
604
605 SetWindowName("Goto");
606 SetIconName("Print");
607
611
612 MapWindow();
614 fClient->WaitFor(this);
615}
616
617////////////////////////////////////////////////////////////////////////////////
618/// Clean up goto dialog
619
621{
622 if (IsZombie()) return;
623 delete fGotoButton;
624 delete fCancelButton;
625 delete fGoTo;
626 delete fLGoTo;
627 delete fF1; delete fF2;
628 delete fL1; delete fL5; delete fL6; delete fL21;
629}
630
631////////////////////////////////////////////////////////////////////////////////
632/// Close the dialog. On close the dialog will be deleted and cannot be
633/// re-used.
634
639
640////////////////////////////////////////////////////////////////////////////////
641/// Process goto dialog widget messages.
642
644{
645 const char *string;
646
647 switch (GET_MSG(msg)) {
648 case kC_COMMAND:
649 switch (GET_SUBMSG(msg)) {
650 case kCM_BUTTON:
651 switch (parm1) {
652 case 1:
653 string = fBGoTo->GetString();
654 *fRetCode = (Long_t) atof(string);
655 CloseWindow();
656 break;
657 case 2:
658 *fRetCode = -1;
659 CloseWindow();
660 break;
661 }
662 break;
663
664 default:
665 break;
666 }
667 break;
668
669 case kC_TEXTENTRY:
670 switch (GET_SUBMSG(msg)) {
671 case kTE_TEXTCHANGED:
672 string = fBGoTo->GetString();
673 if (!string[0])
675 else
677 break;
678 case kTE_ENTER:
679 string = fBGoTo->GetString();
680 *fRetCode = (Long_t) atof(string);
681 CloseWindow();
682 break;
683 default:
684 break;
685 }
686 break;
687
688 default:
689 break;
690 }
691
692 return kTRUE;
693}
694
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
int main()
Definition Prototype.cxx:12
#define h(i)
Definition RSha256.hxx:106
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
@ 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
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize UnmapWindow
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetMWMHints
Option_t Option_t TPoint TPoint const char text
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2563
@ kExecutePermission
Definition TSystem.h:53
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gVirtualX
Definition TVirtualX.h:337
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:1579
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:229
Selects different options.
Definition TGButton.h:264
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
void WaitFor(TGWindow *w)
Wait for window to be destroyed.
Definition TGClient.cxx:717
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:288
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
void Layout() override
layout combobox
virtual TGTextEntry * GetTextEntry() const
Definition TGComboBox.h:111
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
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...
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:318
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
TGCompositeFrame(const TGCompositeFrame &)=delete
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1014
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1035
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:192
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
void MapWindow() override
map window
Definition TGFrame.h:206
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
virtual UInt_t GetOptions() const
Definition TGFrame.h:199
TGLabel * fLGoTo
goto label
TGCompositeFrame * fF2
sub frames
TGTextBuffer * fBGoTo
goto line number text buffer
TGCompositeFrame * fF1
void CloseWindow() override
Close the dialog.
TGTextEntry * fGoTo
goto line number entry widget
TGLayoutHints * fL1
TGLayoutHints * fL21
layout hints
TGButton * fGotoButton
goto button
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process goto dialog widget messages.
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.
Long_t * fRetCode
return code
TGButton * fCancelButton
cancel button
TGLayoutHints * fL5
~TGGotoDialog() override
Clean up goto dialog.
TGLayoutHints * fL6
A composite frame with a border and a title.
Definition TGFrame.h:524
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:1793
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
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
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
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 void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
TGLayoutHints * fL2
TGCompositeFrame * fF3
TGButton * fCancelButton
cancel button
void CloseWindow() override
Close the dialog.
TGIcon * fPrinterIcon
printer icon
TGLayoutHints * fL6
layout hints
TGTextBuffer * fBPrinter
Int_t * fRetCode
return code
TGComboBox * fPrinterEntry
printer list combo widget
TGLayoutHints * fL3
TGLayoutHints * fL5
TGLayoutHints * fL21
layout hints
TGLayoutHints * fL7
~TGPrintDialog() override
Clean up print dialog.
TGCompositeFrame * fF1
TGCompositeFrame * fF5
sub frames
TGCompositeFrame * fF2
Selects different options.
Definition TGButton.h:321
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set radio button state.
TGLabel * fLSearch
label
TGLayoutHints * fL2
void CloseWindow() override
Close the dialog.
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
TGCompositeFrame * fF1
TGLayoutHints * fL3
static TGSearchDialog * fgSearchDialog
global singleton
TGCompositeFrame * fF2
TGSearchDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, TGSearchType *sstruct=nullptr, Int_t *ret_code=nullptr, UInt_t options=kVerticalFrame)
Create a search dialog box.
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() override
Clean up search dialog.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process search dialog widget messages.
TGLayoutHints * fL5
TGComboBox * fCombo
text entry combobox
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.
void AddText(Int_t pos, const char *text)
const char * GetString() const
UInt_t GetTextLength() const
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
TGTextBuffer * GetBuffer() const
virtual void SelectAll()
Selects all text (i.e.
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:500
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition TGFrame.cxx:1949
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:150
virtual void RequestFocus()
request focus
Definition TGWindow.cxx:230
@ kEditDisable
disable edit of this window
Definition TGWindow.h:57
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:334
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:457
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition TObject.h:159
void MakeZombie()
Definition TObject.h:53
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
Basic string class.
Definition TString.h:138
@ kTrailing
Definition TString.h:284
virtual const char * Getenv(const char *env)
Get environment variable.
Definition TSystem.cxx:1676
virtual TString GetFromPipe(const char *command, Int_t *ret=nullptr, Bool_t redirectStderr=kFALSE)
Execute command and return output in TString.
Definition TSystem.cxx:684
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition TSystem.cxx:1559
TLine * line