15 #include "TGComboBox.h"
16 #include "KeySymbols.h"
37 TGTextEntry(parent,text,id),
43 m_popup =
new TGComboBoxPopup(
fClient->GetDefaultRoot(), 100, 100, kVerticalFrame);
46 m_list->Associate(
this);
47 m_list->GetScrollBar()->GrabPointer(kFALSE);
48 m_popup->AddFrame(m_list,
new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
51 m_list->GetContainer()->AddInput(kButtonPressMask | kButtonReleaseMask | kPointerMotionMask);
52 m_list->SetEditDisabled(kEditDisable);
53 m_list->GetContainer()->Connect(
"KeyPressed(TGFrame*,UInt_t,UInt_t)",
54 "FWGUIValidatingTextEntry",
this,
55 "keyPressedInPopup(TGFrame*,UInt_t,UInt_t)");
56 m_list->GetContainer()->SetEditDisabled(kEditDisable);
57 Connect(
"TabPressed()",
"FWGUIValidatingTextEntry",
this,
"showOptions()");
96 switch (GET_MSG(msg)) {
98 switch (GET_SUBMSG(msg)) {
131 const TGLBEntry*
entry =
dynamic_cast<TGLBEntry*
> (
f);
135 m_list->Selected(entry->EntryId());
143 class ChangeFocusTimer :
public TTimer {
145 ChangeFocusTimer(TGWindow* iWindow) :
149 virtual Bool_t Notify()
override {
151 m_window->RequestFocus();
164 const char*
text = GetText();
165 std::string subText(text,text+GetCursorPosition());
178 it != itEnd; ++it,++
index) {
182 unsigned int h =
m_list->GetNumberOfEntries()*
194 gVirtualX->TranslateCoordinates(GetId(),
m_popup->GetParent()->GetId(),
195 0, GetHeight(),
ax, ay, wdummy);
198 std::auto_ptr<TTimer> timer(
new ChangeFocusTimer(
m_list->GetContainer()) );
203 GetWidth()-2,
m_popup->GetDefaultHeight());
216 long pos = GetCursorPosition();
217 InsertText(iOption.c_str(), pos);
218 SetCursorPosition(pos + iOption.size());
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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)
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)
void keyPressedInPopup(TGFrame *, UInt_t keysym, UInt_t mask)
virtual ~FWGUIValidatingTextEntry()