mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-07 02:26:29 +02:00
Update tab manager
This commit is contained in:
parent
3b7cc1c847
commit
273610cb0f
3 changed files with 18 additions and 4 deletions
|
@ -7,13 +7,13 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file)
|
||||||
|
|
||||||
// Games tab
|
// Games tab
|
||||||
games_tab=new BaseGameTab((wxFrame *)notebook,base_file);
|
games_tab=new BaseGameTab((wxFrame *)notebook,base_file);
|
||||||
notebook->AddPage(games_tab, "Games",true); // true for selecting the tab
|
notebook->AddPage(games_tab, "Games list",true); // true for selecting the tab
|
||||||
// Import tab
|
// Import tab
|
||||||
import_tab=new BaseImportTab((wxFrame *)notebook);
|
import_tab=new BaseImportTab((wxFrame *)notebook);
|
||||||
notebook->AddPage(import_tab, "Import");
|
notebook->AddPage(import_tab, "Import games");
|
||||||
// Manage tab
|
// Manage tab
|
||||||
manage_tab=new BaseManageTab((wxFrame *)notebook);
|
manage_tab=new BaseManageTab((wxFrame *)notebook);
|
||||||
notebook->AddPage(manage_tab, "Manage");
|
notebook->AddPage(manage_tab, "Manage database");
|
||||||
|
|
||||||
RefreshLabel();
|
RefreshLabel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,3 +16,9 @@ void Abort(std::string msg) {
|
||||||
dial->ShowModal();
|
dial->ShowModal();
|
||||||
wxLogFatalError(wxString(msg));
|
wxLogFatalError(wxString(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long TabInfos::tab_count=0;
|
||||||
|
void TabInfos::Link(TabInfos *tab){
|
||||||
|
this->is_linked=true;
|
||||||
|
this->linked_id=tab->id;
|
||||||
|
}
|
|
@ -53,10 +53,18 @@ class GameBase;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class TabInfos {
|
class TabInfos {
|
||||||
|
static long tab_count;
|
||||||
public:
|
public:
|
||||||
typedef enum Type { GAME, BASE, ENGINE, NONE } Type;
|
typedef enum Type { GAME, BASE, ENGINE, NONE } Type;
|
||||||
Type type;
|
Type type;
|
||||||
TabInfos(Type type_) : type(type_) {}
|
/// @brief Each tab has an associated unique id
|
||||||
|
long id;
|
||||||
|
/// @brief Specify to which tab id this tab is linked (e.g: database to linked to game tab)
|
||||||
|
long linked_id;
|
||||||
|
/// @brief Set to true if this tab is attach to another one (c.f linked_id)
|
||||||
|
bool is_linked;
|
||||||
|
TabInfos(Type type_) : type(type_), id(tab_count), is_linked(false) { tab_count++; }
|
||||||
|
void Link(TabInfos *tab);
|
||||||
virtual void ApplyPreferences() = 0;
|
virtual void ApplyPreferences() = 0;
|
||||||
virtual std::shared_ptr<Game> GetGame() = 0;
|
virtual std::shared_ptr<Game> GetGame() = 0;
|
||||||
virtual std::shared_ptr<GameBase> GetBase() = 0;
|
virtual std::shared_ptr<GameBase> GetBase() = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue