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 // //
25 // TGComboBox, TGComboBoxPopup //
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. The TGComboBoxPopup is a service //
36 // class of the combobox. //
37 // //
38 // Selecting an item in the combobox will generate the event: //
39 // kC_COMMAND, kCM_COMBOBOX, combobox id, item id. //
40 // //
41 //////////////////////////////////////////////////////////////////////////
42 
43 #include "TGComboBox.h"
44 #include "TGScrollBar.h"
45 #include "TGResourcePool.h"
46 #include "TGTextEntry.h"
47 #include "KeySymbols.h"
48 #include "TVirtualX.h"
49 #include "RConfigure.h"
50 
51 #include <iostream>
52 
53 
56 
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Create a combo box popup frame.
63 
65  UInt_t options, ULong_t back) :
66  TGCompositeFrame (p, w, h, options, back), fListBox(0), fSelected(0)
67 {
69 
72  wattr.fOverrideRedirect = kTRUE;
73  wattr.fSaveUnder = kTRUE;
74  wattr.fBorderPixel = fgBlackPixel;
75  wattr.fBorderWidth = 1;
76  gVirtualX->ChangeWindowAttributes(fId, &wattr);
77 
80  SetWindowName();
81 }
82 
83 ////////////////////////////////////////////////////////////////////////////////
84 /// Handle mouse button event in combo box popup.
85 
87 {
88  if (event->fType == kButtonPress && event->fCode == kButton1) {
89  if ((fListBox != 0) && (fSelected != 0) &&
91  // in the case the combo box popup is closed by clicking outside the
92  // list box, then select the previously selected entry
94  }
95  EndPopup();
96  }
97  else {
98  // reset the dragging flag of the scrollbar when the button is
99  // released outside the scrollbar itself
101  }
102  return kTRUE;
103 }
104 
105 ////////////////////////////////////////////////////////////////////////////////
106 /// Ungrab pointer and unmap popup window.
107 
109 {
110  if (IsMapped()) {
111  Handle_t id = fListBox->GetContainer()->GetId();
112  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Up),
114  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Down),
116  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Enter),
118  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Return),
120  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Escape),
122  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Space),
124  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
125  UnmapWindow();
126  }
127 }
128 
129 ////////////////////////////////////////////////////////////////////////////////
130 /// Popup combo box popup window at the specified place.
131 
133 {
134  Int_t rx, ry;
135  UInt_t rw, rh;
136 
137  // Parent is root window for the popup:
138  gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
139 
140  if (gVirtualX->InheritsFrom("TGWin32")) {
141  if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
142  x = rw - abs(rx) - fWidth;
143  if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
144  y = rh - fHeight;
145  } else {
146  if (x < 0) x = 0;
147  if (x + fWidth > rw) x = rw - fWidth;
148  if (y < 0) y = 0;
149  if (y + fHeight > rh) y = rh - fHeight;
150  }
151 
152  // remember the current selected entry
153  if (fListBox == 0) {
154  // the listbox should be the first in the list
156  fListBox = dynamic_cast<TGListBox *>(el->fFrame);
157  }
159 
160  MoveResize(x, y, w, h);
161  MapSubwindows();
162  Layout();
163  MapRaised();
164 
165  Handle_t id = fListBox->GetContainer()->GetId();
166  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Up),
168  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Down),
170  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Enter),
172  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Return),
174  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Escape),
176  gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Space),
179 
183 
184  if (fClient->IsEditable()) {
185  fClient->RegisterPopup(this);
186  }
187 
188  fClient->WaitForUnmap(this);
189  EndPopup();
190 }
191 
192 ////////////////////////////////////////////////////////////////////////////////
193 /// Slot handling the key press events.
194 
196 {
197  switch ((EKeySym)keysym) {
198  case kKey_Enter:
199  case kKey_Return:
200  case kKey_Space:
201  if (fListBox && f) {
202  TGLBEntry *entry = dynamic_cast<TGLBEntry *>(f);
203  if (entry) {
204  fListBox->Select(entry->EntryId());
206  entry->EntryId(), 0);
207  }
208  }
209  EndPopup();
210  break;
211  case kKey_Escape:
212  if (fListBox)
213  ((TGContainer *)fListBox->GetContainer())->UnSelectAll();
214  EndPopup();
215  break;
216  default:
217  break;
218  }
219 }
220 
221 ////////////////////////////////////////////////////////////////////////////////
222 /// Create a combo box widget.
223 
225  ULong_t back) :
226  TGCompositeFrame (p, 10, 10, options | kOwnBackground, back)
227 {
228  fWidgetId = id;
229  fMsgWindow = p;
230  fTextEntry = 0;
231 
232  fSelEntry = new TGTextLBEntry(this, new TGString(""), 0);
234 
237  Init();
238 }
239 
240 ////////////////////////////////////////////////////////////////////////////////
241 /// Create an editable combo box widget.
242 
243 TGComboBox::TGComboBox(const TGWindow *p, const char *text, Int_t id,
244  UInt_t options, ULong_t back) :
245  TGCompositeFrame (p, 10, 10, options | kOwnBackground, back)
246 {
247  fWidgetId = id;
248  fMsgWindow = p;
249  fSelEntry = 0;
250 
251  fTextEntry = new TGTextEntry(this, text, id);
253  fTextEntry->Connect("ReturnPressed()", "TGComboBox", this, "ReturnPressed()");
254 
257  Init();
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 /// Delete a combo box widget.
262 
264 {
266 
267  if (!MustCleanup()) {
271  SafeDelete(fLhs);
272  SafeDelete(fLhb);
273  }
274 
275  SafeDelete(fLhdd);
277  if (fComboFrame) {
278  fComboFrame->EndPopup(); // force popdown in case of Qt interface
280  }
281 }
282 
283 ////////////////////////////////////////////////////////////////////////////////
284 /// Initiate the internal classes of a combo box.
285 
287 {
288  fBpic = fClient->GetPicture("arrow_down.xpm");
289 
290  if (!fBpic)
291  Error("TGComboBox", "arrow_down.xpm not found");
292 
295 
297  kLHintsExpandY));
298 
300 
302 
303  fListBox->Resize(100, 100);
304  fListBox->Associate(this);
305  fListBox->GetScrollBar()->GrabPointer(kFALSE); // combobox will do a pointergrab
306 
308  kLHintsExpandY));
312 
315 
316  fListBox->GetContainer()->Connect("KeyPressed(TGFrame*, UInt_t, UInt_t)",
317  "TGComboBoxPopup", fComboFrame,
318  "KeyPressed(TGFrame*, UInt_t, UInt_t)");
319  // Drop down listbox of combo box should react to pointer motion
320  // so it will be able to Activate() (i.e. highlight) the different
321  // items when the mouse crosses.
324 
331 
332  SetWindowName();
333 }
334 
335 ////////////////////////////////////////////////////////////////////////////////
336 /// Draw border of combo box widget.
337 
339 {
342  gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
343  gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
344  gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, fWidth-3, 1);
345  gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, 1, fHeight-3);
346  if (gClient->GetStyle() > 1) break;
347  gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
348  gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
349  gVirtualX->DrawLine(fId, GetBckgndGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
350  gVirtualX->DrawLine(fId, GetBckgndGC()(), fWidth-2, 1, fWidth-2, fHeight-2);
351  break;
352 
353  default:
355  break;
356  }
357 }
358 
359 ////////////////////////////////////////////////////////////////////////////////
360 /// Switch text input or readonly mode of combobox (not perfect yet).
361 
363 {
364  // UInt_t w, h;
365  TString text = "";
366  Pixel_t back = TGFrame::GetWhitePixel(); // default
367 
368  if (on) {
369  if (fSelEntry) {
370  back = fSelEntry->GetBackground();
371  text = ((TGTextLBEntry*)fSelEntry)->GetText()->GetString();
373  fTextEntry->SetText(text.Data());
374  }
376  //w = fSelEntry->GetWidth();
377  //h = fSelEntry->GetHeight();
379  delete fSelEntry;
380  fSelEntry = 0;
381  }
382  if (!fTextEntry) {
383  fTextEntry = new TGTextEntry(this, text.Data(), 0);
385  fTextEntry->Connect("ReturnPressed()", "TGComboBox", this, "ReturnPressed()");
388  }
390  MapSubwindows();
391  // coverity[returned_null]
392  // coverity[dereference]
394  } else {
395  if (fTextEntry) {
396  back = fTextEntry->GetBackground();
397  text = fTextEntry->GetText();
400  //w = fTextEntry->GetWidth();
401  //h = fTextEntry->GetHeight();
402  delete fTextEntry;
403  fTextEntry = 0;
404  }
405  if (!fSelEntry) {
406  fSelEntry = new TGTextLBEntry(this, new TGString(text.Data()), 0);
410  }
412  MapSubwindows();
413  // coverity[returned_null]
414  // coverity[dereference]
416  }
417 }
418 
419 ////////////////////////////////////////////////////////////////////////////////
420 /// Find entry by name.
421 
422 TGLBEntry *TGComboBox::FindEntry(const char *s) const
423 {
424  TGLBEntry *sel = 0;
425  sel = fListBox->FindEntry(s);
426  return sel;
427 }
428 
429 ////////////////////////////////////////////////////////////////////////////////
430 /// Set a new combo box value (normally update of text string in
431 /// fSelEntry is done via fSelEntry::Update()).
432 
434 {
435  if (!fSelEntry) return;
436 
439  delete fSelEntry;
440  delete fLhs;
441  fSelEntry = e;
442  fLhs = lh;
444  Layout();
445 }
446 
447 ////////////////////////////////////////////////////////////////////////////////
448 /// Make the selected item visible in the combo box window
449 /// and emit signals according to the second parameter.
450 
452 {
453  if (id!=GetSelected()) {
454  TGLBEntry *e;
455  e = fListBox->Select(id);
456  if (e) {
457  if (fSelEntry) {
458  fSelEntry->Update(e);
459  Layout();
460  } else if (fTextEntry && e->InheritsFrom(TGTextLBEntry::Class())) {
461  TGTextLBEntry *te = (TGTextLBEntry*)e;
462  fTextEntry->SetText(te->GetText()->GetString());
463  }
464  if (emit) {
465  Selected(fWidgetId, id);
466  Selected(id);
467  }
468  }
469  }
470 }
471 
472 ////////////////////////////////////////////////////////////////////////////////
473 /// Handle mouse button events in the combo box.
474 
476 {
477  if (!fDDButton || !fDDButton->IsEnabled()) return kFALSE;
478 
479  if (event->fType == kButtonPress) {
480  Window_t child = (Window_t)event->fUser[0]; // fUser[0] = child window
481 
482  if (child == fDDButton->GetId() || (fSelEntry && child == fSelEntry->GetId())) {
484 
485  if (fTextEntry && (child == fTextEntry->GetId())) {
486  return fTextEntry->HandleButton(event);
487  }
488  int ax, ay;
489  Window_t wdummy;
490  gVirtualX->TranslateCoordinates(fId, fComboFrame->GetParent()->GetId(),
491  0, fHeight, ax, ay, wdummy);
492  // Drop down listbox of combo box should react to pointer motion...
494 #ifdef R__HAS_COCOA
495  gVirtualX->SetWMTransientHint(fComboFrame->GetId(), GetId());
496 #endif
499 #ifdef R__HAS_COCOA
500  //tp: I need this modification - "button" is not repainted correctly
501  //with Cocoa, when combobox is closed (reason is quite complex), happens
502  //when item is wider than combobox.
503  //TODO: find another way :)
505 #endif
506  } else if (fTextEntry) {
507  return fTextEntry->HandleButton(event);
508  }
509  }
510  return kTRUE;
511 }
512 
513 ////////////////////////////////////////////////////////////////////////////////
514 /// Remove entry. If id == -1, the currently selected entry is removed
515 
517 {
518  fListBox->RemoveEntry(id);
519 
520  if (id < 0) {
521  if (fSelEntry) {
522  ((TGTextLBEntry*)fSelEntry)->SetTitle("");
524  } else {
525  fTextEntry->SetTitle("");
527  }
528  }
529  Resize();
530 }
531 
532 ////////////////////////////////////////////////////////////////////////////////
533 /// layout combobox
534 
536 {
539 
540  if (h && (h < 100)) {
542  }
543 }
544 
545 ////////////////////////////////////////////////////////////////////////////////
546 /// Handle double click in text entry.
547 
549 {
550  return fTextEntry ? fTextEntry->HandleDoubleClick(event) : kTRUE;
551 }
552 
553 ////////////////////////////////////////////////////////////////////////////////
554 /// Handle pointer motion in text entry.
555 
557 {
558  return fTextEntry ? fTextEntry->HandleMotion(event) : kTRUE;
559 }
560 
561 ////////////////////////////////////////////////////////////////////////////////
562 /// Handle selection in text entry.
563 
565 {
566  return fTextEntry ? fTextEntry->HandleSelection(event) : kTRUE;
567 }
568 
569 ////////////////////////////////////////////////////////////////////////////////
570 /// Handle selection request in text entry.
571 
573 {
575 }
576 
577 ////////////////////////////////////////////////////////////////////////////////
578 /// Process messages generated by the listbox and forward
579 /// messages to the combobox message handling window. Parm2 contains
580 /// the id of the selected listbox entry.
581 
583 {
584  TGLBEntry *e;
585 
586  switch (GET_MSG(msg)) {
587  case kC_COMMAND:
588  switch (GET_SUBMSG(msg)) {
589  case kCM_LISTBOX:
591  if (fSelEntry) {
592  fSelEntry->Update(e);
593  } else if (fTextEntry &&
594  e->InheritsFrom(TGTextLBEntry::Class())) {
595  TGTextLBEntry *te = (TGTextLBEntry*)e;
596  fTextEntry->SetText(te->GetText()->GetString());
597  }
598  // coverity[returned_null]
599  // coverity[dereference]
604  fWidgetId, parm2);
605  if (e->InheritsFrom(TGTextLBEntry::Class())) {
606  const char *text;
607  text = ((TGTextLBEntry*)e)->GetText()->GetString();
608  Selected(text);
609  }
610  Selected(fWidgetId, (Int_t)parm2);
611  Selected((Int_t)parm2);
612  fClient->NeedRedraw(this);
613  break;
614  }
615  break;
616 
617  default:
618  break;
619  }
620  return kTRUE;
621 }
622 
623 ////////////////////////////////////////////////////////////////////////////////
624 /// Emit signal.
625 
626 void TGComboBox::Selected(Int_t widgetId, Int_t id)
627 {
628  Long_t args[2];
629 
630  args[0] = widgetId;
631  args[1] = id;
632 
633  Emit("Selected(Int_t,Int_t)", args);
634 }
635 
636 ////////////////////////////////////////////////////////////////////////////////
637 /// Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
638 
640 {
641  fDDButton->SetEnabled(on);
642  if (on) {
645  } else {
648  }
650 }
651 
652 ////////////////////////////////////////////////////////////////////////////////
653 /// Add new entry to combo box when return key pressed inside text entry
654 /// ReturnPressed signal is emitted.
655 
657 {
658  if (!fTextEntry) return;
659 
662 
663  TIter next(lbc->GetList());
664  TGFrameElement *el;
665 
666  Emit("ReturnPressed()");
667 
668  while ((el = (TGFrameElement *)next())) {
669  TGTextLBEntry *lbe = (TGTextLBEntry *)el->fFrame;
670  if (lbe->GetText()->GetString() == text) {
671  return;
672  }
673  }
674 
675  Int_t nn = GetNumberOfEntries() + 1;
676  AddEntry(text.Data(), nn);
677  Select(nn);
678 }
679 
680 ////////////////////////////////////////////////////////////////////////////////
681 /// Remove all entries from combo box.
682 
684 {
685  fListBox->RemoveAll();
686 
687  if (fSelEntry) {
688  ((TGTextLBEntry*)fSelEntry)->SetTitle("");
690  } else {
691  fTextEntry->SetTitle("");
693  }
694 }
695 
696 ////////////////////////////////////////////////////////////////////////////////
697 /// Save a combo box widget as a C++ statement(s) on output stream out.
698 
699 void TGComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
700 {
701  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
702 
703  out << std::endl << " // combo box" << std::endl;
704  out << " TGComboBox *";
705 
706  if (!fTextEntry) {
707  out << GetName() << " = new TGComboBox(" << fParent->GetName() << "," << fWidgetId;
708  } else {
709  out << GetName() << " = new TGComboBox(" << fParent->GetName() << ",";
710  out << '\"' << fTextEntry->GetText() << '\"' << "," <<fWidgetId;
711  }
712 
713  if (fBackground == GetWhitePixel()) {
715  out <<");" << std::endl;
716  } else {
717  out << "," << GetOptionString() << ");" << std::endl;
718  }
719  } else {
720  out << "," << GetOptionString() << ",ucolor);" << std::endl;
721  }
722  if (option && strstr(option, "keep_names"))
723  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
724 
725  TGTextLBEntry *b;
726  TGFrameElement *el;
727  TGListBox *lb = GetListBox();
728 
729  TIter next(((TGLBContainer *)lb->GetContainer())->GetList());
730 
731  while ((el = (TGFrameElement *) next())) {
732  b = (TGTextLBEntry *) el->fFrame;
733  out << " " << GetName() << "->AddEntry(";
734  b->SavePrimitive(out, option);
735  out << ");" << std::endl;
736  }
737 
738  out << " " << GetName() << "->Resize(" << GetWidth() << ","
739  << GetHeight() << ");" << std::endl;
740  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
741 }
742 
743 ////////////////////////////////////////////////////////////////////////////////
744 /// Create a line style combo box.
745 
747  UInt_t options, Pixel_t back)
748  : TGComboBox(p, id, options, back)
749 {
750  SetTopEntry(new TGLineLBEntry(this, 0),
753 
754  for (Int_t i = 1; i <= 10; i++)
755  AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), i,
756  TString::Format("%d",i), 0, i),
758 
759  Select(1, kFALSE); // to have first entry selected
760 
761  SetWindowName();
762 }
763 
764 ////////////////////////////////////////////////////////////////////////////////
765 /// Save a line style combo box widget as a C++ statement(s).
766 
767 void TGLineStyleComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
768 {
769  out << std::endl << " // line style combo box" << std::endl;
770  out << " TGLineStyleComboBox *";
771 
772  out << GetName() << " = new TGLineStyleComboBox(" << fParent->GetName()
773  << "," << fWidgetId << ");" << std::endl;
774  if (option && strstr(option, "keep_names"))
775  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
776  out << " " << GetName() << "->Resize(" << GetWidth() << ","
777  << GetHeight() << ");" << std::endl;
778  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
779 }
780 
781 ////////////////////////////////////////////////////////////////////////////////
782 /// Create a line width combo box.
783 /// If "none" is equal to kTRUE the first entry is "None".
784 
786  UInt_t options, Pixel_t back, Bool_t none)
787  : TGComboBox(p, id, options, back)
788 {
789  SetTopEntry(new TGLineLBEntry(this,0),
792 
793  if (none) {
794  AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), 0, "None", 0, 0),
796  }
797 
798  for (Int_t i = 0; i < 16; i++)
799  AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), i,
800  TString::Format("%d",i), i, 0),
802  Select(1, kFALSE); // to have first entry selected
803  SetWindowName();
804 }
805 
806 ////////////////////////////////////////////////////////////////////////////////
807 /// Save a line width combo box widget as a C++ statement(s).
808 
809 void TGLineWidthComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
810 {
811  out << std::endl << " // line width combo box" << std::endl;
812  out << " TGLineWidthComboBox *";
813 
814  out << GetName() << " = new TGLineWidthComboBox(" << fParent->GetName()
815  << "," << fWidgetId << ");" << std::endl;
816  if (option && strstr(option, "keep_names"))
817  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
818  out << " " << GetName() << "->Resize(" << GetWidth() << ","
819  << GetHeight() << ");" << std::endl;
820  out << " " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
821 }
822 
823 static const char *gFonts[][2] = { // unix name, name
824  { "", "" }, //not used
825  { "-*-times-medium-i-*-*-12-*-*-*-*-*-*-*", "1. times italic" },
826  { "-*-times-bold-r-*-*-12-*-*-*-*-*-*-*", "2. times bold" },
827  { "-*-times-bold-i-*-*-12-*-*-*-*-*-*-*", "3. times bold italic" },
828  { "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*", "4. helvetica" },
829  { "-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*", "5. helvetica italic" },
830  { "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*", "6. helvetica bold" },
831  { "-*-helvetica-bold-o-*-*-12-*-*-*-*-*-*-*", "7. helvetica bold italic" },
832  { "-*-courier-medium-r-*-*-12-*-*-*-*-*-*-*", "8. courier" },
833  { "-*-courier-medium-o-*-*-12-*-*-*-*-*-*-*", "9. courier italic" },
834  { "-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*", "10. courier bold" },
835  { "-*-courier-bold-o-*-*-12-*-*-*-*-*-*-*", "11. courier bold italic" },
836  { "-*-symbol-medium-r-*-*-12-*-*-*-*-*-*-*", "12. symbol" },
837  { "-*-times-medium-r-*-*-12-*-*-*-*-*-*-*", "13. times" },
838  { 0, 0}
839 };
840 
841 ////////////////////////////////////////////////////////////////////////////////
842 /// Create a text font combo box.
843 
845  UInt_t options, Pixel_t back) :
846  TGComboBox(p, id, options, back)
847 {
848  Int_t noFonts = 0;
849 
850  for (Int_t i = 1; gFonts[i][0] != 0 && noFonts < kMaxFonts; i++) {
851 
852  fFonts[noFonts] = gVirtualX->LoadQueryFont(gFonts[i][0]);
853 
854  if (fFonts[noFonts] == 0)
856 
857  GCValues_t gval;
858  gval.fMask = kGCFont;
859  gval.fFont = gVirtualX->GetFontHandle(fFonts[noFonts]);
860 
861  AddEntry(new TGTextLBEntry(GetListBox()->GetContainer(),
862  new TGString(gFonts[i][1]), i,
863  fClient->GetGC(&gval, kTRUE)->GetGC(), fFonts[noFonts]),
865  noFonts++;
866  }
867 
868  if (noFonts < kMaxFonts - 1)
869  fFonts[noFonts] = 0;
870 
871  Select(1, kFALSE); // to have first entry selected
872  SetWindowName();
873 }
874 
875 ////////////////////////////////////////////////////////////////////////////////
876 /// Text font combo box dtor.
877 
879 {
880  for (int i = 0; i < kMaxFonts && fFonts[i] != 0; i++) {
881  if (fFonts[i] != TGTextLBEntry::GetDefaultFontStruct()) gVirtualX->DeleteFont(fFonts[i]);
882  }
883 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:118
kMaxFonts
const Int_t kMaxFonts
Definition: TGComboBox.h:204
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:353
TGComboBoxPopup::TGComboBoxPopup
TGComboBoxPopup(const TGComboBoxPopup &)
TGListBox::RemoveEntry
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
Definition: TGListBox.cxx:1327
Event_t::fType
EGEventType fType
Definition: GuiTypes.h:174
kWABorderPixel
const Mask_t kWABorderPixel
Definition: GuiTypes.h:141
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
TGListBox
Definition: TGListBox.h:288
TGClient::RegisterPopup
void RegisterPopup(TGWindow *w)
Add a popup menu to the list of popups.
Definition: TGClient.cxx:533
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:112
SetWindowAttributes_t::fSaveUnder
Bool_t fSaveUnder
Definition: GuiTypes.h:103
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:250
kWABorderWidth
const Mask_t kWABorderWidth
Definition: GuiTypes.h:142
TGWindow
Definition: TGWindow.h:31
TGScrollBarElement::SetEnabled
virtual void SetEnabled(Bool_t on=kTRUE)
Enable/Disable scroll bar button chaging the state.
Definition: TGScrollBar.cxx:141
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
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:623
TGComboBox::GetNumberOfEntries
virtual Int_t GetNumberOfEntries() const
Definition: TGComboBox.h:127
e
#define e(i)
Definition: RSha256.hxx:103
TGComboBox::Init
virtual void Init()
Initiate the internal classes of a combo box.
Definition: TGComboBox.cxx:286
TGFontTypeComboBox
Definition: TGComboBox.h:206
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:347
TGComboBox::HandleSelectionRequest
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle selection request in text entry.
Definition: TGComboBox.cxx:572
TGFrame::fgBlackPixel
static Pixel_t fgBlackPixel
Definition: TGFrame.h:129
TGFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:306
TGCompositeFrame::GetLayoutManager
virtual TGLayoutManager * GetLayoutManager() const
Definition: TGFrame.h:375
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:50
kAnyModifier
const Mask_t kAnyModifier
Definition: GuiTypes.h:209
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:297
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGFontTypeComboBox::~TGFontTypeComboBox
virtual ~TGFontTypeComboBox()
Text font combo box dtor.
Definition: TGComboBox.cxx:878
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:582
TGLineLBEntry
Definition: TGListBox.h:141
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
TGWindow::RequestFocus
virtual void RequestFocus()
request focus
Definition: TGWindow.cxx:213
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGScrollBar::SetDragging
virtual void SetDragging(Bool_t drag)
Definition: TGScrollBar.h:129
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
kKey_Up
@ kKey_Up
Definition: KeySymbols.h:41
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:34
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
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:106
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:844
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:112
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:31
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGWindow::kEditDisableLayout
@ kEditDisableLayout
Definition: TGWindow.h:61
TGComboBox::fSelEntry
TGLBEntry * fSelEntry
Definition: TGComboBox.h:74
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
SetWindowAttributes_t::fBorderWidth
UInt_t fBorderWidth
Definition: GuiTypes.h:97
TGScrollBarElement
Definition: TGScrollBar.h:48
GCValues_t
Definition: GuiTypes.h:223
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TGWindow::kEditDisable
@ kEditDisable
Definition: TGWindow.h:58
TGFrame::fOptions
UInt_t fOptions
Definition: TGFrame.h:119
TGComboBoxPopup::KeyPressed
void KeyPressed(TGFrame *, UInt_t, UInt_t)
Slot handling the key press events.
Definition: TGComboBox.cxx:195
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TGClient::IsEditable
Bool_t IsEditable() const
Definition: TGClient.h:98
TGComboBox::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle pointer motion in text entry.
Definition: TGComboBox.cxx:556
TGComboBox::fLhdd
TGLayoutHints * fLhdd
Definition: TGComboBox.h:82
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:543
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:451
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1007
x
Double_t x[n]
Definition: legend1.C:17
TGListBox::GetSelectedEntry
virtual TGLBEntry * GetSelectedEntry() const
Definition: TGListBox.h:355
TGWindow::kEditDisableHeight
@ kEditDisableHeight
Definition: TGWindow.h:63
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:785
TGClient::WaitForUnmap
void WaitForUnmap(TGWindow *w)
Wait for window to be unmapped.
Definition: TGClient.cxx:737
kButton1
@ kButton1
Definition: GuiTypes.h:213
TGResourcePool::GetGrabCursor
Cursor_t GetGrabCursor() const
Definition: TGResourcePool.h:170
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
TVirtualX.h
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:309
TGFrame::GetBackground
virtual Pixel_t GetBackground() const
Definition: TGFrame.h:217
TGListBox::GetContainer
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:334
TGClient::GetResourcePool
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
TGComboBox::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click in text entry.
Definition: TGComboBox.cxx:548
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:2311
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:720
TString
Basic string class.
Definition: TString.h:136
TGFrame::DrawBorder
virtual void DrawBorder()
Draw frame border.
Definition: TGFrame.cxx:406
TGFrame
Definition: TGFrame.h:105
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
TGTextEntry::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in the text entry widget.
Definition: TGTextEntry.cxx:1408
SetWindowAttributes_t::fMask
Mask_t fMask
Definition: GuiTypes.h:109
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
TGTextEntry::SetTitle
virtual void SetTitle(const char *label)
Definition: TGTextEntry.h:170
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:69
TGWindow::kEditDisableEvents
@ kEditDisableEvents
Definition: TGWindow.h:59
bool
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:249
TGCompositeFrame::fList
TList * fList
Definition: TGFrame.h:329
id
XFontStruct * id
Definition: TGX11.cxx:109
kWASaveUnder
const Mask_t kWASaveUnder
Definition: GuiTypes.h:149
TGWindow::kEditDisableBtnEnable
@ kEditDisableBtnEnable
Definition: TGWindow.h:65
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:119
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2465
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
TGWindow::DestroyWindow
virtual void DestroyWindow()
destroy window
Definition: TGWindow.cxx:173
TGScrollBar::GrabPointer
void GrabPointer(Bool_t grab)
Definition: TGScrollBar.h:120
gClient
#define gClient
Definition: TGClient.h:166
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
TGComboBoxPopup::fSelected
TGLBEntry * fSelected
Definition: TGComboBox.h:45
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:324
kNone
const Handle_t kNone
Definition: GuiTypes.h:87
TGComboBox::~TGComboBox
virtual ~TGComboBox()
Delete a combo box widget.
Definition: TGComboBox.cxx:263
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:740
TGLBContainer
Definition: TGListBox.h:222
TGTextEntry::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle mouse double click event in the text entry widget.
Definition: TGTextEntry.cxx:1427
TGComboBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGComboBox.cxx:422
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:1356
TGComboBox::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in the combo box.
Definition: TGComboBox.cxx:475
TGWindow::kEditDisableGrab
@ kEditDisableGrab
Definition: TGWindow.h:60
TGComboBox::fLhb
TGLayoutHints * fLhb
Definition: TGComboBox.h:81
TGComboBox::fBpic
const TGPicture * fBpic
Definition: TGComboBox.h:79
TGComboBox::Selected
virtual void Selected(Int_t widgetId, Int_t id)
Emit signal.
Definition: TGComboBox.cxx:626
h
#define h(i)
Definition: RSha256.hxx:106
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGWidget.h:60
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
SetWindowAttributes_t::fOverrideRedirect
Bool_t fOverrideRedirect
Definition: GuiTypes.h:106
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
TGFontTypeComboBox::fFonts
FontStruct_t fFonts[kMaxFonts]
Definition: TGComboBox.h:209
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
TGTextEntry
Definition: TGTextEntry.h:39
Event_t::fCode
UInt_t fCode
Definition: GuiTypes.h:179
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:630
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGComboBox::DrawBorder
virtual void DrawBorder()
Draw border of combo box widget.
Definition: TGComboBox.cxx:338
TGLayoutManager::Layout
virtual void Layout()=0
kCM_LISTBOX
@ kCM_LISTBOX
Definition: WidgetMessageTypes.h:39
TGComboBox::fListBox
TGListBox * fListBox
Definition: TGComboBox.h:78
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:59
kWidgetIsEnabled
@ kWidgetIsEnabled
Definition: TGWidget.h:48
Long_t
long Long_t
Definition: RtypesCore.h:54
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:33
GCValues_t::fFont
FontH_t fFont
Definition: GuiTypes.h:241
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
TGComboBox::Layout
virtual void Layout()
layout combobox
Definition: TGComboBox.cxx:535
TGLayoutHints
Definition: TGLayout.h:57
TGLBEntry::Update
virtual void Update(TGLBEntry *)
Definition: TGListBox.h:66
TGFrame::SaveUserColor
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2438
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
kGCFont
const Mask_t kGCFont
Definition: GuiTypes.h:299
kC_CONTAINER
@ kC_CONTAINER
Definition: WidgetMessageTypes.h:55
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:290
Window_t
Handle_t Window_t
Definition: GuiTypes.h:28
TGComboBoxPopup::HandleButton
virtual Bool_t HandleButton(Event_t *)
Handle mouse button event in combo box popup.
Definition: TGComboBox.cxx:86
TGComboBox::GetListBox
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
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:38
TGTextLBEntry::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
Definition: TGListBox.cxx:190
TGCompositeFrame::MustCleanup
virtual Int_t MustCleanup() const
Definition: TGFrame.h:398
KeySymbols.h
TGComboBox::fTextEntry
TGTextEntry * fTextEntry
Definition: TGComboBox.h:75
TGCompositeFrame::RemoveFrame
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1134
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:760
TGLBEntry
Definition: TGListBox.h:51
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:132
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:433
TGLineStyleComboBox
Definition: TGComboBox.h:160
TGListBox::RemoveAll
virtual void RemoveAll()
Remove all entries.
Definition: TGListBox.cxx:1353
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:564
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:809
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
gFonts
static const char * gFonts[][2]
Definition: TGComboBox.cxx:823
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
TGComboBox
Definition: TGComboBox.h:67
TGComboBox::EnableTextInput
virtual void EnableTextInput(Bool_t on)
Switch text input or readonly mode of combobox (not perfect yet).
Definition: TGComboBox.cxx:362
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:119
TGComboBox::GetSelected
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
TGListBox::GetNumberOfEntries
virtual Int_t GetNumberOfEntries() const
Definition: TGListBox.h:330
TGListBox::Select
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:351
TGComboBoxPopup::EndPopup
void EndPopup()
Ungrab pointer and unmap popup window.
Definition: TGComboBox.cxx:108
TGComboBox::fLhs
TGLayoutHints * fLhs
Definition: TGComboBox.h:80
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:84
kKey_Enter
@ kKey_Enter
Definition: KeySymbols.h:31
TGWidget::fWidgetId
Int_t fWidgetId
Definition: TGWidget.h:58
TGWidget::ClearFlags
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:71
TGClient::GetGC
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
Definition: TGClient.cxx:321
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
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:864
TGListBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGListBox.cxx:1644
TGContainer
Definition: TGCanvas.h:41
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
TGListBox::GetScrollBar
virtual TGScrollBar * GetScrollBar() const
Definition: TGListBox.h:336
GCValues_t::fMask
Mask_t fMask
Definition: GuiTypes.h:250
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
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:614
kC_COMMAND
@ kC_COMMAND
Definition: WidgetMessageTypes.h:33
TGLBEntry::EntryId
Int_t EntryId() const
Definition: TGListBox.h:67
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:767
Handle_t
ULong_t Handle_t
Definition: GuiTypes.h:25
TGTextEntry.h
TGWindow::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:114
kKey_Space
@ kKey_Space
Definition: KeySymbols.h:93
Event_t
Definition: GuiTypes.h:173
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:113
kCM_COMBOBOX
@ kCM_COMBOBOX
Definition: WidgetMessageTypes.h:40
TGComboBox::RemoveEntry
virtual void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
Definition: TGComboBox.cxx:516
TGTextLBEntry
Definition: TGListBox.h:83
SetWindowAttributes_t::fBorderPixel
ULong_t fBorderPixel
Definition: GuiTypes.h:96
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:694
TGScrollBarElement::IsEnabled
virtual Bool_t IsEnabled() const
Definition: TGScrollBar.h:73
TGFrameElement
Definition: TGLayout.h:112
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:134
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:750
TGString::GetString
const char * GetString() const
Definition: TGString.h:40
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:699
TGComboBox::fComboFrame
TGComboBoxPopup * fComboFrame
Definition: TGComboBox.h:77
TIter
Definition: TCollection.h:233
TGComboBoxPopup
Definition: TGComboBox.h:41
kCT_ITEMCLICK
@ kCT_ITEMCLICK
Definition: WidgetMessageTypes.h:56
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:37
TGWidget::SetFlags
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:70
TGComboBoxPopup::fListBox
TGListBox * fListBox
Definition: TGComboBox.h:44
TGTextEntry::HandleSelectionRequest
virtual Bool_t HandleSelectionRequest(Event_t *event)
Handle request to send current clipboard contents to requestor window.
Definition: TGTextEntry.cxx:1510
TGResourcePool.h
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
kDefaultScrollBarWidth
@ kDefaultScrollBarWidth
Definition: GuiTypes.h:85
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:113
TGFrame::fBackground
Pixel_t fBackground
Definition: TGFrame.h:120
TGListBox::GetItemVsize
UInt_t GetItemVsize() const
Definition: TGListBox.h:357
TGComboBox::RemoveAll
virtual void RemoveAll()
Remove all entries from combo box.
Definition: TGComboBox.cxx:683
TGWindow::fEditDisabled
UInt_t fEditDisabled
Definition: TGWindow.h:40
kWAOverrideRedirect
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:148
Class
void Class()
Definition: Class.C:29
TGCompositeFrame
Definition: TGFrame.h:324
TGLineStyleComboBox::TGLineStyleComboBox
TGLineStyleComboBox(const TGWindow *p=0, Int_t id=-1, UInt_t options=kHorizontalFrame|kSunkenFrame|kDoubleBorder, Pixel_t back=GetWhitePixel())
Create a line style combo box.
Definition: TGComboBox.cxx:746
TGComboBox::fDDButton
TGScrollBarElement * fDDButton
Definition: TGComboBox.h:76
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
Event_t::fUser
Long_t fUser[5]
Definition: GuiTypes.h:186
TGComboBox::TGComboBox
TGComboBox(const TGComboBox &)
TGString
Definition: TGString.h:30
TGScrollBar.h
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1242
TGLineWidthComboBox
Definition: TGComboBox.h:182
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:110
TGComboBoxPopup::SetListBox
void SetListBox(TGListBox *lb)
Definition: TGComboBox.h:59
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGComboBox::HandleSelection
virtual Bool_t HandleSelection(Event_t *event)
Handle selection in text entry.
Definition: TGComboBox.cxx:564
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
SetWindowAttributes_t
Definition: GuiTypes.h:92
TGTextLBEntry::GetText
const TGString * GetText() const
Definition: TGListBox.h:114
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:656
TGComboBox::SetEnabled
virtual void SetEnabled(Bool_t on=kTRUE)
Set state of combo box. If kTRUE=enabled, kFALSE=disabled.
Definition: TGComboBox.cxx:639
TGWindow::IsMapped
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition: TGWindow.cxx:276
TGTextEntry::HandleSelection
virtual Bool_t HandleSelection(Event_t *event)
Handle text selection event.
Definition: TGTextEntry.cxx:1490