mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-07 02:26:29 +02:00
Tabs can be marked as dirty
This commit is contained in:
parent
c046216e10
commit
335547e081
2 changed files with 8 additions and 1 deletions
|
@ -66,6 +66,11 @@ MainWindow::MainWindow()
|
||||||
void MainWindow::OnAuiNotebookPageCheck(wxAuiNotebookEvent& event){
|
void MainWindow::OnAuiNotebookPageCheck(wxAuiNotebookEvent& event){
|
||||||
// TODO: Ask the user before closing
|
// TODO: Ask the user before closing
|
||||||
//event.Veto();
|
//event.Veto();
|
||||||
|
int selection=event.GetSelection();
|
||||||
|
TabInfos *t=dynamic_cast<TabInfos *>(notebook->GetPage(selection));
|
||||||
|
if(t->is_dirty){
|
||||||
|
wxLogDebug("Tab was dirty");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::AddPage(wxWindow* window, TabInfos* infos){
|
void MainWindow::AddPage(wxWindow* window, TabInfos* infos){
|
||||||
|
|
|
@ -53,7 +53,9 @@ public:
|
||||||
long linked_id;
|
long linked_id;
|
||||||
/// @brief Set to true if this tab is attach to another one (c.f linked_id)
|
/// @brief Set to true if this tab is attach to another one (c.f linked_id)
|
||||||
bool is_linked;
|
bool is_linked;
|
||||||
TabInfos(Type type_) : type(type_), id(tab_count), is_linked(false) { tab_count++; }
|
/// @brief True if current tab is dirty
|
||||||
|
bool is_dirty;
|
||||||
|
TabInfos(Type type_) : type(type_), id(tab_count), is_linked(false), is_dirty(false) { tab_count++; }
|
||||||
void Link(TabInfos *tab);
|
void Link(TabInfos *tab);
|
||||||
virtual void Refresh(){};
|
virtual void Refresh(){};
|
||||||
/// @brief Call when tab is linked to another one
|
/// @brief Call when tab is linked to another one
|
||||||
|
|
Loading…
Add table
Reference in a new issue