00001 /* 00002 * Configurable text colors 00003 * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> 00004 * 00005 * This file is part of The Mana World. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 #ifndef SETUP_COLORS_H 00023 #define SETUP_COLORS_H 00024 00025 #include "gui/setuptab.h" 00026 00027 #include "gui/widgets/textfield.h" 00028 00029 #include "guichanfwd.h" 00030 00031 #include <guichan/actionlistener.hpp> 00032 00033 #include <string> 00034 00035 class BrowserBox; 00036 class TextPreview; 00037 00038 class Setup_Colors : public SetupTab, public gcn::ActionListener, 00039 public TextFieldListener 00040 { 00041 public: 00042 Setup_Colors(); 00043 ~Setup_Colors(); 00044 00045 void apply(); 00046 void cancel(); 00047 void action(const gcn::ActionEvent &event); 00048 00049 void listen(const TextField *tf); 00050 00051 private: 00052 static const std::string rawmsg; 00053 00054 gcn::ListBox *mColorBox; 00055 gcn::ScrollArea *mScroll; 00056 BrowserBox *mPreview; 00057 TextPreview *mTextPreview; 00058 gcn::ScrollArea *mPreviewBox; 00059 int mSelected; 00060 00061 gcn::Label *mGradTypeLabel; 00062 gcn::Slider *mGradTypeSlider; 00063 gcn::Label *mGradTypeText; 00064 00065 gcn::Label *mGradDelayLabel; 00066 gcn::Slider *mGradDelaySlider; 00067 TextField *mGradDelayText; 00068 00069 gcn::Label *mRedLabel; 00070 gcn::Slider *mRedSlider; 00071 TextField *mRedText; 00072 int mRedValue; 00073 00074 gcn::Label *mGreenLabel; 00075 gcn::Slider *mGreenSlider; 00076 TextField *mGreenText; 00077 int mGreenValue; 00078 00079 gcn::Label *mBlueLabel; 00080 gcn::Slider *mBlueSlider; 00081 TextField *mBlueText; 00082 int mBlueValue; 00083 00084 void setEntry(gcn::Slider *s, TextField *t, int value); 00085 void updateColor(); 00086 void updateGradType(); 00087 }; 00088 00089 #endif