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-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 #ifndef ROOT_TGTextEditDialogs
13 #define ROOT_TGTextEditDialogs
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGTextEditDialogs //
19 // //
20 // This file defines several dialogs that are used by the TGTextEdit //
21 // widget via its associated context popup menu. //
22 // The following dialogs are available: TGSearchDialog, TGGotoDialog //
23 // and TGPrintDialog. //
24 // //
25 //////////////////////////////////////////////////////////////////////////
26 
27 #include "TGFrame.h"
28 
29 
30 class TGSearchType {
31 public:
34  char *fBuffer;
35  Bool_t fClose;
37  ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
38 };
39 
40 class TGButton;
44 class TGTextBuffer;
45 class TGLabel;
46 class TGIcon;
47 class TGComboBox;
48 
50 
51 protected:
52  TGCompositeFrame *fF1, *fF2, *fF3, *fF4; // sub frames
53  TGLayoutHints *fL1, *fL2, *fL3, *fL4; // layout hints
54  TGLayoutHints *fL5, *fL6, *fL21, *fL9; // layout hints
55  TGLayoutHints *fL10; // layout hints
56  TGButton *fSearchButton; // search button
57  TGButton *fCancelButton; // cancel button
58  TGRadioButton *fDirectionRadio[2]; // search direction radio buttons
59  TGCheckButton *fCaseCheck; // case check box
60  TGGroupFrame *fG2; // group frame
61  TGTextEntry *fSearch; // search text entry widget
62  TGTextBuffer *fBSearch; // search text buffer
63  TGLabel *fLSearch; // label
64  TGSearchType *fType; // search type structure
65  Int_t *fRetCode; // return code
66  TGComboBox *fCombo; // text entry combobox
67 
68  static TGSearchDialog *fgSearchDialog; // global singleton
69 
70 public:
71  TGSearchDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
72  TGSearchType *sstruct = 0, Int_t *ret_code = 0,
73  UInt_t options = kVerticalFrame);
74  virtual ~TGSearchDialog();
75 
76  virtual void CloseWindow();
77  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
78  virtual void SetClose(Bool_t on) { fType->fClose = on; }
79  virtual Bool_t IsClose() const { return fType->fClose; }
80  virtual void TextEntered(const char *text); //*SIGNAL*
81  virtual TGSearchType *GetType() const { return fType; }
82 
83  static TGSearchDialog *&SearchDialog();
84 
85  ClassDef(TGSearchDialog,0) // Text search dialog used by TGTextEdit widget
86 };
87 
88 
90 
91 protected:
92  char **fPrinter; // printer to be used
93  char **fPrintCommand; // printer command to be used
94  TGCompositeFrame *fF1, *fF2, *fF3, *fF4, *fF5; // sub frames
95  TGLayoutHints *fL1, *fL2, *fL3, *fL5, *fL6; // layout hints
96  TGLayoutHints *fL7, *fL21; // layout hints
97  TGIcon *fPrinterIcon; // printer icon
98  TGButton *fPrintButton; // print button
99  TGButton *fCancelButton; // cancel button
100  TGComboBox *fPrinterEntry; // printer list combo widget
101  TGTextEntry *fPrintCommandEntry; // command text entry widget
102  TGTextBuffer *fBPrinter, *fBPrintCommand; // printer and command text buffers
103  TGLabel *fLPrinter, *fLPrintCommand; // printer and command labels
104  Int_t *fRetCode; // return code
105 
106 public:
107  TGPrintDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
108  char **printerName = 0, char **printProg = 0, Int_t *ret_code = 0,
109  UInt_t options = kVerticalFrame);
110  virtual ~TGPrintDialog();
111 
112  virtual void CloseWindow();
113  virtual void GetPrinters();
114  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
115 
116  ClassDef(TGPrintDialog,0) // Print dialog used by TGTextEdit widget
117 };
118 
119 
121 
122 protected:
123  TGCompositeFrame *fF1, *fF2; // sub frames
124  TGButton *fGotoButton; // goto button
125  TGButton *fCancelButton; // cancel button
126  TGLayoutHints *fL1, *fL5, *fL6, *fL21; // layout hints
127  TGTextEntry *fGoTo; // goto line number entry widget
128  TGTextBuffer *fBGoTo; // goto line number text buffer
129  TGLabel *fLGoTo; // goto label
130  Long_t *fRetCode; // return code
131 
132 public:
133  TGGotoDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
134  Long_t *ret_code = 0, UInt_t options = kVerticalFrame);
135  virtual ~TGGotoDialog();
136 
137  virtual void CloseWindow();
138  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
139 
140  ClassDef(TGGotoDialog,0) // Goto line dialog used by TGTextEdit widget
141 };
142 
143 #endif
TGPrintDialog::fPrinterIcon
TGIcon * fPrinterIcon
Definition: TGTextEditDialogs.h:97
TGPrintDialog::fCancelButton
TGButton * fCancelButton
Definition: TGTextEditDialogs.h:99
TGSearchDialog::IsClose
virtual Bool_t IsClose() const
Definition: TGTextEditDialogs.h:79
TGSearchType::TGSearchType
TGSearchType()
Definition: TGTextEditDialogs.h:42
TGTransientFrame
Definition: TGFrame.h:553
TGPrintDialog::fPrinter
char ** fPrinter
Definition: TGTextEditDialogs.h:92
TGWindow
Definition: TGWindow.h:31
TGSearchDialog::fL4
TGLayoutHints * fL4
Definition: TGTextEditDialogs.h:53
TGPrintDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:96
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGSearchDialog::fBSearch
TGTextBuffer * fBSearch
Definition: TGTextEditDialogs.h:62
TGPrintDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:95
TGGotoDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:126
TGGotoDialog::fGoTo
TGTextEntry * fGoTo
Definition: TGTextEditDialogs.h:127
TGSearchDialog::fCancelButton
TGButton * fCancelButton
Definition: TGTextEditDialogs.h:57
TGPrintDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:94
TGSearchDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:54
TGPrintDialog
Definition: TGTextEditDialogs.h:89
TGSearchType::~TGSearchType
~TGSearchType()
Definition: TGTextEditDialogs.h:43
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGSearchDialog::fRetCode
Int_t * fRetCode
Definition: TGTextEditDialogs.h:65
TGPrintDialog::fPrintCommandEntry
TGTextEntry * fPrintCommandEntry
Definition: TGTextEditDialogs.h:101
TGSearchDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:198
TGLabel
Definition: TGLabel.h:32
TGSearchType::fBuffer
char * fBuffer
Definition: TGTextEditDialogs.h:40
TGGotoDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:126
TGSearchDialog::fL10
TGLayoutHints * fL10
Definition: TGTextEditDialogs.h:55
TGSearchDialog::fF4
TGCompositeFrame * fF4
Definition: TGTextEditDialogs.h:52
TGPrintDialog::fPrintCommand
char ** fPrintCommand
Definition: TGTextEditDialogs.h:93
TGGotoDialog::fLGoTo
TGLabel * fLGoTo
Definition: TGTextEditDialogs.h:129
TGSearchDialog::TextEntered
virtual void TextEntered(const char *text)
emit signal when search text entered
Definition: TGTextEditDialogs.cxx:210
TGSearchDialog::SearchDialog
static TGSearchDialog *& SearchDialog()
Return global search dialog.
Definition: TGTextEditDialogs.cxx:302
TGPrintDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process print dialog widget messages.
Definition: TGTextEditDialogs.cxx:492
TGGotoDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:637
TGPrintDialog::fPrintButton
TGButton * fPrintButton
Definition: TGTextEditDialogs.h:98
TGGotoDialog::TGGotoDialog
TGGotoDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, Long_t *ret_code=0, UInt_t options=kVerticalFrame)
Create a dialog to GoTo a specific line number.
Definition: TGTextEditDialogs.cxx:549
TGSearchDialog::fG2
TGGroupFrame * fG2
Definition: TGTextEditDialogs.h:60
TGPrintDialog::fL6
TGLayoutHints * fL6
Definition: TGTextEditDialogs.h:95
TGGotoDialog::fRetCode
Long_t * fRetCode
Definition: TGTextEditDialogs.h:130
TGPrintDialog::fF5
TGCompositeFrame * fF5
Definition: TGTextEditDialogs.h:94
text
TText * text
Definition: entrylist_figure1.C:10
bool
TGTextBuffer
Definition: TGTextBuffer.h:30
TGGotoDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process goto dialog widget messages.
Definition: TGTextEditDialogs.cxx:645
TGPrintDialog::fBPrintCommand
TGTextBuffer * fBPrintCommand
Definition: TGTextEditDialogs.h:102
TGSearchDialog::fL2
TGLayoutHints * fL2
Definition: TGTextEditDialogs.h:53
TGSearchDialog::fDirectionRadio
TGRadioButton * fDirectionRadio[2]
Definition: TGTextEditDialogs.h:58
TGGotoDialog::~TGGotoDialog
virtual ~TGGotoDialog()
Clean up goto dialog.
Definition: TGTextEditDialogs.cxx:622
TGIcon
Definition: TGIcon.h:30
TGCheckButton
Definition: TGButton.h:264
TGSearchDialog::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process search dialog widget messages.
Definition: TGTextEditDialogs.cxx:218
TGSearchDialog::~TGSearchDialog
virtual ~TGSearchDialog()
Clean up search dialog.
Definition: TGTextEditDialogs.cxx:179
TGSearchDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:53
TGPrintDialog::TGPrintDialog
TGPrintDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, char **printerName=0, char **printProg=0, Int_t *ret_code=0, UInt_t options=kVerticalFrame)
Create the printer dialog box.
Definition: TGTextEditDialogs.cxx:313
TGPrintDialog::CloseWindow
virtual void CloseWindow()
Close the dialog.
Definition: TGTextEditDialogs.cxx:431
TGRadioButton
Definition: TGButton.h:322
h
#define h(i)
Definition: RSha256.hxx:124
TGGotoDialog::fCancelButton
TGButton * fCancelButton
Definition: TGTextEditDialogs.h:125
TGGotoDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:123
TGPrintDialog::fLPrintCommand
TGLabel * fLPrintCommand
Definition: TGTextEditDialogs.h:103
TGTextEntry
Definition: TGTextEntry.h:39
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGPrintDialog::fPrinterEntry
TGComboBox * fPrinterEntry
Definition: TGTextEditDialogs.h:100
TGSearchDialog::fF3
TGCompositeFrame * fF3
Definition: TGTextEditDialogs.h:52
TGFrame.h
Long_t
long Long_t
Definition: RtypesCore.h:54
main
int main(int argc, char **argv)
Definition: histspeedtest.cxx:751
TGLayoutHints
Definition: TGLayout.h:57
TGSearchType::fClose
Bool_t fClose
Definition: TGTextEditDialogs.h:41
TGGroupFrame
Definition: TGFrame.h:587
TGSearchDialog::fSearch
TGTextEntry * fSearch
Definition: TGTextEditDialogs.h:61
TGSearchDialog::GetType
virtual TGSearchType * GetType() const
Definition: TGTextEditDialogs.h:81
TGSearchDialog::fLSearch
TGLabel * fLSearch
Definition: TGTextEditDialogs.h:63
TGPrintDialog::~TGPrintDialog
virtual ~TGPrintDialog()
Clean up print dialog.
Definition: TGTextEditDialogs.cxx:413
TGSearchDialog::SetClose
virtual void SetClose(Bool_t on)
Definition: TGTextEditDialogs.h:78
TGGotoDialog::fGotoButton
TGButton * fGotoButton
Definition: TGTextEditDialogs.h:124
TGSearchDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:52
TGSearchDialog::fCaseCheck
TGCheckButton * fCaseCheck
Definition: TGTextEditDialogs.h:59
unsigned int
TGComboBox
Definition: TGComboBox.h:67
TGGotoDialog
Definition: TGTextEditDialogs.h:120
TGPrintDialog::fF4
TGCompositeFrame * fF4
Definition: TGTextEditDialogs.h:94
TGPrintDialog::fRetCode
Int_t * fRetCode
Definition: TGTextEditDialogs.h:104
TGGotoDialog::fBGoTo
TGTextBuffer * fBGoTo
Definition: TGTextEditDialogs.h:128
TGPrintDialog::fL7
TGLayoutHints * fL7
Definition: TGTextEditDialogs.h:96
TGPrintDialog::GetPrinters
virtual void GetPrinters()
Ask the system fo the list of available printers and populate the combo box.
Definition: TGTextEditDialogs.cxx:440
TGSearchType::fCaseSensitive
Bool_t fCaseSensitive
Definition: TGTextEditDialogs.h:39
TGPrintDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:95
TGPrintDialog::fL1
TGLayoutHints * fL1
Definition: TGTextEditDialogs.h:95
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGPrintDialog::fLPrinter
TGLabel * fLPrinter
Definition: TGTextEditDialogs.h:103
TGGotoDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:126
TGSearchDialog::fL3
TGLayoutHints * fL3
Definition: TGTextEditDialogs.h:53
TGGotoDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:123
TGSearchDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:52
TGPrintDialog::fF1
TGCompositeFrame * fF1
Definition: TGTextEditDialogs.h:94
TGSearchType::fDirection
Bool_t fDirection
Definition: TGTextEditDialogs.h:38
TGSearchDialog::TGSearchDialog
TGSearchDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1, TGSearchType *sstruct=0, Int_t *ret_code=0, UInt_t options=kVerticalFrame)
Create a search dialog box.
Definition: TGTextEditDialogs.cxx:62
TGSearchDialog::fgSearchDialog
static TGSearchDialog * fgSearchDialog
Definition: TGTextEditDialogs.h:68
TGButton
Definition: TGButton.h:68
TGSearchDialog
Definition: TGTextEditDialogs.h:49
TGCompositeFrame
Definition: TGFrame.h:324
TGSearchDialog::fL9
TGLayoutHints * fL9
Definition: TGTextEditDialogs.h:54
TGSearchDialog::fSearchButton
TGButton * fSearchButton
Definition: TGTextEditDialogs.h:56
TGSearchDialog::fCombo
TGComboBox * fCombo
Definition: TGTextEditDialogs.h:66
TGPrintDialog::fBPrinter
TGTextBuffer * fBPrinter
Definition: TGTextEditDialogs.h:102
TGPrintDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:95
TGSearchDialog::fL5
TGLayoutHints * fL5
Definition: TGTextEditDialogs.h:54
TGSearchType
Definition: TGTextEditDialogs.h:30
TGPrintDialog::fF2
TGCompositeFrame * fF2
Definition: TGTextEditDialogs.h:94
TGGotoDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:126
TGSearchDialog::fType
TGSearchType * fType
Definition: TGTextEditDialogs.h:64
int
TGSearchDialog::fL21
TGLayoutHints * fL21
Definition: TGTextEditDialogs.h:54