Skip to content

Commit

Permalink
Changed fonts characteristics
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykorir committed Jun 5, 2024
1 parent 8afb370 commit 29e4388
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,13 @@ 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));
button->SetLabel("M");
}
else
{
button->SetForegroundColour(wxColor(0,255,0));
MainFrame * parent = dynamic_cast<MainFrame*>(GetParent());
parent->UnCover(x,y);
}
Expand Down
2 changes: 2 additions & 0 deletions minesweeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 29e4388

Please sign in to comment.