ROOT logo
// @(#)root/gui:$Id: TGTextEditDialogs.h 25499 2008-09-22 19:54:46Z bellenot $
// Author: Fons Rademakers   10/7/2000

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGTextEditDialogs
#define ROOT_TGTextEditDialogs


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGTextEditDialogs                                                    //
//                                                                      //
// This file defines several dialogs that are used by the TGTextEdit    //
// widget via its associated context popup menu.                        //
// The following dialogs are available: TGSearchDialog, TGGotoDialog    //
// and TGPrintDialog.                                                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif


class TGSearchType {
public:
   Bool_t  fDirection;
   Bool_t  fCaseSensitive;
   char   *fBuffer;
   Bool_t  fClose;
   TGSearchType() { fDirection = kTRUE; fCaseSensitive = kFALSE; fBuffer = 0; fClose = kTRUE; }
   ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
};

class TGButton;
class TGRadioButton;
class TGCheckButton;
class TGTextEntry;
class TGTextBuffer;
class TGLabel;
class TGIcon;
class TGComboBox;

class TGSearchDialog : public TGTransientFrame {

protected:
   TGCompositeFrame   *fF1, *fF2, *fF3, *fF4;  // sub frames
   TGLayoutHints      *fL1, *fL2, *fL3, *fL4;  // layout hints
   TGLayoutHints      *fL5, *fL6, *fL21, *fL9; // layout hints
   TGLayoutHints      *fL10;                   // layout hints
   TGButton           *fSearchButton;          // search button
   TGButton           *fCancelButton;          // cancel button
   TGRadioButton      *fDirectionRadio[2];     // search direction radio buttons
   TGCheckButton      *fCaseCheck;             // case check box
   TGGroupFrame       *fG2;                    // group frame
   TGTextEntry        *fSearch;                // search text entry widget
   TGTextBuffer       *fBSearch;               // search text buffer
   TGLabel            *fLSearch;               // label
   TGSearchType       *fType;                  // search type structure
   Int_t              *fRetCode;               // return code
   TGComboBox         *fCombo;                 // text entry combobox

   static TGSearchDialog *fgSearchDialog;      // global singleton

public:
   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);
   virtual ~TGSearchDialog();

   virtual void   CloseWindow();
   virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
   virtual void   SetClose(Bool_t on) { fType->fClose = on; }
   virtual Bool_t IsClose() const {  return fType->fClose; }
   virtual void   TextEntered(const char *text); //*SIGNAL*
   virtual TGSearchType *GetType() const { return fType; }

   static TGSearchDialog *&SearchDialog();

   ClassDef(TGSearchDialog,0)  // Text search dialog used by TGTextEdit widget
};


class TGPrintDialog : public TGTransientFrame {

protected:
   char             **fPrinter;                    // printer to be used
   char             **fPrintCommand;               // printer command to be used
   TGCompositeFrame  *fF1, *fF2, *fF3, *fF4, *fF5; // sub frames
   TGLayoutHints     *fL1, *fL2, *fL3, *fL5, *fL6; // layout hints
   TGLayoutHints     *fL7, *fL21;                  // layout hints
   TGIcon            *fPrinterIcon;                // printer icon
   TGButton          *fPrintButton;                // print button
   TGButton          *fCancelButton;               // cancel button
   TGTextEntry       *fPrinterEntry;               // printer text entry widget
   TGTextEntry       *fPrintCommandEntry;          // command text entry widget
   TGTextBuffer      *fBPrinter, *fBPrintCommand;  // printer and command text buffers
   TGLabel           *fLPrinter, *fLPrintCommand;  // printer and command labels
   Int_t             *fRetCode;                    // return code

public:
   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);
   virtual ~TGPrintDialog();

   virtual void   CloseWindow();
   virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);

   ClassDef(TGPrintDialog,0)  // Print dialog used by TGTextEdit widget
};


class TGGotoDialog : public TGTransientFrame {

protected:
   TGCompositeFrame *fF1, *fF2;                // sub frames
   TGButton         *fGotoButton;              // goto button
   TGButton         *fCancelButton;            // cancel button
   TGLayoutHints    *fL1, *fL5, *fL6, *fL21;   // layout hints
   TGTextEntry      *fGoTo;                    // goto line number entry widget
   TGTextBuffer     *fBGoTo;                   // goto line number text buffer
   TGLabel          *fLGoTo;                   // goto label
   Long_t           *fRetCode;                 // return code

public:
   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);
   virtual ~TGGotoDialog();

   virtual void   CloseWindow();
   virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);

   ClassDef(TGGotoDialog,0)  // Goto line dialog used by TGTextEdit widget
};

#endif
 TGTextEditDialogs.h:1
 TGTextEditDialogs.h:2
 TGTextEditDialogs.h:3
 TGTextEditDialogs.h:4
 TGTextEditDialogs.h:5
 TGTextEditDialogs.h:6
 TGTextEditDialogs.h:7
 TGTextEditDialogs.h:8
 TGTextEditDialogs.h:9
 TGTextEditDialogs.h:10
 TGTextEditDialogs.h:11
 TGTextEditDialogs.h:12
 TGTextEditDialogs.h:13
 TGTextEditDialogs.h:14
 TGTextEditDialogs.h:15
 TGTextEditDialogs.h:16
 TGTextEditDialogs.h:17
 TGTextEditDialogs.h:18
 TGTextEditDialogs.h:19
 TGTextEditDialogs.h:20
 TGTextEditDialogs.h:21
 TGTextEditDialogs.h:22
 TGTextEditDialogs.h:23
 TGTextEditDialogs.h:24
 TGTextEditDialogs.h:25
 TGTextEditDialogs.h:26
 TGTextEditDialogs.h:27
 TGTextEditDialogs.h:28
 TGTextEditDialogs.h:29
 TGTextEditDialogs.h:30
 TGTextEditDialogs.h:31
 TGTextEditDialogs.h:32
 TGTextEditDialogs.h:33
 TGTextEditDialogs.h:34
 TGTextEditDialogs.h:35
 TGTextEditDialogs.h:36
 TGTextEditDialogs.h:37
 TGTextEditDialogs.h:38
 TGTextEditDialogs.h:39
 TGTextEditDialogs.h:40
 TGTextEditDialogs.h:41
 TGTextEditDialogs.h:42
 TGTextEditDialogs.h:43
 TGTextEditDialogs.h:44
 TGTextEditDialogs.h:45
 TGTextEditDialogs.h:46
 TGTextEditDialogs.h:47
 TGTextEditDialogs.h:48
 TGTextEditDialogs.h:49
 TGTextEditDialogs.h:50
 TGTextEditDialogs.h:51
 TGTextEditDialogs.h:52
 TGTextEditDialogs.h:53
 TGTextEditDialogs.h:54
 TGTextEditDialogs.h:55
 TGTextEditDialogs.h:56
 TGTextEditDialogs.h:57
 TGTextEditDialogs.h:58
 TGTextEditDialogs.h:59
 TGTextEditDialogs.h:60
 TGTextEditDialogs.h:61
 TGTextEditDialogs.h:62
 TGTextEditDialogs.h:63
 TGTextEditDialogs.h:64
 TGTextEditDialogs.h:65
 TGTextEditDialogs.h:66
 TGTextEditDialogs.h:67
 TGTextEditDialogs.h:68
 TGTextEditDialogs.h:69
 TGTextEditDialogs.h:70
 TGTextEditDialogs.h:71
 TGTextEditDialogs.h:72
 TGTextEditDialogs.h:73
 TGTextEditDialogs.h:74
 TGTextEditDialogs.h:75
 TGTextEditDialogs.h:76
 TGTextEditDialogs.h:77
 TGTextEditDialogs.h:78
 TGTextEditDialogs.h:79
 TGTextEditDialogs.h:80
 TGTextEditDialogs.h:81
 TGTextEditDialogs.h:82
 TGTextEditDialogs.h:83
 TGTextEditDialogs.h:84
 TGTextEditDialogs.h:85
 TGTextEditDialogs.h:86
 TGTextEditDialogs.h:87
 TGTextEditDialogs.h:88
 TGTextEditDialogs.h:89
 TGTextEditDialogs.h:90
 TGTextEditDialogs.h:91
 TGTextEditDialogs.h:92
 TGTextEditDialogs.h:93
 TGTextEditDialogs.h:94
 TGTextEditDialogs.h:95
 TGTextEditDialogs.h:96
 TGTextEditDialogs.h:97
 TGTextEditDialogs.h:98
 TGTextEditDialogs.h:99
 TGTextEditDialogs.h:100
 TGTextEditDialogs.h:101
 TGTextEditDialogs.h:102
 TGTextEditDialogs.h:103
 TGTextEditDialogs.h:104
 TGTextEditDialogs.h:105
 TGTextEditDialogs.h:106
 TGTextEditDialogs.h:107
 TGTextEditDialogs.h:108
 TGTextEditDialogs.h:109
 TGTextEditDialogs.h:110
 TGTextEditDialogs.h:111
 TGTextEditDialogs.h:112
 TGTextEditDialogs.h:113
 TGTextEditDialogs.h:114
 TGTextEditDialogs.h:115
 TGTextEditDialogs.h:116
 TGTextEditDialogs.h:117
 TGTextEditDialogs.h:118
 TGTextEditDialogs.h:119
 TGTextEditDialogs.h:120
 TGTextEditDialogs.h:121
 TGTextEditDialogs.h:122
 TGTextEditDialogs.h:123
 TGTextEditDialogs.h:124
 TGTextEditDialogs.h:125
 TGTextEditDialogs.h:126
 TGTextEditDialogs.h:127
 TGTextEditDialogs.h:128
 TGTextEditDialogs.h:129
 TGTextEditDialogs.h:130
 TGTextEditDialogs.h:131
 TGTextEditDialogs.h:132
 TGTextEditDialogs.h:133
 TGTextEditDialogs.h:134
 TGTextEditDialogs.h:135
 TGTextEditDialogs.h:136
 TGTextEditDialogs.h:137
 TGTextEditDialogs.h:138
 TGTextEditDialogs.h:139
 TGTextEditDialogs.h:140
 TGTextEditDialogs.h:141
 TGTextEditDialogs.h:142
 TGTextEditDialogs.h:143
 TGTextEditDialogs.h:144