diff --git a/field.cpp b/field.cpp index 6674d3b..cc174b5 100644 --- a/field.cpp +++ b/field.cpp @@ -56,9 +56,6 @@ wxButton * Field::GetButton() void Field::OnButtonClick(wxCommandEvent& event) { - button->SetFont(wxFont(13, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false)); - button->Enable(false); - if(type == FIELD_MINE) { button->SetForegroundColour(wxColor(255,0,0)); @@ -66,7 +63,6 @@ void Field::OnButtonClick(wxCommandEvent& event) } else { - button->SetForegroundColour(wxColor(0,255,0)); MainFrame * parent = dynamic_cast(GetParent()); parent->UnCover(x,y); } diff --git a/minesweeper.cpp b/minesweeper.cpp index a8c227e..521d353 100644 --- a/minesweeper.cpp +++ b/minesweeper.cpp @@ -119,7 +119,9 @@ void MainFrame::UnCover(int x, int y) lh.push(matrix[x - 1][y - 1]); } + matrix[x][y]->GetButton()->SetFont(wxFont(13, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false)); matrix[x][y]->GetButton()->SetLabel(wxString::Format("%d", countMines)); + matrix[x][y]->GetButton()->Enable(false); visited[matrix[x][y]->GetID()] = true; while (lh.size() > 0 && countMines == 0)