Logo ROOT  
Reference Guide
TGTextEditDialogs.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 10/7/2000
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2021, 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 #ifndef ROOT_TGTextEditDialogs
13 #define ROOT_TGTextEditDialogs
14 
15 
16 #include "TGFrame.h"
17 
18 
19 class TGSearchType {
20 public:
23  char *fBuffer;
26  ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
27 };
28 
29 class TGButton;
30 class TGRadioButton;
31 class TGCheckButton;
32 class TGTextEntry;
33 class TGTextBuffer;
34 class TGLabel;
35 class TGIcon;
36 class TGComboBox;
37 
39 
40 protected:
41  TGCompositeFrame *fF1, *fF2, *fF3, *fF4; ///< sub frames
42  TGLayoutHints *fL1, *fL2, *fL3, *fL4; ///< layout hints
43  TGLayoutHints *fL5, *fL6, *fL21, *fL9; ///< layout hints
44  TGLayoutHints *fL10; ///< layout hints
45  TGButton *fSearchButton; ///< search button
46  TGButton *fCancelButton; ///< cancel button
47  TGRadioButton *fDirectionRadio[2]; ///< search direction radio buttons
48  TGCheckButton *fCaseCheck; ///< case check box
49  TGGroupFrame *fG2; ///< group frame
50  TGTextEntry *fSearch; ///< search text entry widget
51  TGTextBuffer *fBSearch; ///< search text buffer
52  TGLabel *fLSearch; ///< label
53  TGSearchType *fType; ///< search type structure
54  Int_t *fRetCode; ///< return code
55  TGComboBox *fCombo; ///< text entry combobox
56 
57  static TGSearchDialog *fgSearchDialog; ///< global singleton
58 
59 public:
60  TGSearchDialog(const TGWindow *p = nullptr, const TGWindow *main = nullptr, UInt_t w = 1, UInt_t h = 1,
61  TGSearchType *sstruct = 0, Int_t *ret_code = 0,
62  UInt_t options = kVerticalFrame);
63  virtual ~TGSearchDialog();
64 
65  virtual void CloseWindow();
66  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
67  virtual void SetClose(Bool_t on) { fType->fClose = on; }
68  virtual Bool_t IsClose() const { return fType->fClose; }
69  virtual void TextEntered(const char *text); //*SIGNAL*
70  virtual TGSearchType *GetType() const { return fType; }
71 
72  static TGSearchDialog *&SearchDialog();
73 
74  ClassDef(TGSearchDialog,0) // Text search dialog used by TGTextEdit widget
75 };
76 
77 
79 
80 protected:
81  char **fPrinter; ///< printer to be used
82  char **fPrintCommand; ///< printer command to be used
83  TGCompositeFrame *fF1, *fF2, *fF3, *fF4, *fF5; ///< sub frames
84  TGLayoutHints *fL1, *fL2, *fL3, *fL5, *fL6; ///< layout hints
85  TGLayoutHints *fL7, *fL21; ///< layout hints
86  TGIcon *fPrinterIcon; ///< printer icon
87  TGButton *fPrintButton; ///< print button
88  TGButton *fCancelButton; ///< cancel button
89  TGComboBox *fPrinterEntry; ///< printer list combo widget
90  TGTextEntry *fPrintCommandEntry; ///< command text entry widget
91  TGTextBuffer *fBPrinter, *fBPrintCommand; ///< printer and command text buffers
92  TGLabel *fLPrinter, *fLPrintCommand; ///< printer and command labels
93  Int_t *fRetCode; ///< return code
94 
95 public:
96  TGPrintDialog(const TGWindow *p = nullptr, const TGWindow *main = nullptr, UInt_t w = 1, UInt_t h = 1,
97  char **printerName = nullptr, char **printProg = nullptr, Int_t *ret_code = nullptr,
98  UInt_t options = kVerticalFrame);
99  virtual ~TGPrintDialog();
100 
101  virtual void CloseWindow();
102  virtual void GetPrinters();
103  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
104 
105  ClassDef(TGPrintDialog,0) // Print dialog used by TGTextEdit widget
106 };
107 
108 
110 
111 protected:
112  TGCompositeFrame *fF1, *fF2; ///< sub frames
113  TGButton *fGotoButton; ///< goto button
114  TGButton *fCancelButton; ///< cancel button
115  TGLayoutHints *fL1, *fL5, *fL6, *fL21; ///< layout hints
116  TGTextEntry *fGoTo; ///< goto line number entry widget
117  TGTextBuffer *fBGoTo; ///< goto line number text buffer
118  TGLabel *fLGoTo; ///< goto label
119  Long_t *fRetCode; ///< return code
120 
121 public:
122  TGGotoDialog(const TGWindow *p = nullptr, const TGWindow *main = nullptr, UInt_t w = 1, UInt_t h = 1,
123  Long_t *ret_code = nullptr, UInt_t options = kVerticalFrame);
124  virtual ~TGGotoDialog();
125 
126  virtual void CloseWindow();
127  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
128 
129  ClassDef(TGGotoDialog,0) // Goto line dialog used by TGTextEdit widget
130 };
131 
132 #endif
TGPrintDialog::fPrinterIcon
TGIcon * fPrinterIcon
printer icon
Definition: TGTextEditDialogs.h:86
TGPrintDialog::fCancelButton
TGButton * fCancelButton
cancel button
Definition: TGTextEditDialogs.h:88
TGSearchDialog::IsClose
virtual Bool_t IsClose() const
Definition: TGTextEditDialogs.h:68
TGSearchType::TGSearchType
TGSearchType()
Definition: TGTextEditDialogs.h:25
TGTransientFrame
Defines transient windows that typically are used for dialogs windows.
Definition: TGFrame.h:498
TGPrintDialog::fPrinter
char ** fPrinter
printer to be used
Definition: TGTextEditDialogs.h:81
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGSearchDialog::fL4
TGLayoutHints * fL4
layout hints
Definition: TGTextEditDialogs.h:42
TGPrintDialog::fL21
TGLayoutHints * fL21
layout hints
Definition: TGTextEditDialogs.h:85
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGSearchDialog::fBSearch
TGTextBuffer * fBSearch
search text buffer
Definition: TGTextEditDialogs.h:51
TGPrintDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:84
TGGotoDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:115
TGGotoDialog::fGoTo
TGTextEntry * fGoTo
goto line number entry widget
Definition: TGTextEditDialogs.h:116
TGSearchDialog::fCancelButton
TGButton * fCancelButton
cancel button
Definition: TGTextEditDialogs.h:46
TGPrintDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:83
TGSearchDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:43
TGPrintDialog
Definition: TGTextEditDialogs.h:78
TGSearchType::~TGSearchType
~TGSearchType()
Definition: TGTextEditDialogs.h:26
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGSearchDialog::fRetCode
Int_t * fRetCode
return code
Definition: TGTextEditDialogs.h:54
TGPrintDialog::fPrintCommandEntry
TGTextEntry * fPrintCommandEntry
command text entry widget
Definition: TGTextEditDialogs.h:90
TGSearchDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:199
TGLabel
This class handles GUI labels.
Definition: TGLabel.h:24
TGSearchType::fBuffer
char * fBuffer
Definition: TGTextEditDialogs.h:23
TGGotoDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:115
TGSearchDialog::fL10
TGLayoutHints * fL10
layout hints
Definition: TGTextEditDialogs.h:44
TGSearchDialog::fF4
TGCompositeFrame * fF4
sub frames
Definition: TGTextEditDialogs.h:41
TGGotoDialog::TGGotoDialog
TGGotoDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, Long_t *ret_code=nullptr, UInt_t options=kVerticalFrame)
Create a dialog to GoTo a specific line number.
Definition: TGTextEditDialogs.cxx:550
TGPrintDialog::fPrintCommand
char ** fPrintCommand
printer command to be used
Definition: TGTextEditDialogs.h:82
TGGotoDialog::fLGoTo
TGLabel * fLGoTo
goto label
Definition: TGTextEditDialogs.h:118
TGSearchDialog::TextEntered
virtual void TextEntered(const char *text)
emit signal when search text entered
Definition: TGTextEditDialogs.cxx:211
TGSearchDialog::SearchDialog
static TGSearchDialog *& SearchDialog()
Return global search dialog.
Definition: TGTextEditDialogs.cxx:303
TGSearchDialog::TGSearchDialog
TGSearchDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, TGSearchType *sstruct=0, Int_t *ret_code=0, UInt_t options=kVerticalFrame)
Create a search dialog box.
Definition: TGTextEditDialogs.cxx:63
TGPrintDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
Definition: TGTextEditDialogs.cxx:493
TGGotoDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:638
TGPrintDialog::fPrintButton
TGButton * fPrintButton
print button
Definition: TGTextEditDialogs.h:87
TGSearchDialog::fG2
TGGroupFrame * fG2
group frame
Definition: TGTextEditDialogs.h:49
TGPrintDialog::fL6
TGLayoutHints * fL6
layout hints
Definition: TGTextEditDialogs.h:84
TGGotoDialog::fRetCode
Long_t * fRetCode
return code
Definition: TGTextEditDialogs.h:119
TGPrintDialog::fF5
TGCompositeFrame * fF5
sub frames
Definition: TGTextEditDialogs.h:83
text
TText * text
Definition: entrylist_figure1.C:10
bool
TGTextBuffer
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Definition: TGTextBuffer.h:19
TGGotoDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
Definition: TGTextEditDialogs.cxx:646
TGPrintDialog::fBPrintCommand
TGTextBuffer * fBPrintCommand
printer and command text buffers
Definition: TGTextEditDialogs.h:91
TGSearchDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:42
TGSearchDialog::fDirectionRadio
TGRadioButton * fDirectionRadio[2]
search direction radio buttons
Definition: TGTextEditDialogs.h:47
TGGotoDialog::~TGGotoDialog
virtual ~TGGotoDialog()
Clean up goto dialog.
Definition: TGTextEditDialogs.cxx:623
TGIcon
This class handles GUI icons.
Definition: TGIcon.h:22
TGCheckButton
Selects different options.
Definition: TGButton.h:264
TGSearchDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process search dialog widget messages.
Definition: TGTextEditDialogs.cxx:219
TGSearchDialog::~TGSearchDialog
virtual ~TGSearchDialog()
Clean up search dialog.
Definition: TGTextEditDialogs.cxx:180
TGSearchDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:42
TGPrintDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:432
TGRadioButton
Selects different options.
Definition: TGButton.h:322
h
#define h(i)
Definition: RSha256.hxx:106
TGPrintDialog::TGPrintDialog
TGPrintDialog(const TGWindow *p=nullptr, const TGWindow *main=nullptr, UInt_t w=1, UInt_t h=1, char **printerName=nullptr, char **printProg=nullptr, Int_t *ret_code=nullptr, UInt_t options=kVerticalFrame)
Create the printer dialog box.
Definition: TGTextEditDialogs.cxx:314
TGGotoDialog::fCancelButton
TGButton * fCancelButton
cancel button
Definition: TGTextEditDialogs.h:114
TGGotoDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:112
TGPrintDialog::fLPrintCommand
TGLabel * fLPrintCommand
printer and command labels
Definition: TGTextEditDialogs.h:92
TGTextEntry
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGPrintDialog::fPrinterEntry
TGComboBox * fPrinterEntry
printer list combo widget
Definition: TGTextEditDialogs.h:89
TGSearchDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:41
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGSearchType::fClose
Bool_t fClose
Definition: TGTextEditDialogs.h:24
TGGroupFrame
A composite frame with a border and a title.
Definition: TGFrame.h:522
TGSearchDialog::fSearch
TGTextEntry * fSearch
search text entry widget
Definition: TGTextEditDialogs.h:50
TGSearchDialog::GetType
virtual TGSearchType * GetType() const
Definition: TGTextEditDialogs.h:70
TGSearchDialog::fLSearch
TGLabel * fLSearch
label
Definition: TGTextEditDialogs.h:52
TGPrintDialog::~TGPrintDialog
virtual ~TGPrintDialog()
Clean up print dialog.
Definition: TGTextEditDialogs.cxx:414
TGSearchDialog::SetClose
virtual void SetClose(Bool_t on)
Definition: TGTextEditDialogs.h:67
TGGotoDialog::fGotoButton
TGButton * fGotoButton
goto button
Definition: TGTextEditDialogs.h:113
TGSearchDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:41
TGSearchDialog::fCaseCheck
TGCheckButton * fCaseCheck
case check box
Definition: TGTextEditDialogs.h:48
unsigned int
TGComboBox
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition: TGComboBox.h:47
TGGotoDialog
Definition: TGTextEditDialogs.h:109
TGPrintDialog::fF4
TGCompositeFrame * fF4
Definition: TGTextEditDialogs.h:83
TGPrintDialog::fRetCode
Int_t * fRetCode
return code
Definition: TGTextEditDialogs.h:93
TGGotoDialog::fBGoTo
TGTextBuffer * fBGoTo
goto line number text buffer
Definition: TGTextEditDialogs.h:117
TGPrintDialog::fL7
TGLayoutHints * fL7
Definition: TGTextEditDialogs.h:85
TGPrintDialog::GetPrinters
virtual void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
Definition: TGTextEditDialogs.cxx:441
TGSearchType::fCaseSensitive
Bool_t fCaseSensitive
Definition: TGTextEditDialogs.h:22
TGPrintDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:84
TGPrintDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:84
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGPrintDialog::fLPrinter
TGLabel * fLPrinter
Definition: TGTextEditDialogs.h:92
TGGotoDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:115
TGSearchDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:42
TGGotoDialog::fF2
TGCompositeFrame * fF2
sub frames
Definition: TGTextEditDialogs.h:112
TGSearchDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:41
TGPrintDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:83
TGSearchType::fDirection
Bool_t fDirection
Definition: TGTextEditDialogs.h:21
TGSearchDialog::fgSearchDialog
static TGSearchDialog * fgSearchDialog
global singleton
Definition: TGTextEditDialogs.h:57
TGButton
A button abstract base class.
Definition: TGButton.h:68
TGSearchDialog
Definition: TGTextEditDialogs.h:38
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGSearchDialog::fL9
TGLayoutHints * fL9
layout hints
Definition: TGTextEditDialogs.h:43
TGSearchDialog::fSearchButton
TGButton * fSearchButton
search button
Definition: TGTextEditDialogs.h:45
TGSearchDialog::fCombo
TGComboBox * fCombo
text entry combobox
Definition: TGTextEditDialogs.h:55
TGPrintDialog::fBPrinter
TGTextBuffer * fBPrinter
Definition: TGTextEditDialogs.h:91
TGPrintDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:84
TGSearchDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:43
TGSearchType
Definition: TGTextEditDialogs.h:19
main
int main(int argc, char *argv[])
Definition: cef_main.cxx:54
TGPrintDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:83
TGGotoDialog::fL21
TGLayoutHints * fL21
layout hints
Definition: TGTextEditDialogs.h:115
TGSearchDialog::fType
TGSearchType * fType
search type structure
Definition: TGTextEditDialogs.h:53
int
TGSearchDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:43