// generated by Fast Light User Interface Designer (fluid) version 2.0100

#include "ecolorconf.h"
/*
 * $Id$
 *
 * Colors and fonts settings
 * Part of Equinox Desktop Environment (EDE).
 * Copyright (c) 2000-2006 EDE Authors.
 *
 * This program is licenced under terms of the
 * GNU General Public Licence version 2 or newer.
 * See COPYING for details.
 */
#include "../edeconf.h"
#include <fltk/ColorChooser.h>
#include "ecolorutils.h"

fltk::Window *windowColorSettings=(fltk::Window *)0;

static void cb_windowColorSettings(fltk::Window*, void*) {
  exit(0);
}

fltk::Button *colorBox=(fltk::Button *)0;

fltk::Button *labelColorBox=(fltk::Button *)0;

fltk::Button *selectionColorBox=(fltk::Button *)0;

fltk::Button *selectionTextColorBox=(fltk::Button *)0;

fltk::Button *highlightColorBox=(fltk::Button *)0;

fltk::Button *highlightLabelColorBox=(fltk::Button *)0;

fltk::Button *textColorBox=(fltk::Button *)0;

fltk::Button *backgroundBox=(fltk::Button *)0;

fltk::Button *textBackgroundBox=(fltk::Button *)0;

fltk::Button *tooltipBox=(fltk::Button *)0;

fltk::Button *tooltipTextColorButton=(fltk::Button *)0;

fltk::CheckButton *tooltipsEnableEffects=(fltk::CheckButton *)0;

fltk::CheckButton *tooltipsEnable=(fltk::CheckButton *)0;

fltk::Choice *tooltipsEffectType=(fltk::Choice *)0;

fltk::ValueInput *tooltipsDelay=(fltk::ValueInput *)0;

fltk::Button *setLabelFont=(fltk::Button *)0;

static void cb_setLabelFont(fltk::Button*, void*) {
  labelfont_cb();
}

fltk::Button *setTextFont=(fltk::Button *)0;

static void cb_setTextFont(fltk::Button*, void*) {
  textfont_cb();
}

fltk::InvisibleBox *labelFontInput=(fltk::InvisibleBox *)0;

fltk::InvisibleBox *textFontInput=(fltk::InvisibleBox *)0;

fltk::CheckButton *menusEnableEffects=(fltk::CheckButton *)0;

fltk::CheckButton *menusEnableSubwindowEffects=(fltk::CheckButton *)0;

fltk::Choice *menusEffectType=(fltk::Choice *)0;

fltk::ValueInput *menusSpeed=(fltk::ValueInput *)0;

fltk::ValueInput *menusDelay=(fltk::ValueInput *)0;

fltk::CheckButton *mdiAnimation=(fltk::CheckButton *)0;

fltk::CheckButton *mdiOpaqueAnimation=(fltk::CheckButton *)0;

fltk::CheckButton *imagesStateEffect=(fltk::CheckButton *)0;

static void cb_Save(fltk::Button*, void*) {
  saveSchemeAs();
}

fltk::CheckButton *allApplyRadioButton=(fltk::CheckButton *)0;

fltk::InputBrowser *schemeListBox=(fltk::InputBrowser *)0;

static void cb_schemeListBox(fltk::InputBrowser*, void*) {
  getSchemeColors();
}

static void cb_OK(fltk::Button*, void*) {
  //windowColorSettings->hide();
  saveActiveScheme();
  applyColors();
  saveEfltkConfig();
  exit(0);
}

static void cb_Apply(fltk::Button*, void*) {
  saveActiveScheme();
  applyColors();
  saveEfltkConfig();
}

static void cb_Cancel(fltk::Button*, void*) {
  exit(0);
}

#include <fltk/run.h>

int main (int argc, char **argv) {

  fltk::Window* w;
  //fl_init_locale_support("ecolorconf", PREFIX"/share/locale");
   {fltk::Window* o = windowColorSettings = new fltk::Window(330, 360, "Colors and fonts settings");
    w = o;
    o->set_vertical();
    o->callback((fltk::Callback*)cb_windowColorSettings);
    o->begin();
     {fltk::TabGroup* o = new fltk::TabGroup(5, 5, 318, 200);
      o->color((fltk::Color)0xfffffffe);
      o->begin();
       {fltk::Group* o = new fltk::Group(0, 25, 318, 175, "Default colors");
        o->begin();
         {fltk::Button* o = colorBox = new fltk::Button(90, 30, 65, 20, "Widgets");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = labelColorBox = new fltk::Button(15, 75, 65, 20, "Label");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = selectionColorBox = new fltk::Button(240, 120, 65, 20, "Sel. back.");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = selectionTextColorBox = new fltk::Button(165, 120, 65, 20, "Selection");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = highlightColorBox = new fltk::Button(165, 30, 65, 20, "Highlight");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = highlightLabelColorBox = new fltk::Button(165, 75, 65, 20, "Highlight");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = textColorBox = new fltk::Button(15, 120, 65, 20, "Text");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = backgroundBox = new fltk::Button(15, 30, 65, 20, "Background");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
         {fltk::Button* o = textBackgroundBox = new fltk::Button(90, 120, 65, 20, "Background");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        }
        o->end();
      }
       {fltk::Group* o = new fltk::Group(0, 26, 318, 169, "Tooltips");
        o->hide();
        o->begin();
         {fltk::Button* o = tooltipBox = new fltk::Button(156, 44, 65, 20, "Tooltip color");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_WRAP);
        }
         {fltk::Button* o = tooltipTextColorButton = new fltk::Button(236, 44, 65, 20, "Tooltip text color");
          o->buttonbox(fltk::DOWN_BOX);
          o->callback((fltk::Callback*)ChangeBoxColor);
          o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_WRAP);
        }
        tooltipsEnableEffects = new fltk::CheckButton(10, 39, 145, 25, "Enable effects");
        tooltipsEnable = new fltk::CheckButton(10, 14, 145, 25, "Enabled");
         {fltk::Choice* o = tooltipsEffectType = new fltk::Choice(75, 80, 115, 23, "Effect type:");
          o->align(fltk::ALIGN_CENTER);
          o->begin();
          new fltk::Item("None");
          new fltk::Item("Animation");
          new fltk::Item("Fading");
          o->end();
        }
        tooltipsDelay = new fltk::ValueInput(75, 119, 50, 25, "Delay:");
        o->end();
      }
       {fltk::Group* o = new fltk::Group(0, 26, 318, 169, "Fonts");
        o->hide();
        o->begin();
         {fltk::Button* o = setLabelFont = new fltk::Button(275, 14, 30, 25, "...");
          o->callback((fltk::Callback*)cb_setLabelFont);
        }
         {fltk::Button* o = setTextFont = new fltk::Button(275, 49, 30, 25, "...");
          o->callback((fltk::Callback*)cb_setTextFont);
        }
         {fltk::InvisibleBox* o = labelFontInput = new fltk::InvisibleBox(75, 14, 190, 25, "label");
          o->box(fltk::DOWN_BOX);
          o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE);
        }
         {fltk::InvisibleBox* o = textFontInput = new fltk::InvisibleBox(75, 50, 190, 24, "label");
          o->box(fltk::DOWN_BOX);
          o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE);
        }
         {fltk::InvisibleBox* o = new fltk::InvisibleBox(15, 14, 65, 25, "Label font:");
          o->align(fltk::ALIGN_RIGHT|fltk::ALIGN_INSIDE);
        }
         {fltk::InvisibleBox* o = new fltk::InvisibleBox(15, 49, 65, 25, "Text font:");
          o->align(fltk::ALIGN_RIGHT|fltk::ALIGN_INSIDE);
        }
        o->end();
        o->label(_(o->label()));
      }
       {fltk::Group* o = new fltk::Group(0, 26, 318, 174, "Menus");
        o->hide();
        o->begin();
        menusEnableEffects = new fltk::CheckButton(10, 14, 305, 25, "Enable effects");
        menusEnableSubwindowEffects = new fltk::CheckButton(10, 39, 305, 25, "Enable subwindow effects");
         {fltk::Choice* o = menusEffectType = new fltk::Choice(75, 80, 115, 23, "Effect type:");
          o->align(fltk::ALIGN_CENTER);
          o->begin();
          new fltk::Item("None");
          new fltk::Item("Animation");
          new fltk::Item("Fading");
          o->end();
        }
        menusSpeed = new fltk::ValueInput(75, 119, 45, 25, "Speed:");
        menusDelay = new fltk::ValueInput(211, 119, 50, 25, "Delay:");
        o->end();
      }
       {fltk::Group* o = new fltk::Group(0, 26, 318, 174, "Others");
        o->hide();
        o->begin();
        mdiAnimation = new fltk::CheckButton(11, 14, 300, 25, "Enable MDI animation");
        mdiOpaqueAnimation = new fltk::CheckButton(11, 44, 300, 25, "MDI opaque animation");
        imagesStateEffect = new fltk::CheckButton(11, 74, 300, 25, "Enable images state effect");
        o->end();
      }
      o->end();
    }
     {fltk::Group* o = new fltk::Group(3, 210, 320, 110);
      o->box(fltk::DOWN_BOX);
      o->begin();
       {fltk::Button* o = new fltk::Button(194, 25, 80, 25, "&Save as...");
        o->callback((fltk::Callback*)cb_Save);
      }
       {fltk::CheckButton* o = allApplyRadioButton = new fltk::CheckButton(6, 65, 299, 25, "Ap&ply colors to all programs");
        o->when(fltk::WHEN_CHANGED);
      }
       {fltk::InputBrowser* o = schemeListBox = new fltk::InputBrowser(9, 27, 175, 23, "Schemes:");
        o->callback((fltk::Callback*)cb_schemeListBox);
        o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
        o->when(fltk::WHEN_CHANGED);
        o->type(1);
        o->begin();
        fillItems();
        o->end();
      }
      o->end();
    }
     {fltk::Button* o = new fltk::Button(75, 328, 80, 25, "&OK");
      o->callback((fltk::Callback*)cb_OK);
    }
     {fltk::Button* o = new fltk::Button(160, 328, 80, 25, "&Apply");
      o->callback((fltk::Callback*)cb_Apply);
    }
     {fltk::Button* o = new fltk::Button(245, 328, 80, 25, "&Cancel");
      o->callback((fltk::Callback*)cb_Cancel);
    }
    o->end();
    o->resizable(o);
  }
  //updateFontAll();
  loadEfltkConfig();
  w->show(argc, argv);
  return  fltk::run();
}

void ChangeBoxColor(fltk::Button *box, void *) {
  //Fl_Button *colorBox = box;
  fltk::Color oldColor = box->color();
  fltk::Color defColor = oldColor;
  fltk::color_chooser(_("Choose color"), defColor);
  if (defColor != oldColor) 
  {
  	box->color(defColor);
  	box->highlight_color(defColor);
  	box->redraw();
  }
}
