File indexing completed on 2024-04-06 12:11:40
0001 #ifndef Fireworks_Core_FWGUIValidatingTextEntry_h
0002 #define Fireworks_Core_FWGUIValidatingTextEntry_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <vector>
0023 #include <string>
0024 #ifndef __CINT__
0025 #include <memory>
0026 #endif
0027
0028 #include "TGTextEntry.h"
0029
0030
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
0042
0043
0044
0045
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&);
0061
0062 const FWGUIValidatingTextEntry& operator=(const FWGUIValidatingTextEntry&);
0063 void insertTextOption(const std::string&);
0064
0065
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