|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // Copyright(C) 2006 Simon Howard 00005 // 00006 // This program is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU General Public License 00008 // as published by the Free Software Foundation; either version 2 00009 // of the License, or (at your option) any later version. 00010 // 00011 // This program is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with this program; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00019 // 02111-1307, USA. 00020 // 00021 00022 #ifndef TXT_TABLE_H 00023 #define TXT_TABLE_H 00024 00045 typedef struct txt_table_s txt_table_t; 00046 00047 #include "txt_widget.h" 00048 00049 struct txt_table_s 00050 { 00051 txt_widget_t widget; 00052 00053 // Widgets in this table 00054 // The widget at (x,y) in the table is widgets[columns * y + x] 00055 00056 txt_widget_t **widgets; 00057 int num_widgets; 00058 00059 // Number of columns 00060 00061 int columns; 00062 00063 // Currently selected 00064 00065 int selected_x; 00066 int selected_y; 00067 }; 00068 00069 extern txt_widget_class_t txt_table_class; 00070 00071 void TXT_InitTable(txt_table_t *table, int columns); 00072 00080 txt_table_t *TXT_NewTable(int columns); 00081 00093 txt_table_t *TXT_NewHorizBox(TXT_UNCAST_ARG(first_widget), ...); 00094 00104 txt_widget_t *TXT_GetSelectedWidget(TXT_UNCAST_ARG(table)); 00105 00123 void TXT_AddWidget(TXT_UNCAST_ARG(table), TXT_UNCAST_ARG(widget)); 00124 00136 void TXT_AddWidgets(TXT_UNCAST_ARG(table), ...); 00137 00152 int TXT_SelectWidget(TXT_UNCAST_ARG(table), TXT_UNCAST_ARG(widget)); 00153 00171 void TXT_SetColumnWidths(TXT_UNCAST_ARG(table), ...); 00172 00179 void TXT_ClearTable(TXT_UNCAST_ARG(table)); 00180 00192 int TXT_PageTable(TXT_UNCAST_ARG(table), int pagex, int pagey); 00193 00194 #endif /* #ifndef TXT_TABLE_T */ 00195 00196