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// //
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);
81
82 fSearchButton = new TGTextButton(fF1, new TGHotString("&Search"), 1);
83 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
85
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
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);
113
114 fL5 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
115 fL6 = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
116
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
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
159
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);
336
337 fPrintButton = new TGTextButton(fF1, new TGHotString("&Print"), 1);
338 fCancelButton = new TGTextButton(fF1, new TGHotString("&Cancel"), 2);
340
341 fPrintButton->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:"));
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
394
395 GetPrinters();
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 }
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);
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
600 AddFrame(fF2, fL1);
601
604
606
607 SetWindowName("Goto");
608 SetIconName("Print");
609
613
614 MapWindow();
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
@ 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:92
long Long_t
Definition RtypesCore.h:54
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassImp(name)
Definition Rtypes.h:364
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:187
@ kButtonDown
Definition TGButton.h:54
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
@ kMWMFuncAll
Definition TGFrame.h:57
@ kMWMFuncResize
Definition TGFrame.h:58
@ kMWMDecorMaximize
Definition TGFrame.h:77
@ kMWMDecorMenu
Definition TGFrame.h:75
@ kMWMDecorAll
Definition TGFrame.h:71
@ kMWMFuncMaximize
Definition TGFrame.h:61
@ kMWMInputModeless
Definition TGFrame.h:65
@ kLHintsRight
Definition TGLayout.h:33
@ kLHintsLeft
Definition TGLayout.h:31
@ kLHintsCenterY
Definition TGLayout.h:35
@ kLHintsBottom
Definition TGLayout.h:36
@ kLHintsTop
Definition TGLayout.h:34
@ kLHintsExpandX
Definition TGLayout.h:37
@ kMBOk
Definition TGMsgBox.h:40
@ kMBIconExclamation
Definition TGMsgBox.h:31
static TString gLastSearchString
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2510
@ 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:188
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
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:708
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:288
virtual TGTextEntry * GetTextEntry() const
Definition TGComboBox.h:131
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:106
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.
virtual void Layout()
layout combobox
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1028
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:352
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:350
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1007
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:214
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:215
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:261
virtual UInt_t GetOptions() const
Definition TGFrame.h:221
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
virtual void MapWindow()
map window
Definition TGFrame.h:228
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
virtual void CloseWindow()
Close the dialog.
TGCompositeFrame * fF2
TGTextBuffer * fBGoTo
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
TGCompositeFrame * fF1
TGTextEntry * fGoTo
TGLayoutHints * fL1
TGLayoutHints * fL21
TGButton * fGotoButton
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.
TGButton * fCancelButton
TGLayoutHints * fL5
TGLayoutHints * fL6
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition TGFrame.cxx:1762
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
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1749
TGClient * fClient
Definition TGObject.h:37
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
TGLayoutHints * fL1
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
TGLabel * fLPrintCommand
TGTextBuffer * fBPrintCommand
TGCompositeFrame * fF4
TGButton * fPrintButton
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
virtual void CloseWindow()
Close the dialog.
TGLayoutHints * fL6
TGTextBuffer * fBPrinter
TGComboBox * fPrinterEntry
TGLayoutHints * fL3
TGLayoutHints * fL5
TGLayoutHints * fL21
TGLayoutHints * fL7
TGCompositeFrame * fF1
TGCompositeFrame * fF5
TGCompositeFrame * fF2
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set radio button state.
TGLayoutHints * fL2
TGButton * fSearchButton
TGLayoutHints * fL21
static TGSearchDialog *& SearchDialog()
Return global search dialog.
TGTextEntry * fSearch
TGLayoutHints * fL10
TGCompositeFrame * fF3
TGSearchType * fType
TGLayoutHints * fL1
TGRadioButton * fDirectionRadio[2]
TGCheckButton * fCaseCheck
TGLayoutHints * fL4
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
TGCompositeFrame * fF2
TGLayoutHints * fL6
TGGroupFrame * fG2
TGTextBuffer * fBSearch
virtual void TextEntered(const char *text)
emit signal when search text entered
TGButton * fCancelButton
TGCompositeFrame * fF4
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
virtual void CloseWindow()
Close the dialog.
TGLayoutHints * fL9
void AddText(Int_t pos, const char *text)
const char * GetString() const
UInt_t GetTextLength() const
TGTextBuffer * GetBuffer() const
virtual void SelectAll()
Selects all text (i.e.
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.
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition TGFrame.cxx:1916
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:82
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition TGWindow.cxx:151
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
virtual void RequestFocus()
request focus
Definition TGWindow.cxx:231
@ kEditDisable
Definition TGWindow.h:58
UInt_t fEditDisabled
Definition TGWindow.h:40
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
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:2197
Ssiz_t First(char c) const
Find first occurrence of a character c.
Definition TString.cxx:519
const char * Data() const
Definition TString.h:369
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:912
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition TString.cxx:2217
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:1661
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Definition TSystem.cxx:681
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition TSystem.cxx:1544
TText * text
TLine * line
int main()