Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXReplaceDialog.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      T e x t   R e p l a c e   D i a l o g                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXREPLACEDIALOG_H
00022 #define FXREPLACEDIALOG_H
00023 
00024 #ifndef FXDIALOGBOX_H
00025 #include "FXDialogBox.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXButton;
00032 class FXLabel;
00033 class FXTextField;
00034 class FXHorizontalFrame;
00035 
00036 
00038 class FXAPI FXReplaceDialog : public FXDialogBox {
00039   FXDECLARE(FXReplaceDialog)
00040 protected:
00041   FXLabel           *searchlabel;
00042   FXTextField       *searchtext;
00043   FXHorizontalFrame *searchbox;
00044   FXLabel           *replacelabel;
00045   FXTextField       *replacetext;
00046   FXHorizontalFrame *replacebox;
00047   FXButton          *accept;
00048   FXButton          *cancel;
00049   FXButton          *every;
00050   FXuint             searchmode;
00051   FXuint             current;
00052 protected:
00053   FXReplaceDialog(){}
00054   void appendHistory(const FXString& search,const FXString& replace,FXuint mode);
00055 private:
00056   FXReplaceDialog(const FXReplaceDialog&);
00057   FXReplaceDialog &operator=(const FXReplaceDialog&);
00058 public:
00059   long onCmdAll(FXObject*,FXSelector,void*);
00060   long onCmdNext(FXObject*,FXSelector,void*);
00061   long onUpdDir(FXObject*,FXSelector,void*);
00062   long onCmdDir(FXObject*,FXSelector,void*);
00063   long onUpdMode(FXObject*,FXSelector,void*);
00064   long onCmdMode(FXObject*,FXSelector,void*);
00065   long onSearchKey(FXObject*,FXSelector,void*);
00066   long onReplaceKey(FXObject*,FXSelector,void*);
00067   long onCmdSearchHist(FXObject*,FXSelector,void*);
00068   long onCmdReplaceHist(FXObject*,FXSelector,void*);
00069   long onCmdAccept(FXObject*,FXSelector,void*);
00070   long onWheelSearch(FXObject*,FXSelector,void*);
00071   long onWheelReplace(FXObject*,FXSelector,void*);
00072 public:
00073   enum{
00074     ID_NEXT=FXDialogBox::ID_LAST,
00075     ID_PREV,
00076     ID_SEARCH_UP,
00077     ID_SEARCH_DN,
00078     ID_REPLACE_UP,
00079     ID_REPLACE_DN,
00080     ID_ALL,
00081     ID_DIR,
00082     ID_SEARCH_TEXT,
00083     ID_REPLACE_TEXT,
00084     ID_MODE,
00085     ID_LAST=ID_MODE+32
00086     };
00087 public:
00088   enum {
00089     DONE          = 0,    
00090     SEARCH        = 1,    
00091     REPLACE       = 1,    
00092     SEARCH_NEXT   = 2,    
00093     REPLACE_NEXT  = 2,    
00094     REPLACE_ALL   = 3     
00095     };
00096 public:
00097 
00099   FXReplaceDialog(FXWindow* owner,const FXString& caption,FXIcon* ic=NULL,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00100 
00102   void setSearchText(const FXString& text);
00103 
00105   FXString getSearchText() const;
00106 
00108   void setReplaceText(const FXString& text);
00109 
00111   FXString getReplaceText() const;
00112 
00114   void setSearchMode(FXuint mode){ searchmode=mode; }
00115 
00117   FXuint getSearchMode() const { return searchmode; }
00118 
00120   virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
00121 
00123   virtual void save(FXStream& store) const;
00124 
00126   virtual void load(FXStream& store);
00127 
00129   virtual ~FXReplaceDialog();
00130   };
00131 
00132 }
00133 
00134 #endif

Copyright © 1997-2011 Jeroen van der Zijp