Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:15

0001 #ifndef Fireworks_Core_FWGUIValidatingTextEntry_h
0002 #define Fireworks_Core_FWGUIValidatingTextEntry_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWGUIValidatingTextEntry
0007 //
0008 /**\class FWGUIValidatingTextEntry FWGUIValidatingTextEntry.h Fireworks/Core/interface/FWGUIValidatingTextEntry.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri Aug 22 18:13:29 EDT 2008
0019 //
0020 
0021 // system include files
0022 #include <vector>
0023 #include <string>
0024 #ifndef __CINT__
0025 #include <memory>
0026 #endif
0027 // user include files
0028 #include "TGTextEntry.h"
0029 
0030 // forward declarations
0031 class FWValidatorBase;
0032 class TGComboBoxPopup;
0033 class TGListBox;
0034 
0035 class FWGUIValidatingTextEntry : public TGTextEntry {
0036 public:
0037   FWGUIValidatingTextEntry(const TGWindow* parent = nullptr, const char* text = nullptr, Int_t id = -1);
0038 
0039   ~FWGUIValidatingTextEntry() override;
0040 
0041   // ---------- const member functions ---------------------
0042 
0043   // ---------- static member functions --------------------
0044 
0045   // ---------- member functions ---------------------------
0046   void setValidator(FWValidatorBase*);
0047   void showOptions();
0048   void hideOptions();
0049 
0050   TGListBox* getListBox() const { return m_list; }
0051   void setMaxListBoxHeight(UInt_t x) { m_listHeight = x; }
0052 
0053   Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) override;
0054 
0055   void keyPressedInPopup(TGFrame*, UInt_t keysym, UInt_t mask);
0056 
0057   ClassDefOverride(FWGUIValidatingTextEntry, 0);
0058 
0059 private:
0060   FWGUIValidatingTextEntry(const FWGUIValidatingTextEntry&);  // stop default
0061 
0062   const FWGUIValidatingTextEntry& operator=(const FWGUIValidatingTextEntry&);  // stop default
0063   void insertTextOption(const std::string&);
0064 
0065   // ---------- member data --------------------------------
0066   TGComboBoxPopup* m_popup;
0067   TGListBox* m_list;
0068   FWValidatorBase* m_validator;
0069 
0070   UInt_t m_listHeight;
0071 #ifndef __CINT__
0072   std::vector<std::pair<std::shared_ptr<std::string>, std::string> > m_options;
0073 #endif
0074 };
0075 
0076 #endif