#include <mapgridctrl.h>
Inherits wxPanel.

Data Structures | |
| class | _Compare2 |
| struct | MapData |
Public Types | |
| enum | SortKey { SortKey_Name, SortKey_TidalStrength, SortKey_Gravity, SortKey_MaxMetal, SortKey_ExtractorRadius, SortKey_MinWind, SortKey_MaxWind, SortKey_Wind, SortKey_Area, SortKey_AspectRatio, SortKey_PosCount } |
Public Member Functions | |
| MapGridCtrl (wxWindow *parent, wxSize size=wxDefaultSize, wxWindowID id=-1) | |
| ~MapGridCtrl () | |
| void | Clear () |
| void | AddMap (const wxString &mapname) |
| void | AddMap (const UnitSyncMap &map) |
| void | CheckInBounds () |
| void | Sort (SortKey vertical, SortKey horizontal, bool vertical_direction=false, bool horizontal_direction=false) |
| template<class Predicate > | |
| int | Filter (Predicate pred) |
| UnitSyncMap * | GetSelectedMap () const |
| void | OnPaint (wxPaintEvent &event) |
| void | OnResize (wxSizeEvent &event) |
| void | OnMouseMove (wxMouseEvent &event) |
| void | OnLeftDown (wxMouseEvent &event) |
| void | OnLeftUp (wxMouseEvent &event) |
| void | OnGetMapImageAsyncCompleted (wxCommandEvent &event) |
| void | OnGetMapExAsyncCompleted (wxCommandEvent &event) |
Static Public Attributes | |
| static const wxEventType | MapSelectedEvt = wxNewEventType() |
| this event is raised each time when a new map is selected | |
| static const wxEventType | LoadingCompletedEvt = wxNewEventType() |
| this event is raised after the loading of map infos finished | |
Protected Types | |
| enum | MapState { MapState_NoMinimap, MapState_GetMinimap, MapState_GotMinimap } |
| typedef std::map< wxString, MapData > | MapMap |
Protected Member Functions | |
| template<class Compare > | |
| _Compare2< Compare > | _Compare (bool direction, Compare cmp) |
| template<class Compare > | |
| void | _Sort (int dimension, Compare cmp) |
| void | UpdateGridSize () |
| void | UpdateAsyncFetches () |
| void | FetchMapInfo (const wxString &mapname) |
| void | FetchMinimap (MapData &map) |
| void | DrawMap (wxDC &dc, MapData &map, int x, int y) |
| void | DrawBackground (wxDC &dc) |
| void | SetMinimap (MapMap &maps, const wxString &mapname, const wxBitmap &minimap) |
| void | SelectMap (MapData *map) |
Static Protected Member Functions | |
| static int | CompareName (const MapData *a, const MapData *b) |
| static int | CompareTidalStrength (const MapData *a, const MapData *b) |
| static int | CompareGravity (const MapData *a, const MapData *b) |
| static int | CompareMaxMetal (const MapData *a, const MapData *b) |
| static int | CompareExtractorRadius (const MapData *a, const MapData *b) |
| static int | CompareMinWind (const MapData *a, const MapData *b) |
| static int | CompareMaxWind (const MapData *a, const MapData *b) |
| static int | CompareWind (const MapData *a, const MapData *b) |
| static int | CompareArea (const MapData *a, const MapData *b) |
| static int | CompareAspectRatio (const MapData *a, const MapData *b) |
| static int | ComparePosCount (const MapData *a, const MapData *b) |
Protected Attributes | |
| UnitSyncAsyncOps | m_async |
| const bool | m_selection_follows_mouse |
| std::vector< wxString > | m_pending_maps |
| Set of maps which are queued to be fetched asynchronously. | |
| MapMap | m_maps |
| MapMap | m_maps_unused |
| MapMap | m_maps_filtered |
| std::vector< MapData * > | m_grid |
| wxSize | m_size |
| wxPoint | m_pos |
| wxPoint | m_first_mouse_pos |
| wxPoint | m_last_mouse_pos |
| bool | m_in_mouse_drag |
| int | m_async_mapinfo_fetches |
| Number of async minimap fetches still running on behalf of this control. | |
| int | m_async_minimap_fetches |
| Number of async minimap fetches still running on behalf of this control. | |
| MapData * | m_mouseover_map |
| Map which is currently under the mouse pointer. | |
| MapData * | m_selected_map |
| Map which was last clicked. | |
| wxImage | m_img_background |
| solid color background | |
| wxImage | m_img_minimap_alpha |
| map_select_1_png, alpha channel of this is attached to minimap before blending it over m_img_background | |
| wxImage | m_img_foreground |
| map_select_2_png, this is alpha blended on top of the minimap | |
| wxBitmap | m_img_minimap_loading |
| this is displayed for maps whose minimap has not yet been loaded | |
Definition at line 14 of file mapgridctrl.h.
typedef std::map< wxString, MapData > MapGridCtrl::MapMap [protected] |
Definition at line 104 of file mapgridctrl.h.
enum MapGridCtrl::MapState [protected] |
Definition at line 88 of file mapgridctrl.h.
| enum MapGridCtrl::SortKey |
| SortKey_Name | |
| SortKey_TidalStrength | |
| SortKey_Gravity | |
| SortKey_MaxMetal | |
| SortKey_ExtractorRadius | |
| SortKey_MinWind | |
| SortKey_MaxWind | |
| SortKey_Wind | |
| SortKey_Area | |
| SortKey_AspectRatio | |
| SortKey_PosCount |
Definition at line 23 of file mapgridctrl.h.
| MapGridCtrl::MapGridCtrl | ( | wxWindow * | parent, | |
| wxSize | size = wxDefaultSize, |
|||
| wxWindowID | id = -1 | |||
| ) |
Definition at line 48 of file mapgridctrl.cpp.
| MapGridCtrl::~MapGridCtrl | ( | ) |
Definition at line 78 of file mapgridctrl.cpp.
| _Compare2< Compare > MapGridCtrl::_Compare | ( | bool | direction, | |
| Compare | cmp | |||
| ) | [inline, protected] |
Definition at line 121 of file mapgridctrl.h.
| void MapGridCtrl::_Sort | ( | int | dimension, | |
| Compare | cmp | |||
| ) | [inline, protected] |
Definition at line 148 of file mapgridctrl.cpp.
| void MapGridCtrl::AddMap | ( | const UnitSyncMap & | map | ) |
Definition at line 235 of file mapgridctrl.cpp.
| void MapGridCtrl::AddMap | ( | const wxString & | mapname | ) |
Definition at line 215 of file mapgridctrl.cpp.
| void MapGridCtrl::CheckInBounds | ( | ) |
Definition at line 258 of file mapgridctrl.cpp.
| void MapGridCtrl::Clear | ( | ) |
Definition at line 202 of file mapgridctrl.cpp.
Definition at line 126 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareAspectRatio | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 136 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareExtractorRadius | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 110 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareGravity | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 102 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareMaxMetal | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 106 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareMaxWind | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 118 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareMinWind | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 114 of file mapgridctrl.cpp.
Definition at line 94 of file mapgridctrl.cpp.
| int MapGridCtrl::ComparePosCount | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 140 of file mapgridctrl.cpp.
| int MapGridCtrl::CompareTidalStrength | ( | const MapData * | a, | |
| const MapData * | b | |||
| ) | [inline, static, protected] |
Definition at line 98 of file mapgridctrl.cpp.
Definition at line 122 of file mapgridctrl.cpp.
| void MapGridCtrl::DrawBackground | ( | wxDC & | dc | ) | [protected] |
Definition at line 359 of file mapgridctrl.cpp.
| void MapGridCtrl::DrawMap | ( | wxDC & | dc, | |
| MapData & | map, | |||
| int | x, | |||
| int | y | |||
| ) | [protected] |
Definition at line 330 of file mapgridctrl.cpp.
| void MapGridCtrl::FetchMapInfo | ( | const wxString & | mapname | ) | [protected] |
Definition at line 307 of file mapgridctrl.cpp.
| void MapGridCtrl::FetchMinimap | ( | MapData & | map | ) | [protected] |
Definition at line 319 of file mapgridctrl.cpp.
| int MapGridCtrl::Filter | ( | Predicate | pred | ) | [inline] |
Definition at line 51 of file mapgridctrl.h.
| UnitSyncMap* MapGridCtrl::GetSelectedMap | ( | ) | const [inline] |
Definition at line 74 of file mapgridctrl.h.
| void MapGridCtrl::OnGetMapExAsyncCompleted | ( | wxCommandEvent & | event | ) |
Definition at line 544 of file mapgridctrl.cpp.
| void MapGridCtrl::OnGetMapImageAsyncCompleted | ( | wxCommandEvent & | event | ) |
Definition at line 510 of file mapgridctrl.cpp.
| void MapGridCtrl::OnLeftDown | ( | wxMouseEvent & | event | ) |
Definition at line 462 of file mapgridctrl.cpp.
| void MapGridCtrl::OnLeftUp | ( | wxMouseEvent & | event | ) |
Definition at line 471 of file mapgridctrl.cpp.
| void MapGridCtrl::OnMouseMove | ( | wxMouseEvent & | event | ) |
Definition at line 421 of file mapgridctrl.cpp.
| void MapGridCtrl::OnPaint | ( | wxPaintEvent & | event | ) |
Definition at line 371 of file mapgridctrl.cpp.
| void MapGridCtrl::OnResize | ( | wxSizeEvent & | event | ) |
Definition at line 415 of file mapgridctrl.cpp.
| void MapGridCtrl::SelectMap | ( | MapData * | map | ) | [protected] |
Definition at line 482 of file mapgridctrl.cpp.
| void MapGridCtrl::SetMinimap | ( | MapMap & | maps, | |
| const wxString & | mapname, | |||
| const wxBitmap & | minimap | |||
| ) | [protected] |
Definition at line 499 of file mapgridctrl.cpp.
| void MapGridCtrl::Sort | ( | SortKey | vertical, | |
| SortKey | horizontal, | |||
| bool | vertical_direction = false, |
|||
| bool | horizontal_direction = false | |||
| ) |
Definition at line 165 of file mapgridctrl.cpp.
| void MapGridCtrl::UpdateAsyncFetches | ( | ) | [protected] |
Definition at line 283 of file mapgridctrl.cpp.
| void MapGridCtrl::UpdateGridSize | ( | ) | [protected] |
Definition at line 248 of file mapgridctrl.cpp.
const wxEventType MapGridCtrl::LoadingCompletedEvt = wxNewEventType() [static] |
this event is raised after the loading of map infos finished
Definition at line 21 of file mapgridctrl.h.
UnitSyncAsyncOps MapGridCtrl::m_async [protected] |
Definition at line 148 of file mapgridctrl.h.
int MapGridCtrl::m_async_mapinfo_fetches [protected] |
Number of async minimap fetches still running on behalf of this control.
This number is limited so SL doesn't keep fetching maps after this control is destroyed.
Definition at line 169 of file mapgridctrl.h.
int MapGridCtrl::m_async_minimap_fetches [protected] |
Number of async minimap fetches still running on behalf of this control.
This number is limited so the control can adapt (faster) to changes in the set of visible maps. (it fetches only visible maps)
Definition at line 174 of file mapgridctrl.h.
wxPoint MapGridCtrl::m_first_mouse_pos [protected] |
Definition at line 162 of file mapgridctrl.h.
std::vector< MapData* > MapGridCtrl::m_grid [protected] |
Definition at line 158 of file mapgridctrl.h.
wxImage MapGridCtrl::m_img_background [protected] |
solid color background
Definition at line 182 of file mapgridctrl.h.
wxImage MapGridCtrl::m_img_foreground [protected] |
map_select_2_png, this is alpha blended on top of the minimap
Definition at line 187 of file mapgridctrl.h.
wxImage MapGridCtrl::m_img_minimap_alpha [protected] |
map_select_1_png, alpha channel of this is attached to minimap before blending it over m_img_background
Definition at line 185 of file mapgridctrl.h.
wxBitmap MapGridCtrl::m_img_minimap_loading [protected] |
this is displayed for maps whose minimap has not yet been loaded
Definition at line 189 of file mapgridctrl.h.
bool MapGridCtrl::m_in_mouse_drag [protected] |
Definition at line 164 of file mapgridctrl.h.
wxPoint MapGridCtrl::m_last_mouse_pos [protected] |
Definition at line 163 of file mapgridctrl.h.
MapMap MapGridCtrl::m_maps [protected] |
Definition at line 155 of file mapgridctrl.h.
MapMap MapGridCtrl::m_maps_filtered [protected] |
Definition at line 157 of file mapgridctrl.h.
MapMap MapGridCtrl::m_maps_unused [protected] |
Definition at line 156 of file mapgridctrl.h.
MapData* MapGridCtrl::m_mouseover_map [protected] |
Map which is currently under the mouse pointer.
Definition at line 177 of file mapgridctrl.h.
std::vector< wxString > MapGridCtrl::m_pending_maps [protected] |
Set of maps which are queued to be fetched asynchronously.
Definition at line 153 of file mapgridctrl.h.
wxPoint MapGridCtrl::m_pos [protected] |
Definition at line 161 of file mapgridctrl.h.
MapData* MapGridCtrl::m_selected_map [protected] |
Map which was last clicked.
Definition at line 179 of file mapgridctrl.h.
const bool MapGridCtrl::m_selection_follows_mouse [protected] |
Definition at line 150 of file mapgridctrl.h.
wxSize MapGridCtrl::m_size [protected] |
Definition at line 159 of file mapgridctrl.h.
const wxEventType MapGridCtrl::MapSelectedEvt = wxNewEventType() [static] |
this event is raised each time when a new map is selected
Definition at line 19 of file mapgridctrl.h.
1.6.3