1 #ifndef SPRINGLOBBY_HEADERGUARD_BATTLELISTCTRL_H 2 #define SPRINGLOBBY_HEADERGUARD_BATTLELISTCTRL_H 3 4 #include "battlelistfilter.h" 5 #include "battlelist.h" 6 7 #include "customvirtlistctrl.h" 8 9 class wxMenu; 10 class IBattle; 11 class wxListEvent; 12 class wxCommandEvent; 13 class Ui; 14 15 /** \brief The ListCtrll contained in BattleListTab dispalying all currently active battles with their infos 16 * \todo DOCMEMORE */ 17 class BattleListCtrl : public CustomVirtListCtrl< IBattle *, BattleListCtrl> 18 { 19 public: 20 BattleListCtrl( wxWindow* parent ); 21 ~BattleListCtrl(); 22 23 void AddBattle( IBattle& battle ); 24 void RemoveBattle( IBattle& battle ); 25 void UpdateBattle( IBattle& battle ); 26 27 28 void OnListRightClick( wxListEvent& event ); 29 void OnDLMap( wxCommandEvent& event ); 30 void OnDLMod( wxCommandEvent& event ); 31 virtual void SetTipWindowText( const long item_hit, const wxPoint& position); 32 33 //these are overloaded to use list in virtual style 34 wxString GetItemText(long item, long column) const; 35 int GetItemImage(long item) const; 36 int GetItemColumnImage(long item, long column) const; 37 wxListItemAttr * GetItemAttr(long item) const; 38 39 enum { 40 BLIST_LIST = wxID_HIGHEST, 41 BLIST_DLMOD, 42 BLIST_DLMAP 43 }; 44 45 46 protected: 47 static int CompareStatus( DataType u1, DataType u2 ); 48 static int ComparePlayer( DataType u1, DataType u2 ); 49 50 int CompareOneCrit( DataType u1, DataType u2, int col, int dir ) const; 51 int GetIndexFromData( const DataType& data ) const; 52 53 wxMenu* m_popup; 54 55 virtual void Sort(); 56 57 DECLARE_EVENT_TABLE() 58 }; 59 60 61 62 #endif // SPRINGLOBBY_HEADERGUARD_BATTLELISTCTRL_H 63 64 /** 65 This file is part of SpringLobby, 66 Copyright (C) 2007-2011 67 68 SpringLobby is free software: you can redistribute it and/or modify 69 it under the terms of the GNU General Public License version 2 as published by 70 the Free Software Foundation. 71 72 SpringLobby is distributed in the hope that it will be useful, 73 but WITHOUT ANY WARRANTY; without even the implied warranty of 74 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 75 GNU General Public License for more details. 76 77 You should have received a copy of the GNU General Public License 78 along with SpringLobby. If not, see <http://www.gnu.org/licenses/>. 79 **/ 80 81