diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-27 17:35:17 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-12-27 17:35:17 +0100 |
| commit | 53090ab2a300c413257ae9aa8b5b6592a029c9b7 (patch) | |
| tree | caa5194fed4a0dbec90b5f3cd94b7683b679e093 /src/base_tab/GameListManager.hpp | |
| parent | d6e8d80a8f921d12562ad39b0a4bde0d34036448 (diff) | |
Cleaning code
Diffstat (limited to 'src/base_tab/GameListManager.hpp')
| -rw-r--r-- | src/base_tab/GameListManager.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/base_tab/GameListManager.hpp b/src/base_tab/GameListManager.hpp index cebd5d3..3499aac 100644 --- a/src/base_tab/GameListManager.hpp +++ b/src/base_tab/GameListManager.hpp @@ -10,8 +10,10 @@ #define BG_IMPORT(INDEX) game_list->SetItemBackgroundColour(INDEX, *wxBLUE) #define DISPLAY_ALL_ROWS() {for(int i=0;i<rows.size();i++){DisplayRow(i);}} +///@brief Column content type typedef std::string CType; +///@brief Row item content typedef struct Item { long id; CType White; @@ -22,6 +24,10 @@ typedef struct Item { CType Eco; } RType; +/** + * @brief A manager for wxListCtrl that display games + * + */ class GameListManager { long game_counter; wxListCtrl *game_list; @@ -30,17 +36,25 @@ class GameListManager { void DisplayRow(long id); void ClearDisplayedRow(); public: + /// @brief Accessible outside (DO NOT MODIFY FROM OUTSIDE) std::vector<RType> rows; GameListManager(wxListCtrl *game_list); + /// @brief Add a game to the list long AddGame(CType White,CType Black,CType Event,CType Round, CType Result, CType Eco); - void Clear(); void MarkItemAsOpen(long item); void MarkItemAsDeleted(long item); void MarkItemAsImported(long item); + /// @brief Clear the state of the GameListManager + void Clear(); + /// @brief Return the id of the selected items std::vector<long> GetSelectedItems(); + /// @brief Get the game id from the item id long GetItemGameId(long item); + /// @brief Filter the rows given terms void Filter(std::string terms); + /// @brief Remove all filters void ClearFilter(); + /// @brief Sort items by the given column void SortBy(short col); };
\ No newline at end of file |
