TGTextEditDialogs.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TGTextEditDialogs.h 25499 2008-09-22 19:54:46Z bellenot $
00002 // Author: Fons Rademakers   10/7/2000
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGTextEditDialogs
00013 #define ROOT_TGTextEditDialogs
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGTextEditDialogs                                                    //
00019 //                                                                      //
00020 // This file defines several dialogs that are used by the TGTextEdit    //
00021 // widget via its associated context popup menu.                        //
00022 // The following dialogs are available: TGSearchDialog, TGGotoDialog    //
00023 // and TGPrintDialog.                                                   //
00024 //                                                                      //
00025 //////////////////////////////////////////////////////////////////////////
00026 
00027 #ifndef ROOT_TGFrame
00028 #include "TGFrame.h"
00029 #endif
00030 
00031 
00032 class TGSearchType {
00033 public:
00034    Bool_t  fDirection;
00035    Bool_t  fCaseSensitive;
00036    char   *fBuffer;
00037    Bool_t  fClose;
00038    TGSearchType() { fDirection = kTRUE; fCaseSensitive = kFALSE; fBuffer = 0; fClose = kTRUE; }
00039    ~TGSearchType() { if (fBuffer) delete [] fBuffer;}
00040 };
00041 
00042 class TGButton;
00043 class TGRadioButton;
00044 class TGCheckButton;
00045 class TGTextEntry;
00046 class TGTextBuffer;
00047 class TGLabel;
00048 class TGIcon;
00049 class TGComboBox;
00050 
00051 class TGSearchDialog : public TGTransientFrame {
00052 
00053 protected:
00054    TGCompositeFrame   *fF1, *fF2, *fF3, *fF4;  // sub frames
00055    TGLayoutHints      *fL1, *fL2, *fL3, *fL4;  // layout hints
00056    TGLayoutHints      *fL5, *fL6, *fL21, *fL9; // layout hints
00057    TGLayoutHints      *fL10;                   // layout hints
00058    TGButton           *fSearchButton;          // search button
00059    TGButton           *fCancelButton;          // cancel button
00060    TGRadioButton      *fDirectionRadio[2];     // search direction radio buttons
00061    TGCheckButton      *fCaseCheck;             // case check box
00062    TGGroupFrame       *fG2;                    // group frame
00063    TGTextEntry        *fSearch;                // search text entry widget
00064    TGTextBuffer       *fBSearch;               // search text buffer
00065    TGLabel            *fLSearch;               // label
00066    TGSearchType       *fType;                  // search type structure
00067    Int_t              *fRetCode;               // return code
00068    TGComboBox         *fCombo;                 // text entry combobox
00069 
00070    static TGSearchDialog *fgSearchDialog;      // global singleton
00071 
00072 public:
00073    TGSearchDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
00074                   TGSearchType *sstruct = 0, Int_t *ret_code = 0,
00075                   UInt_t options = kVerticalFrame);
00076    virtual ~TGSearchDialog();
00077 
00078    virtual void   CloseWindow();
00079    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00080    virtual void   SetClose(Bool_t on) { fType->fClose = on; }
00081    virtual Bool_t IsClose() const {  return fType->fClose; }
00082    virtual void   TextEntered(const char *text); //*SIGNAL*
00083    virtual TGSearchType *GetType() const { return fType; }
00084 
00085    static TGSearchDialog *&SearchDialog();
00086 
00087    ClassDef(TGSearchDialog,0)  // Text search dialog used by TGTextEdit widget
00088 };
00089 
00090 
00091 class TGPrintDialog : public TGTransientFrame {
00092 
00093 protected:
00094    char             **fPrinter;                    // printer to be used
00095    char             **fPrintCommand;               // printer command to be used
00096    TGCompositeFrame  *fF1, *fF2, *fF3, *fF4, *fF5; // sub frames
00097    TGLayoutHints     *fL1, *fL2, *fL3, *fL5, *fL6; // layout hints
00098    TGLayoutHints     *fL7, *fL21;                  // layout hints
00099    TGIcon            *fPrinterIcon;                // printer icon
00100    TGButton          *fPrintButton;                // print button
00101    TGButton          *fCancelButton;               // cancel button
00102    TGTextEntry       *fPrinterEntry;               // printer text entry widget
00103    TGTextEntry       *fPrintCommandEntry;          // command text entry widget
00104    TGTextBuffer      *fBPrinter, *fBPrintCommand;  // printer and command text buffers
00105    TGLabel           *fLPrinter, *fLPrintCommand;  // printer and command labels
00106    Int_t             *fRetCode;                    // return code
00107 
00108 public:
00109    TGPrintDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
00110                  char **printerName = 0, char **printProg = 0, Int_t *ret_code = 0,
00111                  UInt_t options = kVerticalFrame);
00112    virtual ~TGPrintDialog();
00113 
00114    virtual void   CloseWindow();
00115    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00116 
00117    ClassDef(TGPrintDialog,0)  // Print dialog used by TGTextEdit widget
00118 };
00119 
00120 
00121 class TGGotoDialog : public TGTransientFrame {
00122 
00123 protected:
00124    TGCompositeFrame *fF1, *fF2;                // sub frames
00125    TGButton         *fGotoButton;              // goto button
00126    TGButton         *fCancelButton;            // cancel button
00127    TGLayoutHints    *fL1, *fL5, *fL6, *fL21;   // layout hints
00128    TGTextEntry      *fGoTo;                    // goto line number entry widget
00129    TGTextBuffer     *fBGoTo;                   // goto line number text buffer
00130    TGLabel          *fLGoTo;                   // goto label
00131    Long_t           *fRetCode;                 // return code
00132 
00133 public:
00134    TGGotoDialog(const TGWindow *p = 0, const TGWindow *main = 0, UInt_t w = 1, UInt_t h = 1,
00135                 Long_t *ret_code = 0, UInt_t options = kVerticalFrame);
00136    virtual ~TGGotoDialog();
00137 
00138    virtual void   CloseWindow();
00139    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00140 
00141    ClassDef(TGGotoDialog,0)  // Goto line dialog used by TGTextEdit widget
00142 };
00143 
00144 #endif

Generated on Tue Jul 5 14:20:09 2011 for ROOT_528-00b_version by  doxygen 1.5.1