Logo ROOT  
Reference Guide
TGComboBox.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 13/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 /**************************************************************************
12 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 
24 /** \class TGComboBox
25  \ingroup guiwidgets
26 
27 A combobox (also known as a drop down listbox) allows the selection
28 of one item out of a list of items. The selected item is visible in
29 a little window. To view the list of possible items one has to click
30 on a button on the right of the little window. This will drop down
31 a listbox. After selecting an item from the listbox the box will
32 disappear and the newly selected item will be shown in the little
33 window.
34 
35 The TGComboBox is user callable.
36 
37 \class TGComboBoxPopup
38 \ingroup guiwidgets
39 
40 A service class of the combobox.
41 
42 Selecting an item in the combobox will generate the event:
43  - kC_COMMAND, kCM_COMBOBOX, combobox id, item id.
44 
45 */
46 
47 
48 #include "TGComboBox.h"
49 #include "TGScrollBar.h"
50 #include "TGResourcePool.h"
51 #include "TGTextEntry.h"
52 #include "KeySymbols.h"
53 #include "TVirtualX.h"
54 #include "RConfigure.h"
55 
56 #include <iostream>
57 
58 
61 
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// Create a combo box popup frame.
68 
70  UInt_t options, ULong_t back) :
71  TGCompositeFrame (p, w, h, options, back), fListBox(0), fSelected(0)
72 {
74 
77  wattr.fOverrideRedirect = kTRUE;
78  wattr.fSaveUnder = kTRUE;
79  wattr.fBorderPixel = fgBlackPixel;
80  wattr.fBorderWidth = 1;
81  gVirtualX->ChangeWindowAttributes(fId, &wattr);
82 
85  SetWindowName();
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// Handle mouse button event in combo box popup.
90 
92 {
93  if (event->fType == kButtonPress && event->fCode == kButton1) {
94  if ((fListBox != 0) && (fSelected != 0) &&
96  // in the case the combo box popup is closed by clicking outside the
97  // list box, then select the previously selected entry
99  }
100  EndPopup();
101  }
102  else {
103  // reset the dragging flag of the scrollbar when the button is
104  // released outside the scrollbar itself
106  }
107  return kTRUE;
108 }
109 
110 ////////////////////////////////////////////////////////////////////////////////
111 /// Ungrab pointer and unmap popup window.
112 
114 {
115  if (IsMapped()) {
116  Handle_t id = fListBox->GetContainer()->GetId();
117  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Up),
119  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Down),
121  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Enter),
123  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Return),
125  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Escape),
127  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Space),
129  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
130  UnmapWindow();
131  }
132 }
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Popup combo box popup window at the specified place.
136 
138 {
139  Int_t rx, ry;
140  UInt_t rw, rh;
141 
142  // Parent is root window for the popup:
143  gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
144 
145  if (gVirtualX->InheritsFrom("TGWin32")) {
146  if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
147  x = rw - abs(rx) - fWidth;
148  if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
149  y = rh - fHeight;
150  } else {
151  if (x < 0) x = 0;
152  if (x + fWidth > rw) x = rw - fWidth;
153  if (y < 0) y = 0;
154  if (y + fHeight > rh) y = rh - fHeight;
155  }
156 
157  // remember the current selected entry
158  if (fListBox == 0) {
159  // the listbox should be the first in the list
161  fListBox = dynamic_cast<TGListBox *>(el->fFrame);
162  }
164 
165  MoveResize(x, y, w, h);
166  MapSubwindows();
167  Layout();
168  MapRaised();
169 
170  Handle_t id = fListBox->GetContainer()->GetId();
171  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Up),
173  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Down),
175  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Enter),
177  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Return),
179  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Escape),
181  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Space),
184 
188 
189  if (fClient->IsEditable()) {
190  fClient->RegisterPopup(this);
191  }
192 
193  fClient->WaitForUnmap(this);
194  EndPopup();
195 }
196 
197 ////////////////////////////////////////////////////////////////////////////////
198 /// Slot handling the key press events.
199 
201 {
202  switch ((EKeySym)keysym) {
203  case kKey_Enter:
204  case kKey_Return:
205  case kKey_Space:
206  if (fListBox && f) {
207  TGLBEntry *entry = dynamic_cast<TGLBEntry *>(f);
208  if (entry) {
209  fListBox->Select(entry->EntryId());
211  entry->EntryId(), 0);
212  }
213  }
214  EndPopup();
215  break;
216  case kKey_Escape:
217  if (fListBox)
218  ((TGContainer *)fListBox->GetContainer())->UnSelectAll();
219  EndPopup();
220  break;
221  default:
222  break;
223  }
224 }
225 
226 ////////////////////////////////////////////////////////////////////////////////
227 /// Create a combo box widget.
228 
230  ULong_t back) :
231  TGCompositeFrame (p, 10, 10, options | kOwnBackground, back)
232 {
233  fWidgetId = id;
234  fMsgWindow = p;
235  fTextEntry = 0;
236 
237  fSelEntry = new TGTextLBEntry(this, new TGString(""), 0);
239 
242  Init();
243 }
244 
245 ////////////////////////////////////////////////////////////////////////////////
246 /// Create an editable combo box widget.
247 
248 TGComboBox::TGComboBox(const TGWindow *p, const char *text, Int_t id,
249  UInt_t options, ULong_t back) :
250  TGCompositeFrame (p, 10, 10, options | kOwnBackground, back)
251 {
252  fWidgetId = id;
253  fMsgWindow = p;
254  fSelEntry = 0;
255 
256  fTextEntry = new TGTextEntry(this, text, id);
258  fTextEntry->Connect("ReturnPressed()", "TGComboBox", this, "ReturnPressed()");
259 
262  Init();
263 }
264 
265 ////////////////////////////////////////////////////////////////////////////////
266 /// Delete a combo box widget.
267 
269 {
271 
272  if (!MustCleanup()) {
276  SafeDelete(fLhs);
277  SafeDelete(fLhb);
278  }
279 
280  SafeDelete(fLhdd);
282  if (fComboFrame) {
283  fComboFrame->EndPopup(); // force popdown in case of Qt interface
285  }
286 }
287 
288 ////////////////////////////////////////////////////////////////////////////////
289 /// Initiate the internal classes of a combo box.
290 
292 {
293  fBpic = fClient->GetPicture("arrow_down.xpm");
294 
295  if (!fBpic)
296  Error("TGComboBox", "arrow_down.xpm not found");
297 
300 
302  kLHintsExpandY));
303 
305 
307 
308  fListBox->Resize(100, 100);
309  fListBox->Associate(this);
310  fListBox->GetScrollBar()->GrabPointer(kFALSE); // combobox will do a pointergrab
311 
313  kLHintsExpandY));
317 
320 
321  fListBox->GetContainer()->Connect("KeyPressed(TGFrame*, UInt_t, UInt_t)",
322  "TGComboBoxPopup", fComboFrame,
323  "KeyPressed(TGFrame*, UInt_t, UInt_t)");
324  // Drop down listbox of combo box should react to pointer motion
325  // so it will be able to Activate() (i.e. highlight) the different
326  // items when the mouse crosses.
329 
336 
337  SetWindowName();
338 }
339 
340 ////////////////////////////////////////////////////////////////////////////////
341 /// Draw border of combo box widget.
342 
344 {
347  gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
348  gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
349  gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, fWidth-3, 1);
350  gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, 1, fHeight-3);
351  if (gClient->GetStyle() > 1) break;
352  gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
353  gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
354  gVirtualX->DrawLine(fId, GetBckgndGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
355  gVirtualX->DrawLine(fId, GetBckgndGC()(), fWidth-2, 1, fWidth-2, fHeight-2);
356  break;
357 
358  default:
360  break;
361  }
362 }
363 
364 ////////////////////////////////////////////////////////////////////////////////
365 /// Switch text input or readonly mode of combobox (not perfect yet).
366 
368 {
369  // UInt_t w, h;
370  TString text = "";
371  Pixel_t back = TGFrame::GetWhitePixel(); // default
372 
373  if (on) {
374  if (fSelEntry) {
375  back = fSelEntry->GetBackground();
376  text = ((TGTextLBEntry*)fSelEntry)->GetText()->GetString();
378  fTextEntry->SetText(text.Data());
379  }
381  //w = fSelEntry->GetWidth();
382  //h = fSelEntry->GetHeight();
384  delete fSelEntry;
385  fSelEntry = 0;
386  }
387  if (!fTextEntry) {
388  fTextEntry = new TGTextEntry(this, text.Data(), 0);
390  fTextEntry->Connect("ReturnPressed()", "TGComboBox", this, "ReturnPressed()");
393  }
395  MapSubwindows();
396  // coverity[returned_null]
397  // coverity[dereference]
399  } else {
400  if (fTextEntry) {
401  back = fTextEntry->GetBackground();
402  text = fTextEntry->GetText();
405  //w = fTextEntry->GetWidth();
406  //h = fTextEntry->GetHeight();
407  delete fTextEntry;
408  fTextEntry = 0;
409  }
410  if (!fSelEntry) {
411  fSelEntry = new TGTextLBEntry(this, new TGString(text.Data()), 0);
415  }
417  MapSubwindows();
418  // coverity[returned_null]
419  // coverity[dereference]
421  }
422 }
423 
424 ////////////////////////////////////////////////////////////////////////////////
425 /// Find entry by name.
426 
427 TGLBEntry *TGComboBox::FindEntry(const char *s) const
428 {
429  TGLBEntry *sel = 0;
430  sel = fListBox->FindEntry(s);
431  return sel;
432 }
433 
434 ////////////////////////////////////////////////////////////////////////////////
435 /// Set a new combo box value (normally update of text string in
436 /// fSelEntry is done via fSelEntry::Update()).
437 
439 {
440  if (!fSelEntry) return;
441 
444  delete fSelEntry;
445  delete fLhs;
446  fSelEntry = e;
447  fLhs = lh;
449  Layout();
450 }
451 
452 ////////////////////////////////////////////////////////////////////////////////
453 /// Make the selected item visible in the combo box window
454 /// and emit signals according to the second parameter.
455 
457 {
458  if (id!=GetSelected()) {
459  TGLBEntry *e;
460  e = fListBox->Select(id);
461  if (e) {
462  if (fSelEntry) {
463  fSelEntry->Update(e);
464  Layout();
465  } else if (fTextEntry && e->InheritsFrom(TGTextLBEntry::Class())) {
466  TGTextLBEntry *te = (TGTextLBEntry*)e;
467  fTextEntry->SetText(te->GetText()->GetString());
468  }
469  if (emit) {
470  Selected(fWidgetId, id);
471  Selected(id);
472  Changed();
473  }
474  }
475  }
476 }
477 
478 ////////////////////////////////////////////////////////////////////////////////
479 /// Handle mouse button events in the combo box.
480 
482 {
483  if (!fDDButton || !fDDButton->IsEnabled()) return kFALSE;
484 
485  if (event->fType == kButtonPress) {
486  Window_t child = (Window_t)event->fUser[0]; // fUser[0] = child window
487 
488  if (child == fDDButton->GetId() || (fSelEntry && child == fSelEntry->GetId())) {
490 
491  if (fTextEntry && (child == fTextEntry->GetId())) {
492  return fTextEntry->HandleButton(event);
493  }
494  int ax, ay;
495  Window_t wdummy;
496  gVirtualX->TranslateCoordinates(fId, fComboFrame->GetParent()->GetId(),
497  0, fHeight, ax, ay, wdummy);
498  // Drop down listbox of combo box should react to pointer motion...
500 #ifdef R__HAS_COCOA
501  gVirtualX->SetWMTransientHint(fComboFrame->GetId(), GetId());
502 #endif
505 #ifdef R__HAS_COCOA
506  //tp: I need this modification - "button" is not repainted correctly
507  //with Cocoa, when combobox is closed (reason is quite complex), happens
508  //when item is wider than combobox.
509  //TODO: find another way :)
511 #endif
512  } else if (fTextEntry) {
513  return fTextEntry->HandleButton(event);
514  }
515  }
516  return kTRUE;
517 }
518 
519 ////////////////////////////////////////////////////////////////////////////////
520 /// Remove entry. If id == -1, the currently selected entry is removed
521 
523 {
524  fListBox->RemoveEntry(id);
525 
526  if (id < 0) {
527  if (fSelEntry) {
528  ((TGTextLBEntry*)fSelEntry)->SetTitle("");
530  } else {
531  fTextEntry->SetTitle("");
533  }
534  }
535  Resize();
536 }
537 
538 ////////////////////////////////////////////////////////////////////////////////
539 /// layout combobox
540 
542 {
545 
546  if (h && (h < 100)) {
548  }
549 }
550 
551 ////////////////////////////////////////////////////////////////////////////////
552 /// Handle double click in text entry.
553 
555 {
557 }
558 
559 ////////////////////////////////////////////////////////////////////////////////
560 /// Handle pointer motion in text entry.
561 
563 {
565 }
566 
567 ////////////////////////////////////////////////////////////////////////////////
568 /// Handle selection in text entry.
569 
571 {
573 }
574 
575 ////////////////////////////////////////////////////////////////////////////////
576 /// Handle selection request in text entry.
577 
579 {
581 }
582 
583 ////////////////////////////////////////////////////////////////////////////////
584 /// Process messages generated by the listbox and forward
585 /// messages to the combobox message handling window. Parm2 contains
586 /// the id of the selected listbox entry.
587 
589 {
590  TGLBEntry *e;
591 
592  switch (GET_MSG(msg)) {
593  case kC_COMMAND:
594  switch (GET_SUBMSG(msg)) {
595  case kCM_LISTBOX:
597  if (fSelEntry) {
598  fSelEntry->Update(e);
599  } else if (fTextEntry &&
600  e->InheritsFrom(TGTextLBEntry::Class())) {
601  TGTextLBEntry *te = (TGTextLBEntry*)e;
602  fTextEntry->SetText(te->GetText()->GetString());
603  }
604  // coverity[returned_null]
605  // coverity[dereference]
610  fWidgetId, parm2);
611  if (e->InheritsFrom(TGTextLBEntry::Class())) {
612  const char *text;
613  text = ((TGTextLBEntry*)e)->GetText()->GetString();
614  Selected(text);
615  }
616  Selected(fWidgetId, (Int_t)parm2);
617  Selected((Int_t)parm2);
618  Changed();
619  fClient->NeedRedraw(this);
620  break;
621  }
622  break;
623 
624  default:
625  break;
626  }
627  return kTRUE;
628 }
629 
630 ////////////////////////////////////////////////////////////////////////////////
631 /// Emit signal, done only when selected entry changed.
632 
633 void TGComboBox::Selected(Int_t widgetId, Int_t id)
634 {
635  Long_t args[2];
636 
637  args[0] = widgetId;
638  args[1] = id;
639 
640  Emit("Selected(Int_t,Int_t)", args);
641 }
642 
643 ////////////////////////////////////////////////////////////////////////////////
644 /// Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
645 
647 {
648  fDDButton->SetEnabled(on);
649  if (on) {
652  } else {
655  }
657 }
658 
659 ////////////////////////////////////////////////////////////////////////////////
660 /// Add new entry to combo box when return key pressed inside text entry
661 /// ReturnPressed signal is emitted.
662 
664 {
665  if (!fTextEntry) return;
666 
669 
670  TIter next(lbc->GetList());
671  TGFrameElement *el;
672 
673  Emit("ReturnPressed()");
674 
675  while ((el = (TGFrameElement *)next())) {
676  TGTextLBEntry *lbe = (TGTextLBEntry *)el->fFrame;
677  if (lbe->GetText()->GetString() == text) {
678  return;
679  }
680  }
681 
682  Int_t nn = GetNumberOfEntries() + 1;
683  AddEntry(text.Data(), nn);
684  Select(nn);
685 }
686 
687 ////////////////////////////////////////////////////////////////////////////////
688 /// Remove all entries from combo box.
689 
691 {
692  fListBox->RemoveAll();
693 
694  if (fSelEntry) {
695  ((TGTextLBEntry*)fSelEntry)->SetTitle("");
697  } else {
698  fTextEntry->SetTitle("");
700  }
701 }
702 
703 ////////////////////////////////////////////////////////////////////////////////
704 /// Save a combo box widget as a C++ statement(s) on output stream out.
705 
706 void TGComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
707 {
708  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
709 
710  out << std::endl << " // combo box" << std::endl;
711  out << " TGComboBox *";
712 
713  if (!fTextEntry) {
714  out << GetName() << " = new TGComboBox(" << fParent->GetName() << "," << fWidgetId;
715  } else {
716  out << GetName() << " = new TGComboBox(" << fParent->GetName() << ",";
717  out << '\"' << fTextEntry->GetText() << '\"' << "," <<fWidgetId;
718  }
719 
720  if (fBackground == GetWhitePixel()) {
722  out <<");" << std::endl;
723  } else {
724  out << "," << GetOptionString() << ");" << std::endl;
725  }
726  } else {
727  out << "," << GetOptionString() << ",ucolor);" << std::endl;
728  }
729  if (option && strstr(option, "keep_names"))
730  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
731 
732  TGTextLBEntry *b;
733  TGFrameElement *el;
734  TGListBox *lb = GetListBox();
735 
736  TIter next(((TGLBContainer *)lb->GetContainer())->GetList());
737 
738  while ((el = (TGFrameElement *) next())) {
739  b = (TGTextLBEntry *) el->fFrame;
740  out << " " << GetName() << "->AddEntry(";
741  b->SavePrimitive(out, option);
742  out << ");" << std::endl;
743  }
744 
745  out << " " << GetName() << "->Resize(" << GetWidth() << ","
746  << GetHeight() << ");" << std::endl;
747  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
748 }
749 
750 ////////////////////////////////////////////////////////////////////////////////
751 /// Create a line style combo box.
752 
754  UInt_t options, Pixel_t back)
755  : TGComboBox(p, id, options, back)
756 {
757  SetTopEntry(new TGLineLBEntry(this, 0),
760 
761  for (Int_t i = 1; i <= 10; i++)
762  AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), i,
763  TString::Format("%d",i), 0, i),
765 
766  Select(1, kFALSE); // to have first entry selected
767 
768  SetWindowName();
769 }
770 
771 ////////////////////////////////////////////////////////////////////////////////
772 /// Save a line style combo box widget as a C++ statement(s).
773 
774 void TGLineStyleComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
775 {
776  out << std::endl << " // line style combo box" << std::endl;
777  out << " TGLineStyleComboBox *";
778 
779  out << GetName() << " = new TGLineStyleComboBox(" << fParent->GetName()
780  << "," << fWidgetId << ");" << std::endl;
781  if (option && strstr(option, "keep_names"))
782  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
783  out << " " << GetName() << "->Resize(" << GetWidth() << ","
784  << GetHeight() << ");" << std::endl;
785  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
786 }
787 
788 ////////////////////////////////////////////////////////////////////////////////
789 /// Create a line width combo box.
790 /// If "none" is equal to kTRUE the first entry is "None".
791 
793  UInt_t options, Pixel_t back, Bool_t none)
794  : TGComboBox(p, id, options, back)
795 {
796  SetTopEntry(new TGLineLBEntry(this,0),
799 
800  if (none) {
801  AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), 0, "None", 0, 0),
803  }
804 
805  for (Int_t i = 0; i < 16; i++)
806  AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), i,
807  TString::Format("%d",i), i, 0),
809  Select(1, kFALSE); // to have first entry selected
810  SetWindowName();
811 }
812 
813 ////////////////////////////////////////////////////////////////////////////////
814 /// Save a line width combo box widget as a C++ statement(s).
815 
816 void TGLineWidthComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
817 {
818  out << std::endl << " // line width combo box" << std::endl;
819  out << " TGLineWidthComboBox *";
820 
821  out << GetName() << " = new TGLineWidthComboBox(" << fParent->GetName()
822  << "," << fWidgetId << ");" << std::endl;
823  if (option && strstr(option, "keep_names"))
824  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
825  out << " " << GetName() << "->Resize(" << GetWidth() << ","
826  << GetHeight() << ");" << std::endl;
827  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
828 }
829 
830 static const char *gFonts[][2] = { // unix name, name
831  { "", "" }, //not used
832  { "-*-times-medium-i-*-*-12-*-*-*-*-*-*-*", "1. times italic" },
833  { "-*-times-bold-r-*-*-12-*-*-*-*-*-*-*", "2. times bold" },
834  { "-*-times-bold-i-*-*-12-*-*-*-*-*-*-*", "3. times bold italic" },
835  { "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*", "4. helvetica" },
836  { "-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*", "5. helvetica italic" },
837  { "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*", "6. helvetica bold" },
838  { "-*-helvetica-bold-o-*-*-12-*-*-*-*-*-*-*", "7. helvetica bold italic" },
839  { "-*-courier-medium-r-*-*-12-*-*-*-*-*-*-*", "8. courier" },
840  { "-*-courier-medium-o-*-*-12-*-*-*-*-*-*-*", "9. courier italic" },
841  { "-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*", "10. courier bold" },
842  { "-*-courier-bold-o-*-*-12-*-*-*-*-*-*-*", "11. courier bold italic" },
843  { "-*-symbol-medium-r-*-*-12-*-*-*-*-*-*-*", "12. symbol" },
844  { "-*-times-medium-r-*-*-12-*-*-*-*-*-*-*", "13. times" },
845  { 0, 0}
846 };
847 
848 ////////////////////////////////////////////////////////////////////////////////
849 /// Create a text font combo box.
850 
852  UInt_t options, Pixel_t back) :
853  TGComboBox(p, id, options, back)
854 {
855  Int_t noFonts = 0;
856 
857  for (Int_t i = 1; gFonts[i][0] != 0 && noFonts < kMaxFonts; i++) {
858 
859  fFonts[noFonts] = gVirtualX->LoadQueryFont(gFonts[i][0]);
860 
861  if (fFonts[noFonts] == 0)
863 
864  GCValues_t gval;
865  gval.fMask = kGCFont;
866  gval.fFont = gVirtualX->GetFontHandle(fFonts[noFonts]);
867 
868  AddEntry(new TGTextLBEntry(GetListBox()->GetContainer(),
869  new TGString(gFonts[i][1]), i,
870  fClient->GetGC(&gval, kTRUE)->GetGC(), fFonts[noFonts]),
872  noFonts++;
873  }
874 
875  if (noFonts < kMaxFonts - 1)
876  fFonts[noFonts] = 0;
877 
878  Select(1, kFALSE); // to have first entry selected
879  SetWindowName();
880 }
881 
882 ////////////////////////////////////////////////////////////////////////////////
883 /// Text font combo box dtor.
884 
886 {
887  for (int i = 0; i < kMaxFonts && fFonts[i] != 0; i++) {
888  if (fFonts[i] != TGTextLBEntry::GetDefaultFontStruct()) gVirtualX->DeleteFont(fFonts[i]);
889  }
890 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
kMaxFonts
const Int_t kMaxFonts
Definition: TGComboBox.h:175
TGComboBox.h
kKey_Down
@ kKey_Down
Definition: KeySymbols.h:43
TGCompositeFrame::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:316
TGListBox::RemoveEntry
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
Definition: TGListBox.cxx:1318
kWABorderPixel
const Mask_t kWABorderPixel
Definition: GuiTypes.h:142
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:236
TGListBox
A listbox is a box, possibly with scrollbar, containing entries.
Definition: TGListBox.h:221
TGClient::RegisterPopup
void RegisterPopup(TGWindow *w)
Add a popup menu to the list of popups.
Definition: TGClient.cxx:535
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:110
kDefaultScrollBarWidth
@ kDefaultScrollBarWidth
Definition: GuiTypes.h:86
SetWindowAttributes_t::fSaveUnder
Bool_t fSaveUnder
should bits under be saved (popups)?
Definition: GuiTypes.h:104
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:225
kWABorderWidth
const Mask_t kWABorderWidth
Definition: GuiTypes.h:143
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGScrollBarElement::SetEnabled
virtual void SetEnabled(Bool_t on=kTRUE)
Enable/Disable scroll bar button chaging the state.
Definition: TGScrollBar.cxx:149
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGTextEntry::SetText
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Definition: TGTextEntry.cxx:611
TGComboBox::GetNumberOfEntries
virtual Int_t GetNumberOfEntries() const
Definition: TGComboBox.h:107
e
#define e(i)
Definition: RSha256.hxx:103
TGComboBox::Init
virtual void Init()
Initiate the internal classes of a combo box.
Definition: TGComboBox.cxx:291
TGFontTypeComboBox
The TGFontTypeComboBox is user callable and it creates a combobox for selecting the font.
Definition: TGComboBox.h:177
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:310
TGComboBox::HandleSelectionRequest
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle selection request in text entry.
Definition: TGComboBox.cxx:578
TGFrame::fgBlackPixel
static Pixel_t fgBlackPixel
Definition: TGFrame.h:104
TGFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:321
TGCompositeFrame::GetLayoutManager
virtual TGLayoutManager * GetLayoutManager() const
Definition: TGFrame.h:338
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:41
kAnyModifier
const Mask_t kAnyModifier
Definition: GuiTypes.h:210
f
#define f(i)
Definition: RSha256.hxx:104
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGFontTypeComboBox::~TGFontTypeComboBox
virtual ~TGFontTypeComboBox()
Text font combo box dtor.
Definition: TGComboBox.cxx:885
TGComboBox::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by the listbox and forward messages to the combobox message handling windo...
Definition: TGComboBox.cxx:588
TGLineLBEntry
Line style and width listbox entries.
Definition: TGListBox.h:97
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
TGWindow::RequestFocus
virtual void RequestFocus()
request focus
Definition: TGWindow.cxx:232
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGScrollBar::SetDragging
virtual void SetDragging(Bool_t drag)
Definition: TGScrollBar.h:110
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
kKey_Up
@ kKey_Up
Definition: KeySymbols.h:41
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:27
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
EKeySym
EKeySym
Definition: KeySymbols.h:25
TGComboBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:86
TGFontTypeComboBox::TGFontTypeComboBox
TGFontTypeComboBox(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t bask=GetWhitePixel())
Create a text font combo box.
Definition: TGComboBox.cxx:851
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:24
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
TGWindow::kEditDisableLayout
@ kEditDisableLayout
window layout cannot be edited
Definition: TGWindow.h:53
TGComboBox::fSelEntry
TGLBEntry * fSelEntry
selected item frame
Definition: TGComboBox.h:54
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1411
SetWindowAttributes_t::fBorderWidth
UInt_t fBorderWidth
border width in pixels
Definition: GuiTypes.h:98
TGScrollBarElement
Definition: TGScrollBar.h:29
GCValues_t
Graphics context structure.
Definition: GuiTypes.h:224
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TGWindow::kEditDisable
@ kEditDisable
disable edit of this window
Definition: TGWindow.h:50
TGFrame::fOptions
UInt_t fOptions
frame options
Definition: TGFrame.h:94
TGComboBoxPopup::KeyPressed
void KeyPressed(TGFrame *, UInt_t, UInt_t)
Slot handling the key press events.
Definition: TGComboBox.cxx:200
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TGClient::IsEditable
Bool_t IsEditable() const
Definition: TGClient.h:89
TGComboBox::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle pointer motion in text entry.
Definition: TGComboBox.cxx:562
TGComboBox::fLhdd
TGLayoutHints * fLhdd
layout hints for fListBox
Definition: TGComboBox.h:62
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:536
TGComboBox::Select
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:456
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1022
event
Definition: triangle.c:552
x
Double_t x[n]
Definition: legend1.C:17
TGListBox::GetSelectedEntry
virtual TGLBEntry * GetSelectedEntry() const
Definition: TGListBox.h:288
TGWindow::kEditDisableHeight
@ kEditDisableHeight
window height cannot be edited
Definition: TGWindow.h:55
TGLineWidthComboBox::TGLineWidthComboBox
TGLineWidthComboBox(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel(), Bool_t none=kFALSE)
Create a line width combo box.
Definition: TGComboBox.cxx:792
TGClient::WaitForUnmap
void WaitForUnmap(TGWindow *w)
Wait for window to be unmapped.
Definition: TGClient.cxx:739
kButton1
@ kButton1
Definition: GuiTypes.h:214
Handle_t
ULongptr_t Handle_t
Generic resource handle.
Definition: GuiTypes.h:26
TGResourcePool::GetGrabCursor
Cursor_t GetGrabCursor() const
Definition: TGResourcePool.h:162
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TVirtualX.h
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:310
TGFrame::GetBackground
virtual Pixel_t GetBackground() const
Definition: TGFrame.h:192
TGListBox::GetContainer
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:267
TGClient::GetResourcePool
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:124
TGComboBox::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click in text entry.
Definition: TGComboBox.cxx:554
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2333
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:735
TString
Basic string class.
Definition: TString.h:136
TGFrame::DrawBorder
virtual void DrawBorder()
Draw frame border.
Definition: TGFrame.cxx:421
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
TGTextEntry::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in the text entry widget.
Definition: TGTextEntry.cxx:1396
SetWindowAttributes_t::fMask
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:110
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:37
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
TGTextEntry::SetTitle
virtual void SetTitle(const char *label)
Definition: TGTextEntry.h:155
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
text
TText * text
Definition: entrylist_figure1.C:10
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
b
#define b(i)
Definition: RSha256.hxx:100
TGLBEntry::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t col)
Set background color (override from TGWindow base class).
Definition: TGListBox.h:42
TGWindow::kEditDisableEvents
@ kEditDisableEvents
window events cannot be edited
Definition: TGWindow.h:51
bool
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:224
TGCompositeFrame::fList
TList * fList
container of frame elements
Definition: TGFrame.h:292
id
XFontStruct * id
Definition: TGX11.cxx:109
kWASaveUnder
const Mask_t kWASaveUnder
Definition: GuiTypes.h:150
TGWindow::kEditDisableBtnEnable
@ kEditDisableBtnEnable
window can handle mouse button events
Definition: TGWindow.h:57
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:112
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2480
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
TGWindow::DestroyWindow
virtual void DestroyWindow()
destroy window
Definition: TGWindow.cxx:192
TGScrollBar::GrabPointer
void GrabPointer(Bool_t grab)
Definition: TGScrollBar.h:101
gClient
#define gClient
Definition: TGClient.h:157
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
TGComboBoxPopup::fSelected
TGLBEntry * fSelected
Definition: TGComboBox.h:25
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:339
kNone
const Handle_t kNone
Definition: GuiTypes.h:88
TGComboBox::~TGComboBox
virtual ~TGComboBox()
Delete a combo box widget.
Definition: TGComboBox.cxx:268
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:755
TGLBContainer
A Composite frame that contains a list of TGLBEnties.
Definition: TGListBox.h:163
TGTextEntry::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle mouse double click event in the text entry widget.
Definition: TGTextEntry.cxx:1415
TGComboBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGComboBox.cxx:427
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGTextEntry::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in text entry widget.
Definition: TGTextEntry.cxx:1344
TGComboBox::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in the combo box.
Definition: TGComboBox.cxx:481
TGWindow::kEditDisableGrab
@ kEditDisableGrab
window grab cannot be edited
Definition: TGWindow.h:52
TGComboBox::fLhb
TGLayoutHints * fLhb
layout hints for fDDButton
Definition: TGComboBox.h:61
TGComboBox::fBpic
const TGPicture * fBpic
down arrow picture used in fDDButton
Definition: TGComboBox.h:59
TGComboBox::Selected
virtual void Selected(Int_t widgetId, Int_t id)
Emit signal, done only when selected entry changed.
Definition: TGComboBox.cxx:633
h
#define h(i)
Definition: RSha256.hxx:106
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
window which handles widget events
Definition: TGWidget.h:48
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
SetWindowAttributes_t::fOverrideRedirect
Bool_t fOverrideRedirect
boolean value for override-redirect
Definition: GuiTypes.h:107
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:72
TGFontTypeComboBox::fFonts
FontStruct_t fFonts[kMaxFonts]
Definition: TGComboBox.h:180
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGObject::fId
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
TGTextEntry
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:645
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGComboBox::DrawBorder
virtual void DrawBorder()
Draw border of combo box widget.
Definition: TGComboBox.cxx:343
TGLayoutManager::Layout
virtual void Layout()=0
kCM_LISTBOX
@ kCM_LISTBOX
Definition: WidgetMessageTypes.h:37
TGComboBox::fListBox
TGListBox * fListBox
the listbox with text items
Definition: TGComboBox.h:58
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
kWidgetIsEnabled
@ kWidgetIsEnabled
Definition: TGWidget.h:37
Long_t
long Long_t
Definition: RtypesCore.h:54
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:26
GCValues_t::fFont
FontH_t fFont
default text font for text operations
Definition: GuiTypes.h:242
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
TGComboBox::Layout
virtual void Layout()
layout combobox
Definition: TGComboBox.cxx:541
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGLBEntry::Update
virtual void Update(TGLBEntry *)
Definition: TGListBox.h:39
TGFrame::SaveUserColor
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2453
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:205
kGCFont
const Mask_t kGCFont
Definition: GuiTypes.h:300
kC_CONTAINER
@ kC_CONTAINER
Definition: WidgetMessageTypes.h:53
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
Window_t
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
TGComboBoxPopup::HandleButton
virtual Bool_t HandleButton(Event_t *)
Handle mouse button event in combo box popup.
Definition: TGComboBox.cxx:91
TGComboBox::GetListBox
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:110
y
Double_t y[n]
Definition: legend1.C:17
kKey_Escape
@ kKey_Escape
Definition: KeySymbols.h:26
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:31
TGTextLBEntry::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
Definition: TGListBox.cxx:215
TGCompositeFrame::MustCleanup
virtual Int_t MustCleanup() const
Definition: TGFrame.h:361
KeySymbols.h
TGComboBox::fTextEntry
TGTextEntry * fTextEntry
text entry
Definition: TGComboBox.h:55
TGCompositeFrame::RemoveFrame
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1149
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:775
TGLBEntry
Basic listbox entries.
Definition: TGListBox.h:24
TGComboBoxPopup::PlacePopup
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Popup combo box popup window at the specified place.
Definition: TGComboBox.cxx:137
TGComboBox::SetTopEntry
virtual void SetTopEntry(TGLBEntry *e, TGLayoutHints *lh)
Set a new combo box value (normally update of text string in fSelEntry is done via fSelEntry::Update(...
Definition: TGComboBox.cxx:438
TGLineStyleComboBox
The TGLineStyleComboBox user callable and it creates a combobox for selecting the line style.
Definition: TGComboBox.h:139
TGListBox::RemoveAll
virtual void RemoveAll()
Remove all entries.
Definition: TGListBox.cxx:1344
TGTextEntry::SetFrameDrawn
virtual void SetFrameDrawn(Bool_t flag=kTRUE)
Sets the text entry to draw itself inside a two-pixel frame if enable is kTRUE, and to draw itself wi...
Definition: TGTextEntry.cxx:552
TGLineWidthComboBox::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a line width combo box widget as a C++ statement(s).
Definition: TGComboBox.cxx:816
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
gFonts
static const char * gFonts[][2]
Definition: TGComboBox.cxx:830
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:314
TGComboBox
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition: TGComboBox.h:47
TGComboBox::EnableTextInput
virtual void EnableTextInput(Bool_t on)
Switch text input or readonly mode of combobox (not perfect yet).
Definition: TGComboBox.cxx:367
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
kKey_Return
@ kKey_Return
Definition: KeySymbols.h:30
TGScrollBarElement::SetState
virtual void SetState(Int_t state)
Change state of scrollbar element (either up or down).
Definition: TGScrollBar.cxx:127
TGComboBox::GetSelected
virtual Int_t GetSelected() const
Definition: TGComboBox.h:114
TGListBox::GetNumberOfEntries
virtual Int_t GetNumberOfEntries() const
Definition: TGListBox.h:263
TGListBox::Select
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:284
TGComboBoxPopup::EndPopup
void EndPopup()
Ungrab pointer and unmap popup window.
Definition: TGComboBox.cxx:113
TGComboBox::Changed
virtual void Changed()
Definition: TGComboBox.h:126
TGComboBox::fLhs
TGLayoutHints * fLhs
layout hints for selected item frame
Definition: TGComboBox.h:60
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:76
kKey_Enter
@ kKey_Enter
Definition: KeySymbols.h:31
TGWidget::fWidgetId
Int_t fWidgetId
the widget id (used for event processing)
Definition: TGWidget.h:46
TGWidget::ClearFlags
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:59
TGClient::GetGC
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
Definition: TGClient.cxx:322
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
TQObject::Connect
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:869
TGListBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGListBox.cxx:1635
TGContainer
Manages a content area.
Definition: TGCanvas.h:31
TGComboBoxPopup::TGComboBoxPopup
TGComboBoxPopup(const TGComboBoxPopup &)=delete
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
TGListBox::GetScrollBar
virtual TGScrollBar * GetScrollBar() const
Definition: TGListBox.h:269
TGLineStyleComboBox::TGLineStyleComboBox
TGLineStyleComboBox(const TGWindow *p=nullptr, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel())
Create a line style combo box.
Definition: TGComboBox.cxx:753
GCValues_t::fMask
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:251
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
TGFrame::MoveResize
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:629
kC_COMMAND
@ kC_COMMAND
Definition: WidgetMessageTypes.h:31
TGLBEntry::EntryId
Int_t EntryId() const
Definition: TGListBox.h:40
TGLineStyleComboBox::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a line style combo box widget as a C++ statement(s).
Definition: TGComboBox.cxx:774
TGTextEntry.h
TGWindow::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:106
kKey_Space
@ kKey_Space
Definition: KeySymbols.h:93
Event_t
Event structure.
Definition: GuiTypes.h:174
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:111
kCM_COMBOBOX
@ kCM_COMBOBOX
Definition: WidgetMessageTypes.h:38
TGComboBox::RemoveEntry
virtual void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
Definition: TGComboBox.cxx:522
TGTextLBEntry
Text string listbox entries.
Definition: TGListBox.h:48
SetWindowAttributes_t::fBorderPixel
ULong_t fBorderPixel
border pixel value
Definition: GuiTypes.h:97
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:709
TGScrollBarElement::IsEnabled
virtual Bool_t IsEnabled() const
Definition: TGScrollBar.h:54
TGFrameElement
Definition: TGLayout.h:105
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:119
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:765
TGString::GetString
const char * GetString() const
Definition: TGString.h:30
TGComboBox::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a combo box widget as a C++ statement(s) on output stream out.
Definition: TGComboBox.cxx:706
TGComboBox::fComboFrame
TGComboBoxPopup * fComboFrame
popup containing a listbox
Definition: TGComboBox.h:57
TIter
Definition: TCollection.h:233
TGComboBoxPopup
A service class of the combobox.
Definition: TGComboBox.h:21
kCT_ITEMCLICK
@ kCT_ITEMCLICK
Definition: WidgetMessageTypes.h:54
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TGWidget::SetFlags
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:58
TGComboBoxPopup::fListBox
TGListBox * fListBox
Definition: TGComboBox.h:24
TGTextEntry::HandleSelectionRequest
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle request to send current clipboard contents to requestor window.
Definition: TGTextEntry.cxx:1498
TGResourcePool.h
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:166
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
TGFrame::fBackground
Pixel_t fBackground
frame background color
Definition: TGFrame.h:95
TGListBox::GetItemVsize
UInt_t GetItemVsize() const
Definition: TGListBox.h:290
TGComboBox::RemoveAll
virtual void RemoveAll()
Remove all entries from combo box.
Definition: TGComboBox.cxx:690
TGWindow::fEditDisabled
UInt_t fEditDisabled
flags used for "guibuilding"
Definition: TGWindow.h:32
kWAOverrideRedirect
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:149
Class
void Class()
Definition: Class.C:29
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGComboBox::fDDButton
TGScrollBarElement * fDDButton
button controlling drop down of popup
Definition: TGComboBox.h:56
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGString
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition: TGString.h:20
TGScrollBar.h
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
TGLineWidthComboBox
The TGLineWidthComboBox user callable and it creates a combobox for selecting the line width.
Definition: TGComboBox.h:157
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:108
TGComboBoxPopup::SetListBox
void SetListBox(TGListBox *lb)
Definition: TGComboBox.h:39
TGWindow::fParent
const TGWindow * fParent
Parent window.
Definition: TGWindow.h:28
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGComboBox::TGComboBox
TGComboBox(const TGComboBox &)=delete
TGComboBox::HandleSelection
virtual Bool_t HandleSelection(Event_t *event)
Handle selection in text entry.
Definition: TGComboBox.cxx:570
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
SetWindowAttributes_t
Attributes that can be used when creating or changing a window.
Definition: GuiTypes.h:93
TGTextLBEntry::GetText
const TGString * GetText() const
Definition: TGListBox.h:79
TGComboBox::ReturnPressed
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
Definition: TGComboBox.cxx:663
TGComboBox::SetEnabled
virtual void SetEnabled(Bool_t on=kTRUE)
Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
Definition: TGComboBox.cxx:646
TGWindow::IsMapped
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition: TGWindow.cxx:295
TGTextEntry::HandleSelection
virtual Bool_t HandleSelection(Event_t *event)
Handle text selection event.
Definition: TGTextEntry.cxx:1478