|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // $Id: lst_custom.h 1788 2010-08-24 04:42:57Z russellrice $ 00005 // 00006 // Copyright (C) 2006-2010 by The Odamex Team. 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation; either version 2 00011 // of the License, or (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // DESCRIPTION: 00019 // Custom list control, featuring sorting 00020 // AUTHOR: Russell Rice 00021 // 00022 //----------------------------------------------------------------------------- 00023 00024 00025 #ifndef LST_CUSTOM_H 00026 #define LST_CUSTOM_H 00027 00028 #include <wx/listctrl.h> 00029 #include <wx/sizer.h> 00030 #include <wx/artprov.h> 00031 #include <wx/image.h> 00032 #include <wx/imaglist.h> 00033 00034 class wxAdvancedListCtrl : public wxListCtrl 00035 { 00036 public: 00037 wxAdvancedListCtrl() { }; 00038 virtual ~wxAdvancedListCtrl() { }; 00039 00040 void SetSortColumnAndOrder(wxInt32 &Column, wxInt32 &Order) 00041 { 00042 SortCol = Column; 00043 SortOrder = Order; 00044 00045 SetSortArrow(SortCol, SortOrder); 00046 } 00047 00048 void GetSortColumnAndOrder(wxInt32 &Column, wxInt32 &Order) 00049 { 00050 Column = SortCol; 00051 Order = SortOrder; 00052 } 00053 00054 void Sort(); 00055 00056 int AddImageSmall(wxImage Image); 00057 long ALCInsertItem(const wxString &Text = wxT("")); 00058 00059 wxEvent *Clone(void); 00060 00061 private: 00062 void OnCreateControl(wxWindowCreateEvent &event); 00063 void OnHeaderColumnButtonClick(wxListEvent &event); 00064 00065 void ColourList(); 00066 void ColourListItem(wxListItem &info); 00067 void ColourListItem(long item); 00068 00069 void ResetSortArrows(void); 00070 void SetSortArrow(wxInt32 Column, wxInt32 ArrowState); 00071 00072 void FlipRow(long Row, long NextRow); 00073 void Sort(wxInt32 Column, wxInt32 Order = 0, wxInt32 Lowest = 0, wxInt32 Highest = -1); 00074 00075 wxInt32 SortOrder; 00076 wxInt32 SortCol; 00077 00078 wxColour ItemShade; 00079 00080 protected: 00081 DECLARE_DYNAMIC_CLASS(wxAdvancedListCtrl) 00082 DECLARE_EVENT_TABLE() 00083 }; 00084 00085 #endif