Diana Software
QGDropDownBox.hh
Go to the documentation of this file.
1 #ifndef _QG_DROP_DOWN_BOX_HH_
2 #define _QG_DROP_DOWN_BOX_HH_
3 
11 #include <string>
12 #include <vector>
13 #include <TGComboBox.h>
14 
15 class TGTextEntry;
16 
17 class QGDropDownBox : public TGComboBox {
18 public:
20  QGDropDownBox(const TGWindow *p = 0);
21 
23  virtual ~QGDropDownBox();
24 
26  void AddEntryS(const std::string& entry);
27 
29  void EnableTabCompletion();
30 
32  std::vector<std::string> FindMatches(const std::string& s);
33 
35  std::string GetCommonText(const std::vector<std::string>& v);
36 
38  void HandleReturnPressed();
39 
41  void QGHandleEvent(Event_t *event);
42 
44  void SetReturnTarget(TGTextEntry *textBox);
45 
47  void TabComplete();
48 
49 private:
51  std::vector<std::string> fEntries;
52 
54  TGTextEntry *fReturnTarget;
55 
56  ClassDef(QGDropDownBox, 0)
57 };
58 
59 #endif
Drop down box with tab-complete.
void QGHandleEvent(Event_t *event)
Handle event.
TGTextEntry * fReturnTarget
Text box to change to when return is pressed.
void SetReturnTarget(TGTextEntry *textBox)
Set return target.
QGDropDownBox(const TGWindow *p=0)
Constructor.
Definition: QGDropDownBox.cc:9
std::vector< std::string > FindMatches(const std::string &s)
Find a match to a string.
virtual ~QGDropDownBox()
Destructor.
void AddEntryS(const std::string &entry)
Add entry.
std::vector< std::string > fEntries
Collection of entries.
void TabComplete()
Tab complete.
std::string GetCommonText(const std::vector< std::string > &v)
Get common text.
void EnableTabCompletion()
Enable tab completion.
void HandleReturnPressed()
Handle tab pressed.