Logo ROOT   6.10/09
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;
36  TGSearchType() { fDirection = kTRUE; fCaseSensitive = kFALSE; fBuffer = 0; fClose = kTRUE; }
37  ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
38 };
39 
40 class TGButton;
41 class TGRadioButton;
42 class TGCheckButton;
43 class TGTextEntry;
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
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
TGTextBuffer * fBGoTo
TGLayoutHints * fL10
TGTextEntry * fPrintCommandEntry
TGCompositeFrame * fF4
TGSearchType * fType
#define ClassDef(name, id)
Definition: Rtypes.h:297
TGTextBuffer * fBSearch
Definition: TGIcon.h:30
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
const Bool_t kFALSE
Definition: RtypesCore.h:92
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: RtypesCore.h:91
TGCompositeFrame * fF5
TGTextEntry * fSearch
int main(int argc, char **argv)
TGCompositeFrame * fF2
TGLayoutHints * fL4
TGTextEntry * fGoTo