Planeshift
|
00001 /* 00002 * pawspetitionwindow.h - Author: Alexander Wiseman 00003 * 00004 * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org) 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation (version 2 of the License) 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 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 00020 #ifndef PAWS_PETITION_WINDOW_HEADER 00021 #define PAWS_PETITION_WINDOW_HEADER 00022 00023 #include "paws/pawswidget.h" 00024 #include "paws/pawslistbox.h" 00025 #include "paws/pawsbutton.h" 00026 #include "paws/pawsstringpromptwindow.h" 00027 #include "gui/pawscontrolwindow.h" 00028 00030 enum { 00031 PCOL_GM = 0, 00032 PCOL_STATUS = 1, 00033 PCOL_CREATED = 2, 00034 PCOL_PETITION = 3 00035 }; 00036 00040 #define MAX_PETITION_LENGTH (65) 00041 00042 00054 class pawsPetitionWindow : public pawsControlledWindow, public psCmdBase, public iOnStringEnteredAction 00055 { 00056 public: 00058 pawsPetitionWindow(); 00059 00061 virtual ~pawsPetitionWindow(); 00062 00063 virtual void Show(); 00064 00066 void HandleMessage( MsgEntry* message ); 00067 00069 const char* HandleCommand(const char* cmd); 00070 00072 bool PostSetup(); 00073 00075 bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget* reporter); 00076 00077 void OnListAction( pawsListBox* selected, int status ); 00078 00079 void Close(); 00083 void OnStringEntered(const char *name, int param,const char *value); 00084 00085 protected: 00086 00088 void QueryServer(); 00089 00091 void SetText(size_t rowNum, int colNum, const char* fmt, ...); 00092 00094 void AddPetitions(csArray<psPetitionInfo> &petitions); 00095 00097 pawsListBox* petitionList; 00098 00100 int currentRow; 00101 00103 psPetitionMessage petitionMessage; 00104 00106 int petCount; 00107 00110 bool hasPetInterest; 00111 00113 psPetitionInfo selectedPet; 00114 00116 pawsMultilineEditTextBox * petText; 00117 00118 bool updateSelectedPetition; 00119 00120 }; 00121 00124 CREATE_PAWS_FACTORY( pawsPetitionWindow ); 00125 00126 #endif