CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Fireworks/Core/src/FWGUIValidatingTextEntry.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_FWGUIValidatingTextEntry_h
00002 #define Fireworks_Core_FWGUIValidatingTextEntry_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     FWGUIValidatingTextEntry
00007 //
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Fri Aug 22 18:13:29 EDT 2008
00019 // $Id: FWGUIValidatingTextEntry.h,v 1.9 2011/07/20 20:17:54 amraktad Exp $
00020 //
00021 
00022 // system include files
00023 #include <vector>
00024 #include <string>
00025 #ifndef __CINT__
00026 #include <boost/shared_ptr.hpp>
00027 #endif
00028 // user include files
00029 #include "TGTextEntry.h"
00030 
00031 // forward declarations
00032 class FWValidatorBase;
00033 class TGComboBoxPopup;
00034 class TGListBox;
00035 
00036 class FWGUIValidatingTextEntry : public TGTextEntry {
00037 
00038 public:
00039    FWGUIValidatingTextEntry(const TGWindow *parent = 0, const char *text = 0, Int_t id = -1);
00040 
00041    virtual ~FWGUIValidatingTextEntry();
00042 
00043    // ---------- const member functions ---------------------
00044 
00045    // ---------- static member functions --------------------
00046 
00047    // ---------- member functions ---------------------------
00048    void setValidator(FWValidatorBase*);
00049    void showOptions();
00050    void hideOptions();
00051 
00052    TGListBox* getListBox() const { return m_list; }
00053    void setMaxListBoxHeight(UInt_t x) { m_listHeight = x; }
00054 
00055    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00056 
00057    void keyPressedInPopup(TGFrame*, UInt_t keysym, UInt_t mask);
00058  
00059    ClassDef(FWGUIValidatingTextEntry, 0);
00060 
00061 private:
00062    FWGUIValidatingTextEntry(const FWGUIValidatingTextEntry&); // stop default
00063 
00064    const FWGUIValidatingTextEntry& operator=(const FWGUIValidatingTextEntry&); // stop default
00065    void insertTextOption(const std::string&);
00066 
00067    // ---------- member data --------------------------------
00068    TGComboBoxPopup* m_popup;
00069    TGListBox*       m_list;
00070    FWValidatorBase* m_validator;
00071 
00072    UInt_t           m_listHeight;
00073 #ifndef __CINT__
00074    std::vector<std::pair<boost::shared_ptr<std::string>, std::string> > m_options;
00075 #endif
00076 };
00077 
00078 
00079 #endif