package org.herac.tuxguitar.app.view.dialog.settings.items;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FontDialog;
import org.eclipse.swt.widgets.ToolBar;
import org.herac.tuxguitar.app.TuxGuitar;
import org.herac.tuxguitar.app.system.config.TGConfigKeys;
import org.herac.tuxguitar.app.view.dialog.settings.TGSettingsEditor;
import org.herac.tuxguitar.util.TGSynchronizer;

public class StylesOption extends Option {
	
	private static final int BUTTON_WIDTH = 200;
	private static final int BUTTON_HEIGHT = 0;
	
	protected boolean initialized;
	protected FontData defaultFontData;
	protected FontData noteFontData;
	protected FontData timeSignatureFontData;
	protected FontData textFontData;
	protected FontData lyricFontData;
	protected FontData printerDefaultFontData;
	protected FontData printerNoteFontData;
	protected FontData printerTSFontData;
	protected FontData printerTextFontData;
	protected FontData printerLyricFontData;
	
	protected Button defaultFontButton;
	protected Button noteFontButton;
	protected Button timeSignatureFontButton;
	protected Button textFontButton;
	protected Button lyricFontButton;
	
	protected Button printerDefaultFontButton;
	protected Button printerNoteFontButton;
	protected Button printerTSFontButton;
	protected Button printerTextFontButton;
	protected Button printerLyricFontButton;
	
	protected ButtonColor scoreNoteColorButton;
	protected ButtonColor tabNoteColorButton;
	protected ButtonColor playNoteColorButton;
	protected ButtonColor linesColorButton;
	
	public StylesOption(TGSettingsEditor configEditor,ToolBar toolBar,final Composite parent){
		super(configEditor,toolBar,parent,TuxGuitar.getProperty("settings.config.styles"));
		this.initialized = false;
		this.defaultFontData = new FontData();
		this.noteFontData = new FontData();
		this.timeSignatureFontData = new FontData();
		this.textFontData = new FontData();
		this.lyricFontData = new FontData();
		this.printerDefaultFontData = new FontData();
		this.printerNoteFontData = new FontData();
		this.printerTSFontData = new FontData();
		this.printerTextFontData = new FontData();
		th