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
31public:
34 char *fBuffer;
37 ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
38};
39
40class TGButton;
41class TGRadioButton;
42class TGCheckButton;
43class TGTextEntry;
44class TGTextBuffer;
45class TGLabel;
46class TGIcon;
47class TGComboBox;
48
50
51protected:
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
70public:
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
84
85 ClassDef(TGSearchDialog,0) // Text search dialog used by TGTextEdit widget
86};
87
88
90
91protected:
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
106public:
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
122protected:
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
132public:
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
@ kVerticalFrame
Definition: GuiTypes.h:381
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassDef(name, id)
Definition: Rtypes.h:322
virtual void CloseWindow()
Close the dialog.
TGCompositeFrame * fF2
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.
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
virtual ~TGGotoDialog()
Clean up goto dialog.
TGButton * fCancelButton
TGLayoutHints * fL5
TGLayoutHints * fL6
Definition: TGIcon.h:30
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
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.
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
TGIcon * fPrinterIcon
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
TGLayoutHints * fL2
virtual TGSearchType * GetType() const
TGButton * fSearchButton
TGLayoutHints * fL21
static TGSearchDialog *& SearchDialog()
Return global search dialog.
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.
TGTextEntry * fSearch
TGLayoutHints * fL10
TGCompositeFrame * fF3
virtual Bool_t IsClose() const
virtual void SetClose(Bool_t on)
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
TGLayoutHints * fL5
virtual ~TGSearchDialog()
Clean up search dialog.
TGComboBox * fCombo
virtual void CloseWindow()
Close the dialog.
TGLayoutHints * fL9
TText * text
int main(int argc, char **argv)