Logo ROOT   6.08/07
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 #ifndef ROOT_TGFrame
28 #include "TGFrame.h"
29 #endif
30 
31 
32 class TGSearchType {
33 public:
36  char *fBuffer;
38  TGSearchType() { fDirection = kTRUE; fCaseSensitive = kFALSE; fBuffer = 0; fClose = kTRUE; }
39  ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
40 };
41 
42 class TGButton;
43 class TGRadioButton;
44 class TGCheckButton;
45 class TGTextEntry;
46 class TGTextBuffer;
47 class TGLabel;
48 class TGIcon;
49 class TGComboBox;
50 
52 
53 protected:
54  TGCompositeFrame *fF1, *fF2, *fF3, *fF4; // sub frames
55  TGLayoutHints *fL1, *fL2, *fL3, *fL4; // layout hints
56  TGLayoutHints *fL5, *fL6, *fL21, *fL9; // layout hints
57  TGLayoutHints *fL10; // layout hints
58  TGButton *fSearchButton; // search button
59  TGButton *fCancelButton; // cancel button
60  TGRadioButton *fDirectionRadio[2]; // search direction radio buttons
61  TGCheckButton *fCaseCheck; // case check box
62  TGGroupFrame *fG2; // group frame
63  TGTextEntry *fSearch; // search text entry widget
64  TGTextBuffer *fBSearch; // search text buffer
65  TGLabel *fLSearch; // label
66  TGSearchType *fType; // search type structure
67  Int_t *fRetCode; // return code
68  TGComboBox *fCombo; // text entry combobox
69 
70  static TGSearchDialog *fgSearchDialog; // global singleton
71 
72 public:
73  TGSearchDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
74  TGSearchType *sstruct = 0, Int_t *ret_code = 0,
75  UInt_t options = kVerticalFrame);
76  virtual ~TGSearchDialog();
77 
78  virtual void CloseWindow();
79  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
80  virtual void SetClose(Bool_t on) { fType->fClose = on; }
81  virtual Bool_t IsClose() const { return fType->fClose; }
82  virtual void TextEntered(const char *text); //*SIGNAL*
83  virtual TGSearchType *GetType() const { return fType; }
84 
85  static TGSearchDialog *&SearchDialog();
86 
87  ClassDef(TGSearchDialog,0) // Text search dialog used by TGTextEdit widget
88 };
89 
90 
92 
93 protected:
94  char **fPrinter; // printer to be used
95  char **fPrintCommand; // printer command to be used
96  TGCompositeFrame *fF1, *fF2, *fF3, *fF4, *fF5; // sub frames
97  TGLayoutHints *fL1, *fL2, *fL3, *fL5, *fL6; // layout hints
98  TGLayoutHints *fL7, *fL21; // layout hints
99  TGIcon *fPrinterIcon; // printer icon
100  TGButton *fPrintButton; // print button
101  TGButton *fCancelButton; // cancel button
102  TGComboBox *fPrinterEntry; // printer list combo widget
103  TGTextEntry *fPrintCommandEntry; // command text entry widget
104  TGTextBuffer *fBPrinter, *fBPrintCommand; // printer and command text buffers
105  TGLabel *fLPrinter, *fLPrintCommand; // printer and command labels
106  Int_t *fRetCode; // return code
107 
108 public:
109  TGPrintDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
110  char **printerName = 0, char **printProg = 0, Int_t *ret_code = 0,
111  UInt_t options = kVerticalFrame);
112  virtual ~TGPrintDialog();
113 
114  virtual void CloseWindow();
115  virtual void GetPrinters();
116  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
117 
118  ClassDef(TGPrintDialog,0) // Print dialog used by TGTextEdit widget
119 };
120 
121 
123 
124 protected:
125  TGCompositeFrame *fF1, *fF2; // sub frames
126  TGButton *fGotoButton; // goto button
127  TGButton *fCancelButton; // cancel button
128  TGLayoutHints *fL1, *fL5, *fL6, *fL21; // layout hints
129  TGTextEntry *fGoTo; // goto line number entry widget
130  TGTextBuffer *fBGoTo; // goto line number text buffer
131  TGLabel *fLGoTo; // goto label
132  Long_t *fRetCode; // return code
133 
134 public:
135  TGGotoDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
136  Long_t *ret_code = 0, UInt_t options = kVerticalFrame);
137  virtual ~TGGotoDialog();
138 
139  virtual void CloseWindow();
140  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
141 
142  ClassDef(TGGotoDialog,0) // Goto line dialog used by TGTextEdit widget
143 };
144 
145 #endif
TGComboBox * fCombo
TGIcon * fPrinterIcon
virtual Bool_t IsClose() const
TGTextBuffer * fBPrinter
TGButton * fCancelButton
TH1 * h
Definition: legend2.C:5
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
TGTextBuffer * fBGoTo
TGLayoutHints * fL10
TGTextEntry * fPrintCommandEntry
TGCompositeFrame * fF4
TGSearchType * fType
#define ClassDef(name, id)
Definition: Rtypes.h:254
TGTextBuffer * fBSearch
Definition: TGIcon.h:34
TGButton * fCancelButton
TGButton * fPrintButton
virtual void SetClose(Bool_t on)
TGLayoutHints * fL7
static TGSearchDialog * fgSearchDialog
virtual TGSearchType * GetType() const
unsigned int UInt_t
Definition: RtypesCore.h:42
TGButton * fCancelButton
TGButton * fSearchButton
TGCheckButton * fCaseCheck
PyObject * fType
long Long_t
Definition: RtypesCore.h:50
TGLayoutHints * fL6
TGGroupFrame * fG2
TText * text
TGButton * fGotoButton
TGLayoutHints * fL9
TGLayoutHints * fL6
TGComboBox * fPrinterEntry
const Bool_t kTRUE
Definition: Rtypes.h:91
TGCompositeFrame * fF5
TGTextEntry * fSearch
int main(int argc, char **argv)
TGCompositeFrame * fF2
TGLayoutHints * fL4
TGTextEntry * fGoTo