16 #include "TGComboBox.h"
17 #include "KeySymbols.h"
38 TGTextEntry(parent,text,id),
44 m_popup =
new TGComboBoxPopup(fClient->GetDefaultRoot(), 100, 100, kVerticalFrame);
47 m_list->Associate(
this);
48 m_list->GetScrollBar()->GrabPointer(kFALSE);
49 m_popup->AddFrame(m_list,
new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
52 m_list->GetContainer()->AddInput(kButtonPressMask | kButtonReleaseMask | kPointerMotionMask);
53 m_list->SetEditDisabled(kEditDisable);
54 m_list->GetContainer()->Connect(
"KeyPressed(TGFrame*,UInt_t,UInt_t)",
55 "FWGUIValidatingTextEntry",
this,
56 "keyPressedInPopup(TGFrame*,UInt_t,UInt_t)");
57 m_list->GetContainer()->SetEditDisabled(kEditDisable);
58 Connect(
"TabPressed()",
"FWGUIValidatingTextEntry",
this,
"showOptions()");
97 switch (GET_MSG(msg)) {
99 switch (GET_SUBMSG(msg)) {
132 const TGLBEntry*
entry =
dynamic_cast<TGLBEntry*
> (
f);
136 m_list->Selected(entry->EntryId());
144 class ChangeFocusTimer :
public TTimer {
146 ChangeFocusTimer(TGWindow* iWindow) :
150 virtual Bool_t Notify() {
152 m_window->RequestFocus();
165 const char*
text = GetText();
166 std::string subText(text,text+GetCursorPosition());
169 typedef std::vector<std::pair<boost::shared_ptr<std::string>, std::string> >
Options;
179 it != itEnd; ++it,++
index) {
183 unsigned int h =
m_list->GetNumberOfEntries()*
195 gVirtualX->TranslateCoordinates(GetId(),
m_popup->GetParent()->GetId(),
196 0, GetHeight(),
ax, ay, wdummy);
199 std::auto_ptr<TTimer> timer(
new ChangeFocusTimer(
m_list->GetContainer()) );
204 GetWidth()-2,
m_popup->GetDefaultHeight());
211 fClient->NeedRedraw(
this);
217 long pos = GetCursorPosition();
218 InsertText(iOption.c_str(),
pos);
219 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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::vector< boost::shared_ptr< fireworks::OptionNode > > Options
TGComboBoxPopup * m_popup
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
void keyPressedInPopup(TGFrame *, UInt_t keysym, UInt_t mask)
virtual ~FWGUIValidatingTextEntry()