// generated by Extended Fast Light User Interface Designer (eFluid) version 2,0003

#include "ekeyconf.h"
// EControl applet for keyboard shortcuts
// Copyright (c) 2005. EDE Authors
// This program is licenced under terms of the
// GNU General Public Licence version 2 or newer.
// See COPYING for details
//
#include <efltk/Fl_Locale.h>
#include <edeconf.h>
#include "Shortcut_Button.h"
#include "ekeys.h"
Fl_Window* iconsConfWindow;

static void cb_OK(Fl_Button*, void*) {
	writeKeysConfiguration();
	sendUpdateInfo();
	exit(0);
}

static void cb_Cancel(Fl_Button*, void*) {
	exit(0);
}

static void cb_Apply(Fl_Button*, void*) {
	writeKeysConfiguration();
	sendUpdateInfo();
}
Shortcut_Button* shortcut;

static void cb_shortcut(Shortcut_Button*, void*) {
	setshortcutfor(action->value(),shortcut->svalue);
}
Fl_Input_Browser* action;

static void cb_action(Fl_Input_Browser*, void*) {
	shortcut->svalue = getshortcutfor(action->value());
	shortcut->redraw();
}

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

	Fl_Window* w;
	fl_init_locale_support("ekeyconf", PREFIX"/share/locale");
	readKeysConfiguration();
	 {Fl_Window* o = iconsConfWindow = new Fl_Window(275, 269, _("Keyboard settings"));
		w = o;
		o->shortcut(0xff1b);
		 {Fl_Button* o = new Fl_Button(20, 240, 80, 25, _("&OK"));
			o->callback((Fl_Callback*)cb_OK);
		}
		 {Fl_Button* o = new Fl_Button(190, 240, 80, 24, _("&Cancel"));
			o->callback((Fl_Callback*)cb_Cancel);
		}
		 {Fl_Button* o = new Fl_Button(105, 240, 80, 24, _("&Apply"));
			o->callback((Fl_Callback*)cb_Apply);
		}
		 {Fl_Tabs* o = new Fl_Tabs(3, 5, 265, 229);
			o->color((Fl_Color)0xfffffffe);
			 {Fl_Group* o = new Fl_Group(1, 24, 263, 204, _("Shortcuts"));
				o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
				 {Shortcut_Button* o = shortcut = new Shortcut_Button(21, 86, 140, 20, _("Keyboard shortcut:"));
					o->box(FL_DOWN_BOX);
					o->color((Fl_Color)7);
					o->callback((Fl_Callback*)cb_shortcut);
					o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
					o->tooltip(_("To set a shortcut:\n   Click here, then type the key combination you want.\nT\
o delete the shortcut:\n   Click here, then type backspace.\nTo get out of sho\
rtcut-setting mode:\n   Click the mouse on this again, or on some other field."));
				}
				 {Fl_Input_Browser* o = action = new Fl_Input_Browser(21, 35, 165, 21, _("Action:")); o->begin();
//					o->button_box(FL_(null));
					o->callback((Fl_Callback*)cb_action);
					o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
					action->value("Next window");
					o->end();
				}
				o->end();
			}
			o->end();
		}
		o->end();
		o->resizable(o);
	}
	populatelist(action);
	shortcut->svalue = getshortcutfor("Next window");
	shortcut->redraw();
	w->show(argc, argv);
	return  Fl::run();
}
