16 #include "TGComboBox.h"
17 #include "KeySymbols.h"
38 TGTextEntry(parent,text,id),
41 m_popup =
new TGComboBoxPopup(fClient->GetDefaultRoot(), 100, 100, kVerticalFrame);
43 m_list->Resize(100,100);
44 m_list->Associate(
this);
45 m_list->GetScrollBar()->GrabPointer(kFALSE);
46 m_popup->AddFrame(m_list,
new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
49 m_list->GetContainer()->AddInput(kButtonPressMask | kButtonReleaseMask | kPointerMotionMask);
50 m_list->SetEditDisabled(kEditDisable);
51 m_list->GetContainer()->Connect(
"KeyPressed(TGFrame*,UInt_t,UInt_t)",
52 "FWGUIValidatingTextEntry",
this,
53 "keyPressedInPopup(TGFrame*,UInt_t,UInt_t)");
54 m_list->GetContainer()->SetEditDisabled(kEditDisable);
55 Connect(
"TabPressed()",
"FWGUIValidatingTextEntry",
this,
"showOptions()");
94 switch (GET_MSG(msg)) {
96 switch (GET_SUBMSG(msg)) {
126 m_list->GetSelectedEntries(&selected);
127 assert(selected.GetEntries() == 1);
128 const TGLBEntry*
entry =
dynamic_cast<TGLBEntry*
> (selected.First());
137 class ChangeFocusTimer :
public TTimer {
139 ChangeFocusTimer(TGWindow* iWindow) :
143 virtual Bool_t Notify() {
145 m_window->RequestFocus();
158 const char*
text = GetText();
159 std::string subText(text,text+GetCursorPosition());
162 typedef std::vector<std::pair<boost::shared_ptr<std::string>, std::string> >
Options;
172 it != itEnd; ++it,++
index) {
176 unsigned int h =
m_list->GetNumberOfEntries()*
188 gVirtualX->TranslateCoordinates(GetId(),
m_popup->GetParent()->GetId(),
189 0, GetHeight(), ax, ay, wdummy);
192 std::auto_ptr<TTimer> timer(
new ChangeFocusTimer(
m_list->GetContainer()) );
197 GetWidth()-2,
m_popup->GetDefaultHeight());
204 fClient->NeedRedraw(
this);
210 long pos = GetCursorPosition();
211 InsertText(iOption.c_str(),
pos);
212 SetCursorPosition(pos + iOption.size());
std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > m_options
virtual void fillOptions(const char *iBegin, const char *iEnd, std::vector< std::pair< boost::shared_ptr< std::string >, std::string > > &oOptions) const =0
void insertTextOption(const std::string &)
FWGUIValidatingTextEntry(const TGWindow *parent=0, const char *text=0, Int_t id=-1)
std::pair< std::string, MonitorElement * > entry
void setValidator(FWValidatorBase *)
FWValidatorBase * m_validator
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
TGComboBoxPopup * m_popup
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void keyPressedInPopup(TGFrame *, UInt_t keysym, UInt_t mask)
virtual ~FWGUIValidatingTextEntry()