00001 /* 00002 * Copyright (C) 2000-2002 The Exult Team 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef _FILE_GUMP_H_ 00020 #define _FILE_GUMP_H_ 00021 00022 #include "Modal_gump.h" 00023 00024 class Gump_text; 00025 00026 /* 00027 * The file save/load box: 00028 */ 00029 class File_gump : public Modal_gump 00030 { 00031 UNREPLICATABLE_CLASS_I(File_gump,Modal_gump(0,0,0,0)); 00032 00033 protected: 00034 static short textx, texty; // Where to draw first text field. 00035 static short texth; // Distance down to next text field. 00036 static short btn_rows[2]; // y-coord of each button row. 00037 static short btn_cols[3]; // x-coord of each button column. 00038 Gump_text *names[10]; // 10 filename slots. 00039 Gump_button *buttons[6]; // 2 rows, 3 cols of buttons. 00040 Gump_text *pushed_text; // Text mouse is down on. 00041 Gump_text *focus; // Text line that has focus. 00042 unsigned char restored; // Set to 1 if we restored a game. 00043 00044 public: 00045 File_gump(); 00046 ~File_gump(); 00047 // Find savegame index of text field. 00048 int get_save_index(Gump_text *txt); 00049 void remove_focus(); // Unfocus text. 00050 void load(); // 'Load' was clicked. 00051 void save(); // 'Save' was clicked. 00052 void quit(); // 'Quit' was clicked. 00053 // Handle one of the toggles. 00054 int toggle_option(Gump_button *btn); 00055 int restored_game() // 1 if user restored. 00056 { return restored; } 00057 // Paint it and its contents. 00058 virtual void paint(); 00059 virtual void close() 00060 { done = 1; } 00061 // Handle events: 00062 virtual void mouse_down(int mx, int my); 00063 virtual void mouse_up(int mx, int my); 00064 virtual void text_input(int chr, int unicode); // Character typed. 00065 }; 00066 00067 #endif
1.5.1