mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-05-06 11:43:56 +00:00
25 lines
1,018 B
C++
25 lines
1,018 B
C++
![]() |
#include "GameListManager.hpp"
|
||
|
|
||
|
|
||
|
GameListManager::GameListManager(wxListCtrl *game_list): game_list(game_list), game_counter(0) {
|
||
|
game_list->InsertColumn(0, L"Id", wxLIST_FORMAT_LEFT, 50);
|
||
|
game_list->InsertColumn(1, L"White", wxLIST_FORMAT_LEFT, 200);
|
||
|
game_list->InsertColumn(2, L"Black", wxLIST_FORMAT_LEFT, 200);
|
||
|
game_list->InsertColumn(3, L"Event", wxLIST_FORMAT_LEFT, 150);
|
||
|
game_list->InsertColumn(4, L"Round", wxLIST_FORMAT_LEFT, 100);
|
||
|
game_list->InsertColumn(5, L"Result", wxLIST_FORMAT_LEFT, 200);
|
||
|
game_list->InsertColumn(6, L"ECO", wxLIST_FORMAT_LEFT, 200);
|
||
|
}
|
||
|
|
||
|
void GameListManager::AddGame(CType W,CType B,CType Evt,CType Rnd, CType Res, CType Eco){
|
||
|
long index =
|
||
|
game_list->InsertItem(0, std::to_string(game_counter)); // want this for col. 1
|
||
|
game_list->SetItem(index, 1, W);
|
||
|
game_list->SetItem(index, 2, B);
|
||
|
game_list->SetItem(index, 3, Evt);
|
||
|
game_list->SetItem(index, 4, Rnd);
|
||
|
game_list->SetItem(index, 5, Res);
|
||
|
game_list->SetItem(index, 6, Eco);
|
||
|
game_counter++;
|
||
|
}
|