blob: 31452976842940a87ad22974ce3ba4ca1801da22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#pragma once
#include "ochess.hpp"
#include <algorithm>
#include <vector>
#define TERMS_IN(COL) (row.COL.find(terms) != std::string::npos)
#define BG_OPEN(INDEX) game_list->SetItemBackgroundColour(INDEX, *wxGREEN)
#define BG_DELETE(INDEX) game_list->SetItemBackgroundColour(INDEX, *wxRED)
#define DISPLAY_ALL_ROWS() {for(int i=0;i<rows.size();i++){DisplayRow(i);}}
typedef std::string CType;
typedef struct Item {
long id;
CType White;
CType Black;
CType Event;
CType Round;
CType Result;
CType Eco;
} RType;
class GameListManager {
long game_counter;
wxListCtrl *game_list;
std::vector<long> deleted_games, opened_games;
void DisplayRow(long id);
void ClearDisplayedRow();
public:
std::vector<RType> rows;
GameListManager(wxListCtrl *game_list);
void AddGame(CType White,CType Black,CType Event,CType Round, CType Result, CType Eco);
void Clear();
void MarkItemAsOpen(long item);
void MarkItemAsDeleted(long item);
std::vector<long> GetSelectedItems();
long GetItemGameId(long item);
void Filter(std::string terms);
void ClearFilter();
void SortBy(short col);
};
|