mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-05-06 11:43:56 +00:00
Add game list manager
This commit is contained in:
parent
05ffd7c9e5
commit
8e01d5b96a
4 changed files with 46 additions and 18 deletions
24
src/base_tab/GameListManager.cpp
Normal file
24
src/base_tab/GameListManager.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#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++;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue