// @(#)root/gui:$Id: bcc7b53cab203466d39a6f17445d822d6fc19610 $
// Author: Bertrand Bellenot + Fons Rademakers + Valeriy Onuchin  23/04/03

/*************************************************************************
 * Copyright (C) 1995-2004, 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.

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

#include "TGFontDialog.h"
#include "TString.h"
#include "TError.h"
#include "TGColorSelect.h"
#include "TGButton.h"
#include "TGLabel.h"
#include "TGListBox.h"
#include "TGComboBox.h"
#include <stdlib.h>



enum EFontDialog {
   kFDLG_OK          = 1,
   kFDLG_CANCEL,

   kFDLG_FONTNAMES   = 21,
   kFDLG_FONTSIZES,
   kFDLG_FONTSTYLES,
   kFDLG_FONTALIGNS,

   kFDLG_COLORSEL    = 31
};

static const char *gFDLG_DEFAULTSAMPLE = "AaBbCcYyZz 1234567890";


static const char *gFontSizes[] = {
    "8",  "9", "10", "11", "12", "13", "14", "16",
   "18", "20", "22", "24", "26", "28", "30", "32",
   "34", "36", "48", "72", 0
};

static const char *gFontStyles[] = {
   "Normal", "Bold", "Italic", "Bold Italic", 0
};

static TString gFontStylesReal[4];


static const char *gAlignTypes[] = {
    "top left", "top center", "top right",
    "middle left", "middle center", "middle right",
    "bottom left", "bottom center", "bottom right",
    0
};

static const Int_t gAlignValues[] = {
    kTextTop     | kTextLeft,
    kTextTop     | kTextCenterX,
    kTextTop     | kTextRight,
    kTextCenterY | kTextLeft,
    kTextCenterY | kTextCenterX,
    kTextCenterY | kTextRight,
    kTextBottom  | kTextLeft,
    kTextBottom  | kTextCenterX,
    kTextBottom  | kTextRight,
    0
};

/*
static const char *gFontList[] = {
   "Arial",
   "Comic Sans MS",
   "Courier New",
   "Georgia",
   "Impact",
   "Monotype",
   "Symbol",
   "Times New Roman",
   "Trebuchet MS",
   "Verdana",
   "Webdings",
   "Wingdings",
   0,
};

static const char *gFontList2[] = {
   "FreeSans",
   "FreeSerif",
   "FreeMono",
   "OpenSymbol",
   0
};
*/

//_____________________________________________________________________________
//
// TGFontDialog
//
// Font selection dialog, allowing to select one in the list of available fonts
// in the system.
//_____________________________________________________________________________

ClassImp(TGFontDialog)

//________________________________________________________________________________
TGFontDialog::TGFontDialog(const TGWindow *p, const TGWindow *t,
                           FontProp_t *fontProp, const TString &sample,
                           char **fontList, Bool_t wait) :
              TGTransientFrame(p, t, 100, 100)
{
   // Create font dialog. When closed via OK button fontProp is set to
   // the newly selected font. If closed via Cancel button or WM close box
   // fontProp->fName == "".

   TGLabel *lbl;
   TGHorizontalFrame *hf, *hf2;
   TGVerticalFrame *vf;
   Int_t i, w;
   UInt_t width = 0, height = 0;

   fSampleTextGC = 0;
   fLabelFont    = 0;
   fSample       = 0;
   fHitOK        = kFALSE;
   fWaitFor      = wait;
   fInitFont     = 0;
   fInitColor    = 0;
   fInitAlign    = 0;

   if (!fontProp) {
      Error("TGFontDialog", "fontProp argument may not be 0");
      return;
   }
   SetCleanup(kDeepCleanup);

   TGLayoutHints *lh1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandY);
   TGLayoutHints *lh2 = new TGLayoutHints(kLHintsLeft | kLHintsTop, 2, 0, 2, 2);

   fFontProp = fontProp;
   if (fontProp->fName == "") {
      fName      = fontList ? fontList[0] : "Arial";
      fItalic    = kFALSE;
      fBold      = kFALSE;
      fSize      = 12;
      fTextAlign = gAlignValues[6];   //kTextBottom  | kTextLeft
      fTextColor = TGFrame::GetBlackPixel();
   } else {
      fName      = fontProp->fName;
      fItalic    = fontProp->fItalic;
      fBold      = fontProp->fBold;
      fSize      = fontProp->fSize;
      fTextAlign = fontProp->fAlign;
      fTextColor = fontProp->fColor;
   }

   hf = new TGHorizontalFrame(this, 10, 10);
   AddFrame(hf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5));

   //--------------------- font names listbox

   vf = new TGVerticalFrame(hf, 10, 10);

   lbl = new TGLabel(vf, new TGString("Font:"));
   vf->AddFrame(lbl, lh2);

   fFontNames = new TGListBox(vf, kFDLG_FONTNAMES);
   fFontNames->Resize(120, fFontNames->GetDefaultHeight());

   if (gVirtualX->InheritsFrom("TGX11") || gVirtualX->InheritsFrom("TGCocoa")) {
      fFontNames->Connect("Selected(char*)", "TGFontDialog", this, "UpdateStyleSize(char*)");
   }

   fFontNames->Associate(this);
   vf->AddFrame(fFontNames,  new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));

   hf->AddFrame(vf, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY,
                                      0, 10, 2, 2));

   //--------------------- font styles listbox

   vf = new TGVerticalFrame(hf, 10, 10);

   lbl = new TGLabel(vf, new TGString("Style:"));
   vf->AddFrame(lbl, lh2);

   fFontStyles = new TGListBox(vf, kFDLG_FONTSTYLES);
   fFontStyles->Resize(80, fFontStyles->GetDefaultHeight());
   fFontStyles->Associate(this);
   vf->AddFrame(fFontStyles, lh1);

   hf->AddFrame(vf, new TGLayoutHints(kLHintsLeft | kLHintsExpandY,
                                      0, 10, 2, 2));

   //--------------------- font sizes listbox

   vf = new TGVerticalFrame(hf, 10, 10);

   lbl = new TGLabel(vf, new TGString("Size:"));
   vf->AddFrame(lbl, lh2);

   fFontSizes = new TGListBox(vf, kFDLG_FONTSIZES);
   fFontSizes->Resize(50, fFontSizes->GetDefaultHeight());
   fFontSizes->Associate(this);
   vf->AddFrame(fFontSizes, lh1);

   hf->AddFrame(vf, new TGLayoutHints(kLHintsLeft | kLHintsExpandY,
                                      0, 0, 2, 2));

   //--------------------- Text align and color

   vf = new TGVerticalFrame(hf, 10, 10);

   lbl = new TGLabel(vf, new TGString("Text Align :"));
   vf->AddFrame(lbl, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));

   fTextAligns = new TGComboBox(vf, kFDLG_FONTALIGNS);
   fTextAligns->Associate(this);
   vf->AddFrame(fTextAligns, new TGLayoutHints(kLHintsCenterX | kLHintsTop |
                                               kLHintsExpandX, 5, 5, 0, 5));

   fTextAligns->Resize(110, 20);

   vf->Layout();
   vf->Resize(vf->GetDefaultSize());

   w = hf->GetDefaultWidth();

   hf2 = new TGHorizontalFrame(vf, 10, 10);
   vf->AddFrame(hf2, new TGLayoutHints(kLHintsNormal, 0, 0, 5, 5));

   lbl = new TGLabel(hf2, new TGString("Text Color"));
   hf2->AddFrame(lbl, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5, 5, 20, 5));

   fColorSelect = new TGColorSelect(hf2, fTextColor, kFDLG_COLORSEL);
   fColorSelect->Associate(this);

   hf2->AddFrame(fColorSelect, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 20, 5));

   vf->Resize(vf->GetDefaultSize());

   hf->AddFrame(vf, new TGLayoutHints(kLHintsLeft | kLHintsExpandY | kLHintsTop,
                                      10, 0, lbl->GetDefaultHeight()+6, 0));

   //--------------------- initialize controls

   Resize(GetDefaultSize());

   Int_t cnt = 0;
   Bool_t own = kFALSE;

   if (!fontList) {
      fontList = gVirtualX->ListFonts("-*-*-*-*", 10000, cnt);
      own = kTRUE;
   }

   Build(fontList, cnt);

   for (i = 0; gAlignTypes[i] != 0; ++i) {
      fTextAligns->AddEntry(new TGString(gAlignTypes[i]), i);
   }

   for (i = 0; gAlignValues[i] != 0; ++i) {
      if (gAlignValues[i] == fTextAlign) {
         fTextAligns->Select(i);
      }
   }

   TGLBEntry *entry = fTextAligns->FindEntry("bottom center");
   if (entry)
      fTextAligns->Resize(entry->GetWidth() + 20, entry->GetHeight() > 20 ?
                          entry->GetHeight() : 20);

   vf->Layout();
   vf->Resize(vf->GetDefaultSize());

   //--------------------- sample box

   hf = new TGHorizontalFrame(this, 10, 10);
   AddFrame(hf, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 5, 5, 5, 5));

   TGGroupFrame *gf = new TGGroupFrame(hf, new TGString("Sample"));
   hf->AddFrame(gf, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 3, 3, 3, 3));

   TGCompositeFrame *cf = new TGCompositeFrame(gf, 200, 100, kSunkenFrame);
   gf->AddFrame(cf, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY |
                                      kLHintsExpandX | kLHintsExpandY,
                                      1, 1, 3, 1));

   if (sample == "")
      fSampleText = gFDLG_DEFAULTSAMPLE;
   else
      fSampleText = sample;

   for (i = 0; gFontSizes[i] != 0; ++i) {
      if (fSize == atoi(gFontSizes[i])) {
         fFontSizes->Select(i);
         break;
      }
   }

   if ((fBold == kFALSE) && (fItalic == kFALSE))
      fFontStyles->Select(0);
   if ((fBold == kTRUE) && (fItalic == kFALSE))
      fFontStyles->Select(1);
   if ((fBold == kFALSE) && (fItalic == kTRUE))
      fFontStyles->Select(2);
   if ((fBold == kTRUE) && (fItalic == kTRUE))
      fFontStyles->Select(3);

   GetFontName();   //sets fLName and other data members

   GCValues_t gcval;
   gcval.fMask = kGCForeground | kGCFont;
   gcval.fForeground = fTextColor;
   gcval.fFont = fLabelFont->GetFontHandle();
   fSampleTextGC = fClient->GetGC(&gcval, kTRUE);
   fSample = new TGLabel(cf, fSampleText); //, (*fSampleTextGC)(), (*fLabelFont)());
   fSample->SetTextJustify(gAlignValues[fTextAligns->GetSelected()]);
   cf->AddFrame(fSample, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY |
                                           kLHintsExpandX | kLHintsExpandY,
                                           1, 1, 1, 1));
   cf->Layout();
   if (own) gVirtualX->FreeFontNames(fontList);

   gf->Resize(w, 80);

   //--------------------- OK and Cancel buttons

   vf = new TGVerticalFrame(hf, 10, 10, kFixedWidth);

   TGTextButton *ok = new TGTextButton(vf, new TGHotString("&OK"), kFDLG_OK);
   ok->Associate(this);
   vf->AddFrame(ok, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 20, 5));

   TGTextButton *cancel = new TGTextButton(vf, new TGHotString("&Cancel"), kFDLG_CANCEL);
   cancel->Associate(this);
   vf->AddFrame(cancel, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));

   vf->Resize(cancel->GetDefaultWidth()+70, vf->GetDefaultHeight());

   hf->AddFrame(vf, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
   SetEditDisabled(kEditDisable);

   fInitAlign = fTextAlign;
   fInitColor = fTextColor;
   fInitFont = fLabelFont;

   fFontNames->GetScrollBar()->SetPosition(fFontNames->GetSelected()-3);
   fFontSizes->GetScrollBar()->SetPosition(fFontSizes->GetSelected()-3);
   fFontSizes->Layout();
   fFontNames->Layout();

   SetWindowName("Font Selection");
   SetIconName("Font Selection");
   SetClassHints("ROOT", "FontDialog");

   SetMWMHints(kMWMDecorAll | kMWMDecorResizeH  | kMWMDecorMaximize |
                              kMWMDecorMinimize | kMWMDecorMenu,
               kMWMFuncAll  | kMWMFuncResize    | kMWMFuncMaximize |
                              kMWMFuncMinimize,
               kMWMInputModeless);

   //---- set minimum size to the dialog box
   width  = GetDefaultWidth();
   height = GetDefaultHeight();
   MapSubwindows();
   Resize(width, height);

   //---- position the dialog relative to the parent's window
   CenterOnParent();

   // set minimum size
   SetWMSize(width, height);
   SetWMSizeHints(width, height, 10000, 10000, 0, 0);

   if (fWaitFor) {
      MapWindow();
      fClient->WaitForUnmap(this);
      DeleteWindow();
   }
}

//________________________________________________________________________________
TGFontDialog::~TGFontDialog()
{
   // Delete all widgets.

   //fClient->FreeFont(fLabelFont);
   fClient->FreeGC(fSampleTextGC);
}

//________________________________________________________________________________
void TGFontDialog::CloseWindow()
{
   // Called when window is closed via window manager.

   if (fWaitFor) {
      UnmapWindow();
      return;
   }

   if (!fHitOK) {
      fFontProp->fName = "";

      if (fInitFont) {
         SetFont(fInitFont);
         FontSelected((char*)fInitFont->GetName());
      }
      if (fInitColor) {
         SetColor(fInitColor);
         ColorSelected(fInitColor);
      }

      if (fInitAlign) {
         SetAlign(fInitAlign);
         AlignSelected(fInitAlign);
      }
   }
   fFontNames->Select(0);
   fFontStyles->Select(0);
   fFontSizes->Select(0);

   // don't call DeleteWindow() here since that will cause access
   // to the deleted dialog in the WaitFor() method (see ctor)
   UnmapWindow();
}

//________________________________________________________________________________
Bool_t TGFontDialog::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
{
   // Handle dialog events.

   switch (GET_MSG(msg)) {
      case kC_COMMAND:
         switch (GET_SUBMSG(msg)) {
            case kCM_BUTTON:
               switch (parm1) {

                  case kFDLG_OK:
                     fHitOK             = kTRUE;
                     fFontProp->fName   = fName;
                     fFontProp->fItalic = fItalic;
                     fFontProp->fBold   = fBold;
                     fFontProp->fSize   = fSize;
                     fFontProp->fColor  = fTextColor;
                     fFontProp->fAlign  = fTextAlign;
                     CloseWindow();
                     break;
                  case kFDLG_CANCEL:
                     fHitOK = kFALSE;
                     CloseWindow();
                     break;
               }
               break;

            case kCM_LISTBOX:
               GetFontName();
               break;

            case kCM_COMBOBOX:
               GetFontName();
               break;

            default:
               break;
         }
         break;

      case kC_COLORSEL:
         switch (GET_SUBMSG(msg)) {

            case kCOL_SELCHANGED:
               {
                  if (parm2 != (Int_t)fTextColor) {
                     fTextColor = parm2;
                     GetFontName();
                  }
               }
               break;

            default:
               break;
         }
         break;

      default:
         break;
   }
   return kTRUE;
}

//________________________________________________________________________________
Bool_t TGFontDialog::Build(char **fontList, Int_t cnt)
{
   // Build font dialog.

   TString family;
   TString font;

   Int_t  i;
   fNumberOfFonts = 1;
   Int_t n1, n2;

   for (i = 0; i < cnt; i++) {
      font = fontList[i];
      n1 = font.Index("-", 1);
      n2 = font.Index("-", n1+1);
      family = font(n1+1, n2-n1-1);

      if ((family.Length() == 0) || (family.BeginsWith("@"))) {
         continue;
      }

      if (!fFontNames->FindEntry(family.Data())) {
         fFontNames->AddEntry(family.Data(), fNumberOfFonts++);
      }
   }

   fFontNames->SortByName();

   TGTextLBEntry *le = (TGTextLBEntry*)fFontNames->FindEntry(fName.Data());

   if (le) {
      fFontNames->Select(le->EntryId());
   }

   UpdateStyleSize(fName.Data());

   return kTRUE;
}

//________________________________________________________________________________
void TGFontDialog::UpdateStyleSize(const char *family)
{
   // Build font style and size list boxes

   if (!family) {
      return;
   }

   TString font = family;
   Bool_t styles[4] = { kFALSE, kFALSE, kFALSE, kFALSE };
   Int_t cnt = 0;
   Int_t i = 0;

   TString fname;
   char **fontList = 0;

   fname = TString::Format("-*-%s-*-*", family);
   fontList = gVirtualX->ListFonts(fname.Data(), 1000, cnt);

   fFontSizes->RemoveEntries(0, 1000);
   fFontSizes->Layout();

   fFontStyles->RemoveEntries(0, 100);
   fFontStyles->Layout();

   if (!cnt || !fontList) {
      return;
   }

   TString style1;
   TString style2;
   TString sz;
   TString name;
   Int_t n1, n2;
   Bool_t x11 = gVirtualX->InheritsFrom("TGX11");
   Bool_t all_sizes = !x11;
   Bool_t all_styles = !x11;

   //
   if (gVirtualX->InheritsFrom("TGCocoa")) {
      all_sizes = kTRUE;
      all_styles = kFALSE;
   }

   int szn = 0;

   fFontSizes->AddEntry("12", szn++);

   for (i = 0; i < cnt; i++) {
      name = fontList[i];
      n1 = name.Index(family);

      if (n1 == kNPOS) {
         break;
      }
      n1 += font.Length() + 1;
      n2 = name.Index("-", n1);
      if (n2 == kNPOS) {
         break;
      }

      style1 = name(n1, n2 - n1);

      n1 = n2 + 1;
      n2 = name.Index("-", n1);
      if (n2 == kNPOS) {
         break;
      }
      style2 = name(n1, n2 - n1);

      if ((style1 == "normal") || (style1 == "medium")) {
         if (style2 == "r") {
            styles[0]  = kTRUE;
            gFontStylesReal[0] = style1 + "-" + style2;
         } else if (style2 == "i") {
            styles[2]  = kTRUE;
            gFontStylesReal[2] = style1 + "-" + style2;
         } else if (style2 == "o") {
            styles[2]  = kTRUE;
            gFontStylesReal[2] = style1 + "-" + style2;
         }
      } else if (style1 == "bold") {
         if (style2 == "r") {
            styles[1]  = kTRUE;
            gFontStylesReal[1] = style1 + "-" + style2;
         } else if (style2 == "i") {
            styles[3]  = kTRUE;
            gFontStylesReal[3] = style1 + "-" + style2;
         } else if (style2 == "o") {
            styles[3]  = kTRUE;
            gFontStylesReal[3] = style1 + "-" + style2;
         }
      } else if (style1 == "(null)") {
         styles[0]  = kTRUE;
         gFontStylesReal[0] = "normal-r";
         styles[1]  = kTRUE;
         gFontStylesReal[1] = "bold-r";
         styles[2]  = kTRUE;
         gFontStylesReal[2] = "normal-i";
         styles[3]  = kTRUE;
         gFontStylesReal[3] = "bold-i";
      }

      n1++;
      n2 = name.Index("-", n1);
      n1 = n2 + 1;
      n2 = name.Index("-", n1);
      n1 = n2 + 1;

      if (n2 != kNPOS) {
         n1 = n2 + 2;
         n2 = name.Index("-", n1);
         sz = name(n1, n2 - n1);
         if (!sz.IsDigit()) {
            continue;
         }

         all_sizes = (sz == "0") && !x11;
         if (!all_sizes) {
            sz.Strip();
            if (sz.Length() == 1) {
               sz = " " + sz;
            }
            if (!fFontSizes->FindEntry(sz.Data())) {
               fFontSizes->AddEntry(sz.Data(), szn++);
            }
         }
      }
   }
   gVirtualX->FreeFontNames(fontList);

   Bool_t nostyles = kTRUE;
   for (i = 0; gFontStyles[i] != 0; ++i) {
      if (all_styles || styles[i]) {
         nostyles = kFALSE;
         fFontStyles->AddEntry(new TGString(gFontStyles[i]), i);
      }
   }

   if (nostyles && x11) {
      fFontStyles->AddEntry(new TGString(gFontStyles[0]), 0);
      fBold = kFALSE;
      fItalic = kFALSE;
   }

   if (!fBold) {
      if (!fItalic) {
         fFontStyles->Select(0);
      } else {
         fFontStyles->Select(2);
      }
   } else {
      if (!fItalic) {
         fFontStyles->Select(1);
      } else {
         fFontStyles->Select(3);
      }
   }

//   if (nostyles) {
//      fFontNames->RemoveEntry(fFontNames->FindEntry(family)->EntryId());
//   }

   fFontStyles->MapSubwindows();
   fFontStyles->Layout();
//

   sz = TString::Format("%d", fSize);
   if (sz.Length() == 1) {
      sz = " " + sz;
   }

   for (i = 0; gFontSizes[i] != 0; ++i) {
      if (all_sizes && !fFontSizes->FindEntry(gFontSizes[i])) {
         fFontSizes->AddEntry(new TGString(gFontSizes[i]), i);
      }
      if (sz == gFontSizes[i]) {
         fFontSizes->Select(i);
      }
   }

   fFontSizes->SortByName();
   fFontSizes->MapSubwindows();
   fFontSizes->Layout();
}

//________________________________________________________________________________
void TGFontDialog::GetFontName()
{
   // Sets fLName and other data members.

   TGTextLBEntry *e;
   const char *size, *name;
   Int_t sel;
   Int_t sav = gErrorIgnoreLevel;
   gErrorIgnoreLevel = kFatal;

   TString oldName = fName;
   e = (TGTextLBEntry *) fFontNames->GetSelectedEntry();

   if (!e) {
      fFontNames->Select(1);
      e = (TGTextLBEntry *) fFontNames->GetSelectedEntry();
   }
   name = e ? e->GetText()->GetString() : "";
   fName = name;

   e = (TGTextLBEntry *) fFontSizes->GetSelectedEntry();
   size = e ? e->GetText()->GetString() : "0";
   fSize = atoi(size);

   sel = fFontStyles->GetSelected();
   if (sel < 0) sel = 0;

   switch(sel) {
      case 0:
         fItalic = kFALSE;
         fBold   = kFALSE;
         break;
      case 1:
         fItalic = kFALSE;
         fBold   = kTRUE;
         break;
      case 2:
         fItalic = kTRUE;
         fBold   = kFALSE;
         break;
      case 3:
         fItalic = kTRUE;
         fBold   = kTRUE;
         break;
      default:
         fItalic = kFALSE;
         fBold   = kFALSE;
         break;
   }

   const char *rgstry = "*";

   if ((fName == "Symbol") || (fName == "Webdings") || (fName == "Wingdings")) {
      rgstry = "microsoft";
   }

   TString oldFont = fLName;
   fLName = TString::Format("-*-%s-%s-*-*-%s-*-*-*-*-*-%s-*", name,
                            gFontStylesReal[sel].Data(), size, rgstry);

   if (oldFont != fLName) {
      if (fLabelFont) {
         //fClient->FreeFont(fLabelFont);
         fLabelFont = fClient->GetFont(fLName, kFALSE);

         if (!fLabelFont) {
            fLabelFont = fClient->GetFont("fixed");
         }
      } else {
         fLabelFont = fClient->GetFont("fixed");
      }

      if (!fLabelFont) {
         // should not happen
         fLName = oldFont;
      }
      else if (fSample) {
         fSample->SetTextFont(fLabelFont);
      }
   }

   Int_t oldAlign = fTextAlign;

   Int_t idx = fTextAligns->GetSelected();
   fTextAlign = gAlignValues[idx >= 0 ? idx : 6];

   if (fSample) {
      if (fTextAlign != oldAlign) {
         fSample->SetTextJustify(fTextAlign);
         AlignSelected(fTextAlign);
      }
      fSample->SetTextColor(fTextColor);
      fColorSelect->SetColor(fTextColor, kFALSE);
      ColorSelected(fTextColor);
   }
   FontSelected((char*)fLName.Data());
   fClient->NeedRedraw(this);
   gErrorIgnoreLevel = sav;
}

//________________________________________________________________________________
void TGFontDialog::SetFont(TGFont *font)
{
   // Set font

   if (!font) {
      return;
   }
   TString name = font->GetName();

   if (name.Index("-", 1) == kNPOS) {
      return;
   }

   if (fSample) {
      fLabelFont = font;
      fSample->SetTextFont(fLabelFont);
   }
   fInitFont = font;

   TString style1;
   TString style2;
   TString sz;

   TString family;
   Int_t n1, n2;

   n1 = name.Index("-", 1);
   n2 = name.Index("-", n1 + 1);
   n1++;
   family = name(n1, n2 - n1);

   TGTextLBEntry *le = (TGTextLBEntry*)fFontNames->FindEntry(family.Data());

   if (le) {
      fFontNames->Select(le->EntryId());
   }

   n1 = n2 + 1;
   n2 = name.Index("-", n1);

   style1 = name(n1, n2 - n1);

   n1 = n2 + 1;
   n2 = name.Index("-", n1);
   if (n2 == kNPOS) {
      return;
   }
   style2 = name(n1, n2 - n1);

   if ((style1 == "normal") || (style1 == "medium")) {
      if (style2 == "r") {
         fFontStyles->Select(0);
      } else if (style2 == "i") {
         fFontStyles->Select(2);
      } else if (style2 == "o") {
         fFontStyles->Select(2);
      }
   } else if (style1 == "bold") {
      if (style2 == "r") {
         fFontStyles->Select(1);
      } else if (style2 == "i") {
         fFontStyles->Select(3);
      } else if (style2 == "o") {
         fFontStyles->Select(3);
      }
   }
   n1++;
   n2 = name.Index("-", n1);
   n1 = n2 + 1;
   n2 = name.Index("-", n1);
   n1 = n2 + 1;
   n2 = name.Index("-", n1);
   n1 = n2 + 1;
   if (n2 != kNPOS) {
      n1 = n2 + 1;
      n2 = name.Index("-", n1);
      sz = name(n1, n2 - n1);

      le = (TGTextLBEntry*)fFontSizes->FindEntry(sz.Data());
      if (le) {
         fFontSizes->Select(le->EntryId());
      }
   }
}

//________________________________________________________________________________
void TGFontDialog::SetColor(Pixel_t color)
{
   // Set color

   if (fSample) {
      fTextColor = color;
      fSample->SetTextColor(fTextColor);
   }
   fColorSelect->SetColor(color, kFALSE);
   fClient->NeedRedraw(fColorSelect);
   fInitColor = color;
}

//________________________________________________________________________________
void TGFontDialog::SetAlign(Int_t align)
{
   // Set align

   if (fSample) {
      fTextAlign = align;
      fSample->SetTextJustify(fTextAlign);
   }

   for (int i = 0; gAlignValues[i] != 0; ++i) {
      if (gAlignValues[i] == align) {
         fTextAligns->Select(i);
      }
   }
   fInitAlign = align;
   fClient->NeedRedraw(fTextAligns);
}

//________________________________________________________________________________
void TGFontDialog::EnableAlign(Bool_t on)
{
   // Enable/disable align combobox

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