// @(#)root/gui:$Id$
// Author: Fons Rademakers   13/01/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
/**************************************************************************

    This source is based on Xclass95, a Win95-looking GUI toolkit.
    Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.

    Xclass95 is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

**************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGComboBox, TGComboBoxPopup                                          //
//                                                                      //
// A combobox (also known as a drop down listbox) allows the selection  //
// of one item out of a list of items. The selected item is visible in  //
// a little window. To view the list of possible items one has to click //
// on a button on the right of the little window. This will drop down   //
// a listbox. After selecting an item from the listbox the box will     //
// disappear and the newly selected item will be shown in the little    //
// window.                                                              //
//                                                                      //
// The TGComboBox is user callable. The TGComboBoxPopup is a service    //
// class of the combobox.                                               //
//                                                                      //
// Selecting an item in the combobox will generate the event:           //
// kC_COMMAND, kCM_COMBOBOX, combobox id, item id.                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TGComboBox.h"
#include "TGScrollBar.h"
#include "TGPicture.h"
#include "TGResourcePool.h"
#include "Riostream.h"
#include "TGTextEntry.h"
#include "KeySymbols.h"
#include "RConfigure.h"


ClassImp(TGComboBoxPopup)
ClassImp(TGComboBox)

ClassImp(TGLineStyleComboBox)
ClassImp(TGLineWidthComboBox)
ClassImp(TGFontTypeComboBox)

//______________________________________________________________________________
TGComboBoxPopup::TGComboBoxPopup(const TGWindow *p, UInt_t w, UInt_t h,
                                 UInt_t options, ULong_t back) :
   TGCompositeFrame (p, w, h, options, back), fListBox(0), fSelected(0)
{
   // Create a combo box popup frame.

   SetWindowAttributes_t wattr;

   wattr.fMask = kWAOverrideRedirect | kWASaveUnder |
                 kWABorderPixel      | kWABorderWidth;
   wattr.fOverrideRedirect = kTRUE;
   wattr.fSaveUnder = kTRUE;
   wattr.fBorderPixel = fgBlackPixel;
   wattr.fBorderWidth = 1;
   gVirtualX->ChangeWindowAttributes(fId, &wattr);

   AddInput(kStructureNotifyMask);
   fEditDisabled = kEditDisable | kEditDisableGrab  | kEditDisableBtnEnable;
   SetWindowName();
}

//______________________________________________________________________________
Bool_t TGComboBoxPopup::HandleButton(Event_t *event)
{
   // Handle mouse button event in combo box popup.

   if (event->fType == kButtonPress && event->fCode == kButton1) {
      if ((fListBox != 0) && (fSelected != 0) &&
          fListBox->GetSelectedEntry() != fSelected) {
         // in the case the combo box popup is closed by clicking outside the
         // list box, then select the previously selected entry
         fListBox->Select(fSelected->EntryId());
      }
      EndPopup();
   }
   else {
      // reset the dragging flag of the scrollbar when the button is
      // released outside the scrollbar itself
      fListBox->GetScrollBar()->SetDragging(kFALSE);
   }
   return kTRUE;
}

//______________________________________________________________________________
void TGComboBoxPopup::EndPopup()
{
   // Ungrab pointer and unmap popup window.

   if (IsMapped()) {
      Handle_t id = fListBox->GetContainer()->GetId();
      gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Up),
                         kAnyModifier, kFALSE);
      gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Down),
                         kAnyModifier, kFALSE);
      gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Enter),
                         kAnyModifier, kFALSE);
      gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Return),
                         kAnyModifier, kFALSE);
      gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Escape),
                         kAnyModifier, kFALSE);
      gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Space),
                         kAnyModifier, kFALSE);
      gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
      UnmapWindow();
   }
}

//______________________________________________________________________________
void TGComboBoxPopup::PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
{
   // Popup combo box popup window at the specified place.

   Int_t  rx, ry;
   UInt_t rw, rh;

   // Parent is root window for the popup:
   gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);

   if (x < 0) x = 0;
   if (x + fWidth > rw) x = rw - fWidth;
   if (y < 0) y = 0;
   if (y + fHeight > rh) y = rh - fHeight;

   // remember the current selected entry
   if (fListBox == 0) {
      // the listbox should be the first in the list
      TGFrameElement *el = (TGFrameElement *)fList->First();
      fListBox = dynamic_cast<TGListBox *>(el->fFrame);
   }
   fSelected = fListBox ? fListBox->GetSelectedEntry() : 0;

   MoveResize(x, y, w, h);
   MapSubwindows();
   Layout();
   MapRaised();

   Handle_t id = fListBox->GetContainer()->GetId();
   gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Up),
                      kAnyModifier, kTRUE);
   gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Down),
                      kAnyModifier, kTRUE);
   gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Enter),
                      kAnyModifier, kTRUE);
   gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Return),
                      kAnyModifier, kTRUE);
   gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Escape),
                      kAnyModifier, kTRUE);
   gVirtualX->GrabKey(id, gVirtualX->KeysymToKeycode(kKey_Space),
                      kAnyModifier, kTRUE);
   fListBox->GetContainer()->RequestFocus();

   gVirtualX->GrabPointer(fId, kButtonPressMask | kButtonReleaseMask |
                          kPointerMotionMask, kNone,
                          fClient->GetResourcePool()->GetGrabCursor());

   if (fClient->IsEditable()) {
      fClient->RegisterPopup(this);
   }

   fClient->WaitForUnmap(this);
   EndPopup();
}

//______________________________________________________________________________
void TGComboBoxPopup::KeyPressed(TGFrame *f, UInt_t keysym, UInt_t)
{
   // Slot handling the key press events.

   switch ((EKeySym)keysym) {
      case kKey_Enter:
      case kKey_Return:
      case kKey_Space:
         if (fListBox && f) {
            TGLBEntry *entry = dynamic_cast<TGLBEntry *>(f);
            if (entry) {
               fListBox->Select(entry->EntryId());
               SendMessage(fListBox, MK_MSG(kC_CONTAINER, kCT_ITEMCLICK),
                           entry->EntryId(), 0);
            }
         }
         EndPopup();
         break;
      case kKey_Escape:
         if (fListBox)
            ((TGContainer *)fListBox->GetContainer())->UnSelectAll();
         EndPopup();
         break;
      default:
         break;
   }
}

//______________________________________________________________________________
TGComboBox::TGComboBox(const TGWindow *p, Int_t id, UInt_t options,
                       ULong_t back) :
   TGCompositeFrame (p, 10, 10, options | kOwnBackground, back)
{
   // Create a combo box widget.

   fWidgetId  = id;
   fMsgWindow = p;
   fTextEntry = 0;

   fSelEntry = new TGTextLBEntry(this, new TGString(""), 0);
   fSelEntry->ChangeOptions(fSelEntry->GetOptions() | kOwnBackground);

   AddFrame(fSelEntry, fLhs = new TGLayoutHints(kLHintsLeft |
                                                kLHintsExpandY | kLHintsExpandX));
   Init();
}

//______________________________________________________________________________
TGComboBox::TGComboBox(const TGWindow *p, const char *text, Int_t id,
                       UInt_t options, ULong_t back) :
            TGCompositeFrame (p, 10, 10, options | kOwnBackground, back)
{
   // Create an editable combo box widget.

   fWidgetId  = id;
   fMsgWindow = p;
   fSelEntry = 0;

   fTextEntry = new TGTextEntry(this, text, id);
   fTextEntry->SetFrameDrawn(kFALSE);
   fTextEntry->Connect("ReturnPressed()", "TGComboBox", this, "ReturnPressed()");

   AddFrame(fTextEntry, fLhs = new TGLayoutHints(kLHintsLeft |
                                                 kLHintsExpandY | kLHintsExpandX));
   Init();
}

//______________________________________________________________________________
TGComboBox::~TGComboBox()
{
   // Delete a combo box widget.

   fClient->FreePicture(fBpic);

   if (!MustCleanup()) {
      SafeDelete(fDDButton);
      SafeDelete(fSelEntry);
      SafeDelete(fTextEntry);
      SafeDelete(fLhs);
      SafeDelete(fLhb);
   }

   SafeDelete(fLhdd);
   SafeDelete(fListBox);
   if (fComboFrame) {
      fComboFrame->EndPopup();  // force popdown in case of Qt interface
      SafeDelete(fComboFrame);
   }
}

//______________________________________________________________________________
void TGComboBox::Init()
{
   // Initiate the internal classes of a combo box.

   fBpic = fClient->GetPicture("arrow_down.xpm");

   if (!fBpic)
      Error("TGComboBox", "arrow_down.xpm not found");

   fDDButton = new TGScrollBarElement(this, fBpic, kDefaultScrollBarWidth,
                                      kDefaultScrollBarWidth, kRaisedFrame);

   AddFrame(fDDButton, fLhb = new TGLayoutHints(kLHintsRight |
                                                kLHintsExpandY));

   fComboFrame = new TGComboBoxPopup(fClient->GetDefaultRoot(), 100, 100, kVerticalFrame);

   fListBox = new TGListBox(fComboFrame, fWidgetId, kChildFrame);

   fListBox->Resize(100, 100);
   fListBox->Associate(this);
   fListBox->GetScrollBar()->GrabPointer(kFALSE); // combobox will do a pointergrab

   fComboFrame->AddFrame(fListBox, fLhdd = new TGLayoutHints(kLHintsExpandX |
                                                             kLHintsExpandY));
   fComboFrame->SetListBox(fListBox);
   fComboFrame->MapSubwindows();
   fComboFrame->Resize(fComboFrame->GetDefaultSize());

   gVirtualX->GrabButton(fId, kButton1, kAnyModifier, kButtonPressMask |
                         kButtonReleaseMask | kPointerMotionMask, kNone, kNone);

   fListBox->GetContainer()->Connect("KeyPressed(TGFrame*, UInt_t, UInt_t)",
                                     "TGComboBoxPopup", fComboFrame,
                                     "KeyPressed(TGFrame*, UInt_t, UInt_t)");
   // Drop down listbox of combo box should react to pointer motion
   // so it will be able to Activate() (i.e. highlight) the different
   // items when the mouse crosses.
   fListBox->GetContainer()->AddInput(kButtonPressMask | kButtonReleaseMask |
                                      kPointerMotionMask);

   fListBox->SetEditDisabled(kEditDisable);
   fListBox->GetContainer()->SetEditDisabled(kEditDisable);
   if (fSelEntry) fSelEntry->SetEditDisabled(kEditDisable | kEditDisableEvents | kEditDisableGrab);
   if (fTextEntry) fTextEntry->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
   fDDButton->SetEditDisabled(kEditDisable | kEditDisableGrab);
   fEditDisabled = kEditDisableLayout | kEditDisableBtnEnable | kEditDisableHeight;

   SetWindowName();
}

//______________________________________________________________________________
void TGComboBox::DrawBorder()
{
   // Draw border of combo box widget.

   switch (fOptions & (kSunkenFrame | kRaisedFrame | kDoubleBorder)) {
      case kSunkenFrame | kDoubleBorder:
         gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
         gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
         gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, fWidth-3, 1);
         gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, 1, fHeight-3);

         gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
         gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
         gVirtualX->DrawLine(fId, GetBckgndGC()(),  1, fHeight-2, fWidth-2, fHeight-2);
         gVirtualX->DrawLine(fId, GetBckgndGC()(),  fWidth-2, 1, fWidth-2, fHeight-2);
         break;

      default:
         TGCompositeFrame::DrawBorder();
         break;
   }
}

//______________________________________________________________________________
void TGComboBox::EnableTextInput(Bool_t on)
{
   // Switch text input or readonly mode of combobox (not perfect yet).

   // UInt_t w, h;
   const char *text = "";
   Pixel_t back = TGFrame::GetWhitePixel(); // default

   if (on) {
      if (fSelEntry) {
         back = fSelEntry->GetBackground();
         text = ((TGTextLBEntry*)fSelEntry)->GetText()->GetString();
         if (fTextEntry && fSelEntry->InheritsFrom(TGTextLBEntry::Class())) {
            fTextEntry->SetText(text);
         }
         RemoveFrame(fSelEntry);
         //w = fSelEntry->GetWidth();
         //h = fSelEntry->GetHeight();
         fSelEntry->DestroyWindow();
         delete fSelEntry;
         fSelEntry = 0;
      }
      if (!fTextEntry) {
         fTextEntry = new TGTextEntry(this, text, 0);
         fTextEntry->SetFrameDrawn(kFALSE);
         fTextEntry->Connect("ReturnPressed()", "TGComboBox", this, "ReturnPressed()");
         AddFrame(fTextEntry, fLhs);
         fTextEntry->SetEditDisabled(kEditDisable | kEditDisableGrab | kEditDisableBtnEnable);
      }
      fTextEntry->SetBackgroundColor(back);
      MapSubwindows();
      // coverity[returned_null]
      // coverity[dereference]
      GetLayoutManager()->Layout();
   } else {
      if (fTextEntry) {
         back = fTextEntry->GetBackground();
         text = fTextEntry->GetText();
         RemoveFrame(fTextEntry);
         fTextEntry->DestroyWindow();
         //w = fTextEntry->GetWidth();
         //h = fTextEntry->GetHeight();
         delete fTextEntry;
         fTextEntry = 0;
      }
      if (!fSelEntry) {
         fSelEntry = new TGTextLBEntry(this, new TGString(text), 0);
         fSelEntry->ChangeOptions(fSelEntry->GetOptions() | kOwnBackground);
         AddFrame(fSelEntry, fLhs);
         fSelEntry->SetEditDisabled(kEditDisable | kEditDisableGrab);
      }
      fSelEntry->SetBackgroundColor(back);
      MapSubwindows();
      // coverity[returned_null]
      // coverity[dereference]
      GetLayoutManager()->Layout();
   }
}

//______________________________________________________________________________
TGLBEntry *TGComboBox::FindEntry(const char *s) const
{
   // Find entry by name.

   TGLBEntry *sel = 0;
   sel = fListBox->FindEntry(s);
   return sel;
}

//______________________________________________________________________________
void TGComboBox::SetTopEntry(TGLBEntry *e, TGLayoutHints *lh)
{
   // Set a new combo box value (normally update of text string in
   // fSelEntry is done via fSelEntry::Update()).

   if (!fSelEntry) return;

   RemoveFrame(fSelEntry);
   fSelEntry->DestroyWindow();
   delete fSelEntry;
   delete fLhs;
   fSelEntry = e;
   fLhs = lh;
   AddFrame(fSelEntry, fLhs);
   Layout();
}

//______________________________________________________________________________
void TGComboBox::Select(Int_t id, Bool_t emit)
{
   // Make the selected item visible in the combo box window
   // and emit signals according to the second parameter.

   if (id!=GetSelected()) {
      TGLBEntry *e;
      e = fListBox->Select(id);
      if (e) {
         if (fSelEntry) {
            fSelEntry->Update(e);
            Layout();
            if (emit) {
               Selected(fWidgetId, id);
               Selected(id);
            }
         }
      }
   }
}

//______________________________________________________________________________
Bool_t TGComboBox::HandleButton(Event_t *event)
{
   // Handle mouse button events in the combo box.

   if (!fDDButton || !fDDButton->IsEnabled()) return kFALSE;

   if (event->fType == kButtonPress) {
      Window_t child = (Window_t)event->fUser[0];  // fUser[0] = child window

      if (child == fDDButton->GetId() || (fSelEntry && child == fSelEntry->GetId())) {
         fDDButton->SetState(kButtonDown);

         if (fTextEntry && (child == fTextEntry->GetId())) {
            return fTextEntry->HandleButton(event);
         }
         int      ax, ay;
         Window_t wdummy;
         gVirtualX->TranslateCoordinates(fId, fComboFrame->GetParent()->GetId(),
                                         0, fHeight, ax, ay, wdummy);
         // Drop down listbox of combo box should react to pointer motion...
         fListBox->GetContainer()->AddInput(kPointerMotionMask);
#ifdef R__HAS_COCOA
         gVirtualX->SetWMTransientHint(fComboFrame->GetId(), GetId());
#endif
         fComboFrame->PlacePopup(ax, ay, fWidth-2, fComboFrame->GetDefaultHeight());
         fDDButton->SetState(kButtonUp);
#ifdef R__HAS_COCOA
         //tp: I need this modification - "button" is not repainted correctly
         //with Cocoa, when combobox is closed (reason is quite complex), happens
         //when item is wider than combobox.
         //TODO: find another way :)
         fClient->NeedRedraw(fDDButton);
#endif
      } else if (fTextEntry) {
         return fTextEntry->HandleButton(event);
      }
   }
   return kTRUE;
}

//______________________________________________________________________________
void TGComboBox::RemoveEntry(Int_t id)
{
   // Remove entry. If id == -1, the currently selected entry is removed

   fListBox->RemoveEntry(id);

   if (id < 0) {
      if (fSelEntry) {
         ((TGTextLBEntry*)fSelEntry)->SetTitle("");
         fClient->NeedRedraw(fSelEntry);
      } else {
         fTextEntry->SetTitle("");
         fClient->NeedRedraw(fTextEntry);
      }
   }
   Resize();
}

//______________________________________________________________________________
void TGComboBox::Layout()
{
   // layout combobox

   TGCompositeFrame::Layout();
   UInt_t h = fListBox->GetNumberOfEntries()*fListBox->GetItemVsize();

   if (h && (h < 100)) {
      fListBox->Resize(fListBox->GetWidth(), h);
   }
}

//______________________________________________________________________________
Bool_t TGComboBox::HandleDoubleClick(Event_t *event)
{
   // Handle double click in text entry.

   return fTextEntry ? fTextEntry->HandleDoubleClick(event) : kTRUE;
}

//______________________________________________________________________________
Bool_t TGComboBox::HandleMotion(Event_t *event)
{
   // Handle pointer motion in text entry.

   return fTextEntry ? fTextEntry->HandleMotion(event) : kTRUE;
}

//______________________________________________________________________________
Bool_t TGComboBox::HandleSelection(Event_t *event)
{
   // Handle selection in text entry.

   return fTextEntry ? fTextEntry->HandleSelection(event) : kTRUE;
}

//______________________________________________________________________________
Bool_t TGComboBox::HandleSelectionRequest(Event_t *event)
{
   // Handle selection request in text entry.

   return fTextEntry ? fTextEntry->HandleSelectionRequest(event) : kTRUE;
}

//______________________________________________________________________________
Bool_t TGComboBox::ProcessMessage(Long_t msg, Long_t, Long_t parm2)
{
   // Process messages generated by the listbox and forward
   // messages to the combobox message handling window. Parm2 contains
   // the id of the selected listbox entry.

   TGLBEntry *e;

   switch (GET_MSG(msg)) {
      case kC_COMMAND:
         switch (GET_SUBMSG(msg)) {
            case kCM_LISTBOX:
               e = fListBox->GetSelectedEntry();
               if (fSelEntry) {
                  fSelEntry->Update(e);
               } else if (fTextEntry &&
                          e->InheritsFrom(TGTextLBEntry::Class())) {
                  TGTextLBEntry *te = (TGTextLBEntry*)e;
                  fTextEntry->SetText(te->GetText()->GetString());
               }
               // coverity[returned_null]
               // coverity[dereference]
               GetLayoutManager()->Layout();
               fComboFrame->EndPopup();
               fDDButton->SetState(kButtonUp);
               SendMessage(fMsgWindow, MK_MSG(kC_COMMAND, kCM_COMBOBOX),
                           fWidgetId, parm2);
               if (e->InheritsFrom(TGTextLBEntry::Class())) {
                  const char *text;
                  text = ((TGTextLBEntry*)e)->GetText()->GetString();
                  Selected(text);
               }
               Selected(fWidgetId, (Int_t)parm2);
               Selected((Int_t)parm2);
               fClient->NeedRedraw(this);
               break;
         }
         break;

      default:
         break;
   }
   return kTRUE;
}

//______________________________________________________________________________
void TGComboBox::Selected(Int_t widgetId, Int_t id)
{
   // Emit signal.

   Long_t args[2];

   args[0] = widgetId;
   args[1] = id;

   Emit("Selected(Int_t,Int_t)", args);
}

//______________________________________________________________________________
void TGComboBox::SetEnabled(Bool_t on)
{
   // Set state of combo box. If kTRUE=enabled, kFALSE=disabled.

   fDDButton->SetEnabled(on);
   if (on) {
      SetFlags(kWidgetIsEnabled);
      fSelEntry->SetBackgroundColor(GetBackground());
   } else {
      ClearFlags(kWidgetIsEnabled);
      fSelEntry->SetBackgroundColor(GetDefaultFrameBackground());
   }
   fClient->NeedRedraw(fSelEntry);
}

//______________________________________________________________________________
void TGComboBox::ReturnPressed()
{
   // Add new entry to combo box when return key pressed inside text entry
   // ReturnPressed signal is emitted.

   if (!fTextEntry) return;

   TGLBContainer *lbc = (TGLBContainer *)fListBox->GetContainer();
   TString text = fTextEntry->GetText();

   TIter next(lbc->GetList());
   TGFrameElement *el;

   Emit("ReturnPressed()");

   while ((el = (TGFrameElement *)next())) {
      TGTextLBEntry *lbe = (TGTextLBEntry *)el->fFrame;
      if (lbe->GetText()->GetString() == text) {
         return;
      }
   }

   Int_t nn = GetNumberOfEntries() + 1;
   AddEntry(text.Data(), nn);
   Select(nn);
}

//______________________________________________________________________________
void TGComboBox::RemoveAll()
{
   // Remove all entries from combo box.

   fListBox->RemoveAll();

   if (fSelEntry) {
      ((TGTextLBEntry*)fSelEntry)->SetTitle("");
      fClient->NeedRedraw(fSelEntry);
   } else {
      fTextEntry->SetTitle("");
      fClient->NeedRedraw(fTextEntry);
   }
}

//______________________________________________________________________________
void TGComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
   // Save a combo box widget as a C++ statement(s) on output stream out.

   if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);

   out << std::endl << "   // combo box" << std::endl;
   out << "   TGComboBox *";

   if (!fTextEntry) {
      out << GetName() << " = new TGComboBox(" << fParent->GetName() << "," << fWidgetId;
   } else {
      out << GetName() << " = new TGComboBox(" << fParent->GetName() << ",";
      out << '\"' <<  fTextEntry->GetText() << '\"' << "," <<fWidgetId;
   }

   if (fBackground == GetWhitePixel()) {
      if (GetOptions() == (kHorizontalFrame | kSunkenFrame | kDoubleBorder)) {
         out <<");" << std::endl;
      } else {
         out << "," << GetOptionString() << ");" << std::endl;
      }
   } else {
      out << "," << GetOptionString() << ",ucolor);" << std::endl;
   }
   if (option && strstr(option, "keep_names"))
      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;

   TGTextLBEntry *b;
   TGFrameElement *el;
   TGListBox *lb = GetListBox();

   TIter next(((TGLBContainer *)lb->GetContainer())->GetList());

   while ((el = (TGFrameElement *) next())) {
      b = (TGTextLBEntry *) el->fFrame;
      out << "   " << GetName() << "->AddEntry(";
      b->SavePrimitive(out, option);
      out <<  ");" << std::endl;
   }

   out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
       << GetHeight() << ");" << std::endl;
   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
}

//______________________________________________________________________________
TGLineStyleComboBox::TGLineStyleComboBox(const TGWindow *p, Int_t id,
                                         UInt_t options, Pixel_t back)
   : TGComboBox(p, id, options, back)
{
   // Create a line style combo box.

   SetTopEntry(new TGLineLBEntry(this, 0),
               new TGLayoutHints(kLHintsLeft | kLHintsExpandY | kLHintsExpandX));
   fSelEntry->ChangeOptions(fSelEntry->GetOptions() | kOwnBackground);

   for (Int_t i = 1; i <= 10; i++)
      AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), i,
               TString::Format("%d",i), 0, i),
               new TGLayoutHints(kLHintsTop | kLHintsExpandX));

   Select(1, kFALSE);  // to have first entry selected

   SetWindowName();
}

//______________________________________________________________________________
void TGLineStyleComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
   // Save a line style combo box widget as a C++ statement(s).

   out << std::endl << "   // line style combo box" << std::endl;
   out << "   TGLineStyleComboBox *";

   out << GetName() << " = new TGLineStyleComboBox(" << fParent->GetName()
       << "," << fWidgetId << ");" << std::endl;
   if (option && strstr(option, "keep_names"))
      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
   out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
       << GetHeight() << ");" << std::endl;
   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
}

//______________________________________________________________________________
TGLineWidthComboBox::TGLineWidthComboBox(const TGWindow *p, Int_t id,
                                         UInt_t options, Pixel_t back, Bool_t none)
   : TGComboBox(p, id, options, back)
{
   // Create a line width combo box.
   // If "none" is equal to kTRUE the first entry is "None".

   SetTopEntry(new TGLineLBEntry(this,0),
               new TGLayoutHints(kLHintsLeft | kLHintsExpandY | kLHintsExpandX));
   fSelEntry->ChangeOptions(fSelEntry->GetOptions() | kOwnBackground);

   if (none) {
      AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), 0, "None", 0, 0),
               new TGLayoutHints(kLHintsTop | kLHintsExpandX));
   }

   for (Int_t i = 1; i < 16; i++)
      AddEntry(new TGLineLBEntry(GetListBox()->GetContainer(), i,
               TString::Format("%d",i), i, 0),
               new TGLayoutHints(kLHintsTop | kLHintsExpandX));
   Select(1, kFALSE);  // to have first entry selected
   SetWindowName();
}

//______________________________________________________________________________
void TGLineWidthComboBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
{
   // Save a line width combo box widget as a C++ statement(s).

   out << std::endl << "   // line width combo box" << std::endl;
   out << "   TGLineWidthComboBox *";

   out << GetName() << " = new TGLineWidthComboBox(" << fParent->GetName()
       << "," << fWidgetId << ");" << std::endl;
   if (option && strstr(option, "keep_names"))
      out << "   " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
   out << "   " << GetName() << "->Resize(" << GetWidth()  << ","
       << GetHeight() << ");" << std::endl;
   out << "   " << GetName() << "->Select(" << GetSelected() << ");" << std::endl;
}

static const char *gFonts[][2] = {    //   unix name,     name
   { "",                                           ""                         }, //not used
   { "-*-times-medium-i-*-*-12-*-*-*-*-*-*-*",     "1. times italic"          },
   { "-*-times-bold-r-*-*-12-*-*-*-*-*-*-*",       "2. times bold"            },
   { "-*-times-bold-i-*-*-12-*-*-*-*-*-*-*",       "3. times bold italic"     },
   { "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*", "4. helvetica"             },
   { "-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-*", "5. helvetica italic"      },
   { "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*",   "6. helvetica bold"        },
   { "-*-helvetica-bold-o-*-*-12-*-*-*-*-*-*-*",   "7. helvetica bold italic" },
   { "-*-courier-medium-r-*-*-12-*-*-*-*-*-*-*",   "8. courier"               },
   { "-*-courier-medium-o-*-*-12-*-*-*-*-*-*-*",   "9. courier italic"        },
   { "-*-courier-bold-r-*-*-12-*-*-*-*-*-*-*",     "10. courier bold"         },
   { "-*-courier-bold-o-*-*-12-*-*-*-*-*-*-*",     "11. courier bold italic"  },
   { "-*-symbol-medium-r-*-*-12-*-*-*-*-*-*-*",    "12. symbol"               },
   { "-*-times-medium-r-*-*-12-*-*-*-*-*-*-*",     "13. times"                },
   { 0, 0}
};

//______________________________________________________________________________
TGFontTypeComboBox::TGFontTypeComboBox(const TGWindow *p, Int_t id,
                                       UInt_t options, Pixel_t back) :
   TGComboBox(p, id, options, back)
{
   // Create a text font combo box.

   Int_t noFonts = 0;

   for (Int_t i = 1; gFonts[i][0] != 0 && noFonts < kMaxFonts; i++) {

      fFonts[noFonts] = gVirtualX->LoadQueryFont(gFonts[i][0]);

      if (fFonts[noFonts] == 0)
         fFonts[noFonts] = TGTextLBEntry::GetDefaultFontStruct();

      GCValues_t gval;
      gval.fMask = kGCFont;
      gval.fFont = gVirtualX->GetFontHandle(fFonts[noFonts]);

      AddEntry(new TGTextLBEntry(GetListBox()->GetContainer(),
               new TGString(gFonts[i][1]), i,
               fClient->GetGC(&gval, kTRUE)->GetGC(), fFonts[noFonts]),
               new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX));
      noFonts++;
   }

   if (noFonts < kMaxFonts - 1)
      fFonts[noFonts] = 0;

   Select(1, kFALSE);  // to have first entry selected
   SetWindowName();
}

//______________________________________________________________________________
TGFontTypeComboBox::~TGFontTypeComboBox()
{
   // Text font combo box dtor.

   for (int i = 0; i < kMaxFonts && fFonts[i] != 0; i++) {
      if (fFonts[i] != TGTextLBEntry::GetDefaultFontStruct()) gVirtualX->DeleteFont(fFonts[i]);
   }
}
 TGComboBox.cxx:1
 TGComboBox.cxx:2
 TGComboBox.cxx:3
 TGComboBox.cxx:4
 TGComboBox.cxx:5
 TGComboBox.cxx:6
 TGComboBox.cxx:7
 TGComboBox.cxx:8
 TGComboBox.cxx:9
 TGComboBox.cxx:10
 TGComboBox.cxx:11
 TGComboBox.cxx:12
 TGComboBox.cxx:13
 TGComboBox.cxx:14
 TGComboBox.cxx:15
 TGComboBox.cxx:16
 TGComboBox.cxx:17
 TGComboBox.cxx:18
 TGComboBox.cxx:19
 TGComboBox.cxx:20
 TGComboBox.cxx:21
 TGComboBox.cxx:22
 TGComboBox.cxx:23
 TGComboBox.cxx:24
 TGComboBox.cxx:25
 TGComboBox.cxx:26
 TGComboBox.cxx:27
 TGComboBox.cxx:28
 TGComboBox.cxx:29
 TGComboBox.cxx:30
 TGComboBox.cxx:31
 TGComboBox.cxx:32
 TGComboBox.cxx:33
 TGComboBox.cxx:34
 TGComboBox.cxx:35
 TGComboBox.cxx:36
 TGComboBox.cxx:37
 TGComboBox.cxx:38
 TGComboBox.cxx:39
 TGComboBox.cxx:40
 TGComboBox.cxx:41
 TGComboBox.cxx:42
 TGComboBox.cxx:43
 TGComboBox.cxx:44
 TGComboBox.cxx:45
 TGComboBox.cxx:46
 TGComboBox.cxx:47
 TGComboBox.cxx:48
 TGComboBox.cxx:49
 TGComboBox.cxx:50
 TGComboBox.cxx:51
 TGComboBox.cxx:52
 TGComboBox.cxx:53
 TGComboBox.cxx:54
 TGComboBox.cxx:55
 TGComboBox.cxx:56
 TGComboBox.cxx:57
 TGComboBox.cxx:58
 TGComboBox.cxx:59
 TGComboBox.cxx:60
 TGComboBox.cxx:61
 TGComboBox.cxx:62
 TGComboBox.cxx:63
 TGComboBox.cxx:64
 TGComboBox.cxx:65
 TGComboBox.cxx:66
 TGComboBox.cxx:67
 TGComboBox.cxx:68
 TGComboBox.cxx:69
 TGComboBox.cxx:70
 TGComboBox.cxx:71
 TGComboBox.cxx:72
 TGComboBox.cxx:73
 TGComboBox.cxx:74
 TGComboBox.cxx:75
 TGComboBox.cxx:76
 TGComboBox.cxx:77
 TGComboBox.cxx:78
 TGComboBox.cxx:79
 TGComboBox.cxx:80
 TGComboBox.cxx:81
 TGComboBox.cxx:82
 TGComboBox.cxx:83
 TGComboBox.cxx:84
 TGComboBox.cxx:85
 TGComboBox.cxx:86
 TGComboBox.cxx:87
 TGComboBox.cxx:88
 TGComboBox.cxx:89
 TGComboBox.cxx:90
 TGComboBox.cxx:91
 TGComboBox.cxx:92
 TGComboBox.cxx:93
 TGComboBox.cxx:94
 TGComboBox.cxx:95
 TGComboBox.cxx:96
 TGComboBox.cxx:97
 TGComboBox.cxx:98
 TGComboBox.cxx:99
 TGComboBox.cxx:100
 TGComboBox.cxx:101
 TGComboBox.cxx:102
 TGComboBox.cxx:103
 TGComboBox.cxx:104
 TGComboBox.cxx:105
 TGComboBox.cxx:106
 TGComboBox.cxx:107
 TGComboBox.cxx:108
 TGComboBox.cxx:109
 TGComboBox.cxx:110
 TGComboBox.cxx:111
 TGComboBox.cxx:112
 TGComboBox.cxx:113
 TGComboBox.cxx:114
 TGComboBox.cxx:115
 TGComboBox.cxx:116
 TGComboBox.cxx:117
 TGComboBox.cxx:118
 TGComboBox.cxx:119
 TGComboBox.cxx:120
 TGComboBox.cxx:121
 TGComboBox.cxx:122
 TGComboBox.cxx:123
 TGComboBox.cxx:124
 TGComboBox.cxx:125
 TGComboBox.cxx:126
 TGComboBox.cxx:127
 TGComboBox.cxx:128
 TGComboBox.cxx:129
 TGComboBox.cxx:130
 TGComboBox.cxx:131
 TGComboBox.cxx:132
 TGComboBox.cxx:133
 TGComboBox.cxx:134
 TGComboBox.cxx:135
 TGComboBox.cxx:136
 TGComboBox.cxx:137
 TGComboBox.cxx:138
 TGComboBox.cxx:139
 TGComboBox.cxx:140
 TGComboBox.cxx:141
 TGComboBox.cxx:142
 TGComboBox.cxx:143
 TGComboBox.cxx:144
 TGComboBox.cxx:145
 TGComboBox.cxx:146
 TGComboBox.cxx:147
 TGComboBox.cxx:148
 TGComboBox.cxx:149
 TGComboBox.cxx:150
 TGComboBox.cxx:151
 TGComboBox.cxx:152
 TGComboBox.cxx:153
 TGComboBox.cxx:154
 TGComboBox.cxx:155
 TGComboBox.cxx:156
 TGComboBox.cxx:157
 TGComboBox.cxx:158
 TGComboBox.cxx:159
 TGComboBox.cxx:160
 TGComboBox.cxx:161
 TGComboBox.cxx:162
 TGComboBox.cxx:163
 TGComboBox.cxx:164
 TGComboBox.cxx:165
 TGComboBox.cxx:166
 TGComboBox.cxx:167
 TGComboBox.cxx:168
 TGComboBox.cxx:169
 TGComboBox.cxx:170
 TGComboBox.cxx:171
 TGComboBox.cxx:172
 TGComboBox.cxx:173
 TGComboBox.cxx:174
 TGComboBox.cxx:175
 TGComboBox.cxx:176
 TGComboBox.cxx:177
 TGComboBox.cxx:178
 TGComboBox.cxx:179
 TGComboBox.cxx:180
 TGComboBox.cxx:181
 TGComboBox.cxx:182
 TGComboBox.cxx:183
 TGComboBox.cxx:184
 TGComboBox.cxx:185
 TGComboBox.cxx:186
 TGComboBox.cxx:187
 TGComboBox.cxx:188
 TGComboBox.cxx:189
 TGComboBox.cxx:190
 TGComboBox.cxx:191
 TGComboBox.cxx:192
 TGComboBox.cxx:193
 TGComboBox.cxx:194
 TGComboBox.cxx:195
 TGComboBox.cxx:196
 TGComboBox.cxx:197
 TGComboBox.cxx:198
 TGComboBox.cxx:199
 TGComboBox.cxx:200
 TGComboBox.cxx:201
 TGComboBox.cxx:202
 TGComboBox.cxx:203
 TGComboBox.cxx:204
 TGComboBox.cxx:205
 TGComboBox.cxx:206
 TGComboBox.cxx:207
 TGComboBox.cxx:208
 TGComboBox.cxx:209
 TGComboBox.cxx:210
 TGComboBox.cxx:211
 TGComboBox.cxx:212
 TGComboBox.cxx:213
 TGComboBox.cxx:214
 TGComboBox.cxx:215
 TGComboBox.cxx:216
 TGComboBox.cxx:217
 TGComboBox.cxx:218
 TGComboBox.cxx:219
 TGComboBox.cxx:220
 TGComboBox.cxx:221
 TGComboBox.cxx:222
 TGComboBox.cxx:223
 TGComboBox.cxx:224
 TGComboBox.cxx:225
 TGComboBox.cxx:226
 TGComboBox.cxx:227
 TGComboBox.cxx:228
 TGComboBox.cxx:229
 TGComboBox.cxx:230
 TGComboBox.cxx:231
 TGComboBox.cxx:232
 TGComboBox.cxx:233
 TGComboBox.cxx:234
 TGComboBox.cxx:235
 TGComboBox.cxx:236
 TGComboBox.cxx:237
 TGComboBox.cxx:238
 TGComboBox.cxx:239
 TGComboBox.cxx:240
 TGComboBox.cxx:241
 TGComboBox.cxx:242
 TGComboBox.cxx:243
 TGComboBox.cxx:244
 TGComboBox.cxx:245
 TGComboBox.cxx:246
 TGComboBox.cxx:247
 TGComboBox.cxx:248
 TGComboBox.cxx:249
 TGComboBox.cxx:250
 TGComboBox.cxx:251
 TGComboBox.cxx:252
 TGComboBox.cxx:253
 TGComboBox.cxx:254
 TGComboBox.cxx:255
 TGComboBox.cxx:256
 TGComboBox.cxx:257
 TGComboBox.cxx:258
 TGComboBox.cxx:259
 TGComboBox.cxx:260
 TGComboBox.cxx:261
 TGComboBox.cxx:262
 TGComboBox.cxx:263
 TGComboBox.cxx:264
 TGComboBox.cxx:265
 TGComboBox.cxx:266
 TGComboBox.cxx:267
 TGComboBox.cxx:268
 TGComboBox.cxx:269
 TGComboBox.cxx:270
 TGComboBox.cxx:271
 TGComboBox.cxx:272
 TGComboBox.cxx:273
 TGComboBox.cxx:274
 TGComboBox.cxx:275
 TGComboBox.cxx:276
 TGComboBox.cxx:277
 TGComboBox.cxx:278
 TGComboBox.cxx:279
 TGComboBox.cxx:280
 TGComboBox.cxx:281
 TGComboBox.cxx:282
 TGComboBox.cxx:283
 TGComboBox.cxx:284
 TGComboBox.cxx:285
 TGComboBox.cxx:286
 TGComboBox.cxx:287
 TGComboBox.cxx:288
 TGComboBox.cxx:289
 TGComboBox.cxx:290
 TGComboBox.cxx:291
 TGComboBox.cxx:292
 TGComboBox.cxx:293
 TGComboBox.cxx:294
 TGComboBox.cxx:295
 TGComboBox.cxx:296
 TGComboBox.cxx:297
 TGComboBox.cxx:298
 TGComboBox.cxx:299
 TGComboBox.cxx:300
 TGComboBox.cxx:301
 TGComboBox.cxx:302
 TGComboBox.cxx:303
 TGComboBox.cxx:304
 TGComboBox.cxx:305
 TGComboBox.cxx:306
 TGComboBox.cxx:307
 TGComboBox.cxx:308
 TGComboBox.cxx:309
 TGComboBox.cxx:310
 TGComboBox.cxx:311
 TGComboBox.cxx:312
 TGComboBox.cxx:313
 TGComboBox.cxx:314
 TGComboBox.cxx:315
 TGComboBox.cxx:316
 TGComboBox.cxx:317
 TGComboBox.cxx:318
 TGComboBox.cxx:319
 TGComboBox.cxx:320
 TGComboBox.cxx:321
 TGComboBox.cxx:322
 TGComboBox.cxx:323
 TGComboBox.cxx:324
 TGComboBox.cxx:325
 TGComboBox.cxx:326
 TGComboBox.cxx:327
 TGComboBox.cxx:328
 TGComboBox.cxx:329
 TGComboBox.cxx:330
 TGComboBox.cxx:331
 TGComboBox.cxx:332
 TGComboBox.cxx:333
 TGComboBox.cxx:334
 TGComboBox.cxx:335
 TGComboBox.cxx:336
 TGComboBox.cxx:337
 TGComboBox.cxx:338
 TGComboBox.cxx:339
 TGComboBox.cxx:340
 TGComboBox.cxx:341
 TGComboBox.cxx:342
 TGComboBox.cxx:343
 TGComboBox.cxx:344
 TGComboBox.cxx:345
 TGComboBox.cxx:346
 TGComboBox.cxx:347
 TGComboBox.cxx:348
 TGComboBox.cxx:349
 TGComboBox.cxx:350
 TGComboBox.cxx:351
 TGComboBox.cxx:352
 TGComboBox.cxx:353
 TGComboBox.cxx:354
 TGComboBox.cxx:355
 TGComboBox.cxx:356
 TGComboBox.cxx:357
 TGComboBox.cxx:358
 TGComboBox.cxx:359
 TGComboBox.cxx:360
 TGComboBox.cxx:361
 TGComboBox.cxx:362
 TGComboBox.cxx:363
 TGComboBox.cxx:364
 TGComboBox.cxx:365
 TGComboBox.cxx:366
 TGComboBox.cxx:367
 TGComboBox.cxx:368
 TGComboBox.cxx:369
 TGComboBox.cxx:370
 TGComboBox.cxx:371
 TGComboBox.cxx:372
 TGComboBox.cxx:373
 TGComboBox.cxx:374
 TGComboBox.cxx:375
 TGComboBox.cxx:376
 TGComboBox.cxx:377
 TGComboBox.cxx:378
 TGComboBox.cxx:379
 TGComboBox.cxx:380
 TGComboBox.cxx:381
 TGComboBox.cxx:382
 TGComboBox.cxx:383
 TGComboBox.cxx:384
 TGComboBox.cxx:385
 TGComboBox.cxx:386
 TGComboBox.cxx:387
 TGComboBox.cxx:388
 TGComboBox.cxx:389
 TGComboBox.cxx:390
 TGComboBox.cxx:391
 TGComboBox.cxx:392
 TGComboBox.cxx:393
 TGComboBox.cxx:394
 TGComboBox.cxx:395
 TGComboBox.cxx:396
 TGComboBox.cxx:397
 TGComboBox.cxx:398
 TGComboBox.cxx:399
 TGComboBox.cxx:400
 TGComboBox.cxx:401
 TGComboBox.cxx:402
 TGComboBox.cxx:403
 TGComboBox.cxx:404
 TGComboBox.cxx:405
 TGComboBox.cxx:406
 TGComboBox.cxx:407
 TGComboBox.cxx:408
 TGComboBox.cxx:409
 TGComboBox.cxx:410
 TGComboBox.cxx:411
 TGComboBox.cxx:412
 TGComboBox.cxx:413
 TGComboBox.cxx:414
 TGComboBox.cxx:415
 TGComboBox.cxx:416
 TGComboBox.cxx:417
 TGComboBox.cxx:418
 TGComboBox.cxx:419
 TGComboBox.cxx:420
 TGComboBox.cxx:421
 TGComboBox.cxx:422
 TGComboBox.cxx:423
 TGComboBox.cxx:424
 TGComboBox.cxx:425
 TGComboBox.cxx:426
 TGComboBox.cxx:427
 TGComboBox.cxx:428
 TGComboBox.cxx:429
 TGComboBox.cxx:430
 TGComboBox.cxx:431
 TGComboBox.cxx:432
 TGComboBox.cxx:433
 TGComboBox.cxx:434
 TGComboBox.cxx:435
 TGComboBox.cxx:436
 TGComboBox.cxx:437
 TGComboBox.cxx:438
 TGComboBox.cxx:439
 TGComboBox.cxx:440
 TGComboBox.cxx:441
 TGComboBox.cxx:442
 TGComboBox.cxx:443
 TGComboBox.cxx:444
 TGComboBox.cxx:445
 TGComboBox.cxx:446
 TGComboBox.cxx:447
 TGComboBox.cxx:448
 TGComboBox.cxx:449
 TGComboBox.cxx:450
 TGComboBox.cxx:451
 TGComboBox.cxx:452
 TGComboBox.cxx:453
 TGComboBox.cxx:454
 TGComboBox.cxx:455
 TGComboBox.cxx:456
 TGComboBox.cxx:457
 TGComboBox.cxx:458
 TGComboBox.cxx:459
 TGComboBox.cxx:460
 TGComboBox.cxx:461
 TGComboBox.cxx:462
 TGComboBox.cxx:463
 TGComboBox.cxx:464
 TGComboBox.cxx:465
 TGComboBox.cxx:466
 TGComboBox.cxx:467
 TGComboBox.cxx:468
 TGComboBox.cxx:469
 TGComboBox.cxx:470
 TGComboBox.cxx:471
 TGComboBox.cxx:472
 TGComboBox.cxx:473
 TGComboBox.cxx:474
 TGComboBox.cxx:475
 TGComboBox.cxx:476
 TGComboBox.cxx:477
 TGComboBox.cxx:478
 TGComboBox.cxx:479
 TGComboBox.cxx:480
 TGComboBox.cxx:481
 TGComboBox.cxx:482
 TGComboBox.cxx:483
 TGComboBox.cxx:484
 TGComboBox.cxx:485
 TGComboBox.cxx:486
 TGComboBox.cxx:487
 TGComboBox.cxx:488
 TGComboBox.cxx:489
 TGComboBox.cxx:490
 TGComboBox.cxx:491
 TGComboBox.cxx:492
 TGComboBox.cxx:493
 TGComboBox.cxx:494
 TGComboBox.cxx:495
 TGComboBox.cxx:496
 TGComboBox.cxx:497
 TGComboBox.cxx:498
 TGComboBox.cxx:499
 TGComboBox.cxx:500
 TGComboBox.cxx:501
 TGComboBox.cxx:502
 TGComboBox.cxx:503
 TGComboBox.cxx:504
 TGComboBox.cxx:505
 TGComboBox.cxx:506
 TGComboBox.cxx:507
 TGComboBox.cxx:508
 TGComboBox.cxx:509
 TGComboBox.cxx:510
 TGComboBox.cxx:511
 TGComboBox.cxx:512
 TGComboBox.cxx:513
 TGComboBox.cxx:514
 TGComboBox.cxx:515
 TGComboBox.cxx:516
 TGComboBox.cxx:517
 TGComboBox.cxx:518
 TGComboBox.cxx:519
 TGComboBox.cxx:520
 TGComboBox.cxx:521
 TGComboBox.cxx:522
 TGComboBox.cxx:523
 TGComboBox.cxx:524
 TGComboBox.cxx:525
 TGComboBox.cxx:526
 TGComboBox.cxx:527
 TGComboBox.cxx:528
 TGComboBox.cxx:529
 TGComboBox.cxx:530
 TGComboBox.cxx:531
 TGComboBox.cxx:532
 TGComboBox.cxx:533
 TGComboBox.cxx:534
 TGComboBox.cxx:535
 TGComboBox.cxx:536
 TGComboBox.cxx:537
 TGComboBox.cxx:538
 TGComboBox.cxx:539
 TGComboBox.cxx:540
 TGComboBox.cxx:541
 TGComboBox.cxx:542
 TGComboBox.cxx:543
 TGComboBox.cxx:544
 TGComboBox.cxx:545
 TGComboBox.cxx:546
 TGComboBox.cxx:547
 TGComboBox.cxx:548
 TGComboBox.cxx:549
 TGComboBox.cxx:550
 TGComboBox.cxx:551
 TGComboBox.cxx:552
 TGComboBox.cxx:553
 TGComboBox.cxx:554
 TGComboBox.cxx:555
 TGComboBox.cxx:556
 TGComboBox.cxx:557
 TGComboBox.cxx:558
 TGComboBox.cxx:559
 TGComboBox.cxx:560
 TGComboBox.cxx:561
 TGComboBox.cxx:562
 TGComboBox.cxx:563
 TGComboBox.cxx:564
 TGComboBox.cxx:565
 TGComboBox.cxx:566
 TGComboBox.cxx:567
 TGComboBox.cxx:568
 TGComboBox.cxx:569
 TGComboBox.cxx:570
 TGComboBox.cxx:571
 TGComboBox.cxx:572
 TGComboBox.cxx:573
 TGComboBox.cxx:574
 TGComboBox.cxx:575
 TGComboBox.cxx:576
 TGComboBox.cxx:577
 TGComboBox.cxx:578
 TGComboBox.cxx:579
 TGComboBox.cxx:580
 TGComboBox.cxx:581
 TGComboBox.cxx:582
 TGComboBox.cxx:583
 TGComboBox.cxx:584
 TGComboBox.cxx:585
 TGComboBox.cxx:586
 TGComboBox.cxx:587
 TGComboBox.cxx:588
 TGComboBox.cxx:589
 TGComboBox.cxx:590
 TGComboBox.cxx:591
 TGComboBox.cxx:592
 TGComboBox.cxx:593
 TGComboBox.cxx:594
 TGComboBox.cxx:595
 TGComboBox.cxx:596
 TGComboBox.cxx:597
 TGComboBox.cxx:598
 TGComboBox.cxx:599
 TGComboBox.cxx:600
 TGComboBox.cxx:601
 TGComboBox.cxx:602
 TGComboBox.cxx:603
 TGComboBox.cxx:604
 TGComboBox.cxx:605
 TGComboBox.cxx:606
 TGComboBox.cxx:607
 TGComboBox.cxx:608
 TGComboBox.cxx:609
 TGComboBox.cxx:610
 TGComboBox.cxx:611
 TGComboBox.cxx:612
 TGComboBox.cxx:613
 TGComboBox.cxx:614
 TGComboBox.cxx:615
 TGComboBox.cxx:616
 TGComboBox.cxx:617
 TGComboBox.cxx:618
 TGComboBox.cxx:619
 TGComboBox.cxx:620
 TGComboBox.cxx:621
 TGComboBox.cxx:622
 TGComboBox.cxx:623
 TGComboBox.cxx:624
 TGComboBox.cxx:625
 TGComboBox.cxx:626
 TGComboBox.cxx:627
 TGComboBox.cxx:628
 TGComboBox.cxx:629
 TGComboBox.cxx:630
 TGComboBox.cxx:631
 TGComboBox.cxx:632
 TGComboBox.cxx:633
 TGComboBox.cxx:634
 TGComboBox.cxx:635
 TGComboBox.cxx:636
 TGComboBox.cxx:637
 TGComboBox.cxx:638
 TGComboBox.cxx:639
 TGComboBox.cxx:640
 TGComboBox.cxx:641
 TGComboBox.cxx:642
 TGComboBox.cxx:643
 TGComboBox.cxx:644
 TGComboBox.cxx:645
 TGComboBox.cxx:646
 TGComboBox.cxx:647
 TGComboBox.cxx:648
 TGComboBox.cxx:649
 TGComboBox.cxx:650
 TGComboBox.cxx:651
 TGComboBox.cxx:652
 TGComboBox.cxx:653
 TGComboBox.cxx:654
 TGComboBox.cxx:655
 TGComboBox.cxx:656
 TGComboBox.cxx:657
 TGComboBox.cxx:658
 TGComboBox.cxx:659
 TGComboBox.cxx:660
 TGComboBox.cxx:661
 TGComboBox.cxx:662
 TGComboBox.cxx:663
 TGComboBox.cxx:664
 TGComboBox.cxx:665
 TGComboBox.cxx:666
 TGComboBox.cxx:667
 TGComboBox.cxx:668
 TGComboBox.cxx:669
 TGComboBox.cxx:670
 TGComboBox.cxx:671
 TGComboBox.cxx:672
 TGComboBox.cxx:673
 TGComboBox.cxx:674
 TGComboBox.cxx:675
 TGComboBox.cxx:676
 TGComboBox.cxx:677
 TGComboBox.cxx:678
 TGComboBox.cxx:679
 TGComboBox.cxx:680
 TGComboBox.cxx:681
 TGComboBox.cxx:682
 TGComboBox.cxx:683
 TGComboBox.cxx:684
 TGComboBox.cxx:685
 TGComboBox.cxx:686
 TGComboBox.cxx:687
 TGComboBox.cxx:688
 TGComboBox.cxx:689
 TGComboBox.cxx:690
 TGComboBox.cxx:691
 TGComboBox.cxx:692
 TGComboBox.cxx:693
 TGComboBox.cxx:694
 TGComboBox.cxx:695
 TGComboBox.cxx:696
 TGComboBox.cxx:697
 TGComboBox.cxx:698
 TGComboBox.cxx:699
 TGComboBox.cxx:700
 TGComboBox.cxx:701
 TGComboBox.cxx:702
 TGComboBox.cxx:703
 TGComboBox.cxx:704
 TGComboBox.cxx:705
 TGComboBox.cxx:706
 TGComboBox.cxx:707
 TGComboBox.cxx:708
 TGComboBox.cxx:709
 TGComboBox.cxx:710
 TGComboBox.cxx:711
 TGComboBox.cxx:712
 TGComboBox.cxx:713
 TGComboBox.cxx:714
 TGComboBox.cxx:715
 TGComboBox.cxx:716
 TGComboBox.cxx:717
 TGComboBox.cxx:718
 TGComboBox.cxx:719
 TGComboBox.cxx:720
 TGComboBox.cxx:721
 TGComboBox.cxx:722
 TGComboBox.cxx:723
 TGComboBox.cxx:724
 TGComboBox.cxx:725
 TGComboBox.cxx:726
 TGComboBox.cxx:727
 TGComboBox.cxx:728
 TGComboBox.cxx:729
 TGComboBox.cxx:730
 TGComboBox.cxx:731
 TGComboBox.cxx:732
 TGComboBox.cxx:733
 TGComboBox.cxx:734
 TGComboBox.cxx:735
 TGComboBox.cxx:736
 TGComboBox.cxx:737
 TGComboBox.cxx:738
 TGComboBox.cxx:739
 TGComboBox.cxx:740
 TGComboBox.cxx:741
 TGComboBox.cxx:742
 TGComboBox.cxx:743
 TGComboBox.cxx:744
 TGComboBox.cxx:745
 TGComboBox.cxx:746
 TGComboBox.cxx:747
 TGComboBox.cxx:748
 TGComboBox.cxx:749
 TGComboBox.cxx:750
 TGComboBox.cxx:751
 TGComboBox.cxx:752
 TGComboBox.cxx:753
 TGComboBox.cxx:754
 TGComboBox.cxx:755
 TGComboBox.cxx:756
 TGComboBox.cxx:757
 TGComboBox.cxx:758
 TGComboBox.cxx:759
 TGComboBox.cxx:760
 TGComboBox.cxx:761
 TGComboBox.cxx:762
 TGComboBox.cxx:763
 TGComboBox.cxx:764
 TGComboBox.cxx:765
 TGComboBox.cxx:766
 TGComboBox.cxx:767
 TGComboBox.cxx:768
 TGComboBox.cxx:769
 TGComboBox.cxx:770
 TGComboBox.cxx:771
 TGComboBox.cxx:772
 TGComboBox.cxx:773
 TGComboBox.cxx:774
 TGComboBox.cxx:775
 TGComboBox.cxx:776
 TGComboBox.cxx:777
 TGComboBox.cxx:778
 TGComboBox.cxx:779
 TGComboBox.cxx:780
 TGComboBox.cxx:781
 TGComboBox.cxx:782
 TGComboBox.cxx:783
 TGComboBox.cxx:784
 TGComboBox.cxx:785
 TGComboBox.cxx:786
 TGComboBox.cxx:787
 TGComboBox.cxx:788
 TGComboBox.cxx:789
 TGComboBox.cxx:790
 TGComboBox.cxx:791
 TGComboBox.cxx:792
 TGComboBox.cxx:793
 TGComboBox.cxx:794
 TGComboBox.cxx:795
 TGComboBox.cxx:796
 TGComboBox.cxx:797
 TGComboBox.cxx:798
 TGComboBox.cxx:799
 TGComboBox.cxx:800
 TGComboBox.cxx:801
 TGComboBox.cxx:802
 TGComboBox.cxx:803
 TGComboBox.cxx:804
 TGComboBox.cxx:805
 TGComboBox.cxx:806
 TGComboBox.cxx:807
 TGComboBox.cxx:808
 TGComboBox.cxx:809
 TGComboBox.cxx:810
 TGComboBox.cxx:811
 TGComboBox.cxx:812
 TGComboBox.cxx:813
 TGComboBox.cxx:814
 TGComboBox.cxx:815
 TGComboBox.cxx:816
 TGComboBox.cxx:817
 TGComboBox.cxx:818
 TGComboBox.cxx:819
 TGComboBox.cxx:820
 TGComboBox.cxx:821
 TGComboBox.cxx:822
 TGComboBox.cxx:823
 TGComboBox.cxx:824
 TGComboBox.cxx:825
 TGComboBox.cxx:826
 TGComboBox.cxx:827
 TGComboBox.cxx:828
 TGComboBox.cxx:829
 TGComboBox.cxx:830
 TGComboBox.cxx:831
 TGComboBox.cxx:832
 TGComboBox.cxx:833
 TGComboBox.cxx:834
 TGComboBox.cxx:835
 TGComboBox.cxx:836
 TGComboBox.cxx:837
 TGComboBox.cxx:838
 TGComboBox.cxx:839
 TGComboBox.cxx:840
 TGComboBox.cxx:841
 TGComboBox.cxx:842
 TGComboBox.cxx:843
 TGComboBox.cxx:844
 TGComboBox.cxx:845
 TGComboBox.cxx:846
 TGComboBox.cxx:847
 TGComboBox.cxx:848
 TGComboBox.cxx:849
 TGComboBox.cxx:850
 TGComboBox.cxx:851
 TGComboBox.cxx:852
 TGComboBox.cxx:853
 TGComboBox.cxx:854
 TGComboBox.cxx:855
 TGComboBox.cxx:856
 TGComboBox.cxx:857
 TGComboBox.cxx:858
 TGComboBox.cxx:859
 TGComboBox.cxx:860
 TGComboBox.cxx:861
 TGComboBox.cxx:862
 TGComboBox.cxx:863
 TGComboBox.cxx:864
 TGComboBox.cxx:865
 TGComboBox.cxx:866
 TGComboBox.cxx:867
 TGComboBox.cxx:868
 TGComboBox.cxx:869
 TGComboBox.cxx:870
 TGComboBox.cxx:871
 TGComboBox.cxx:872