Skip to content

Commit

Permalink
Added clock UI
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykorir committed Jun 11, 2024
1 parent 89f7b63 commit 2ed31e5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"files.associations": {
"*.xpm": "cpp"
}
}
Binary file modified bin/Debug/minesweeper
Binary file not shown.
18 changes: 8 additions & 10 deletions minesweeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ MainFrame::MainFrame(const wxString &title)
wxBoxSizer * dashSizer = new wxBoxSizer(wxHORIZONTAL);
wxGridSizer * gridSizer = new wxGridSizer(9, 9, 0, 0);

wxSize size = GetClientSize();
topPanel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxSize(size.GetWidth(), 50),wxBORDER_SIMPLE);
text = new wxStaticText(topPanel,wxID_ANY,wxT("0"), wxDefaultPosition,wxDefaultSize, 0);
wxBitmap clock(clock_xpm);
wxBitmap::Rescale(clock, wxSize(32,32));
wxStaticBitmap* staticBitmap = new wxStaticBitmap(topPanel, wxID_STATIC,clock);
wxUnusedVar(staticBitmap);
dashSizer->Add(topPanel);
wxStaticBitmap* staticBitmap = new wxStaticBitmap(this, wxID_STATIC,clock);
text = new wxStaticText(this,wxID_ANY,wxT("0"), wxDefaultPosition,wxDefaultSize, 0);
dashSizer->Add(staticBitmap, 0, wxALIGN_CENTER, 10);
dashSizer->Add(text, 0, wxALIGN_CENTER, 10);

int id = 0;

Expand All @@ -50,12 +48,12 @@ MainFrame::MainFrame(const wxString &title)
}
}

topSizer->Add(dashSizer, 0, wxALIGN_CENTER_HORIZONTAL);// | wxALL,4);
topSizer->Add(gridSizer, 0, wxALIGN_CENTER);// | wxALL, 4);
topSizer->Fit(this);
topSizer->SetSizeHints(this);
topSizer->Add(dashSizer, 0, wxALIGN_CENTER | wxALL, 8);
topSizer->Add(gridSizer, 0, wxALIGN_CENTER);

SetSizer(topSizer);
topSizer->Fit(this);
topSizer->SetSizeHints(this);

Centre(wxBOTH);
}
Expand Down
4 changes: 2 additions & 2 deletions minesweeper.depend
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@
1714995324 source:/home/freedom/Desktop/work/minesweeper/minesweeper/minesweeper.cpp
"wx/wx.h"

1718137156 source:/home/freedom/Desktop/work/minesweeper/minesweeper.cpp
1718144832 source:/home/freedom/Desktop/work/minesweeper/minesweeper.cpp
"wx/wx.h"
<stdlib.h>
<vector>
Expand All @@ -1640,7 +1640,7 @@
"red.xpm"
"clock.xpm"

1717969445 source:/home/freedom/Desktop/work/minesweeper/field.cpp
1718138416 source:/home/freedom/Desktop/work/minesweeper/field.cpp
"wx/wx.h"
"field.h"
"minesweeper.h"
Expand Down
24 changes: 12 additions & 12 deletions minesweeper.layout
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="field.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="5" zoom_2="0">
<File name="minesweeper.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="7" zoom_2="0">
<Cursor>
<Cursor1 position="257" topLine="0" />
<Cursor1 position="5718" topLine="0" />
</Cursor>
</File>
<File name="red.xpm" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="field.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="5" zoom_2="0">
<Cursor>
<Cursor1 position="93" topLine="0" />
<Cursor1 position="314" topLine="54" />
</Cursor>
</File>
<File name="clock.xpm" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="field.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="109" topLine="0" />
<Cursor1 position="19" topLine="0" />
</Cursor>
</File>
<File name="field.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="minesweeper.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="19" topLine="0" />
<Cursor1 position="518" topLine="18" />
</Cursor>
</File>
<File name="minesweeper.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="7" zoom_2="0">
<File name="red.xpm" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1174" topLine="29" />
<Cursor1 position="93" topLine="0" />
</Cursor>
</File>
<File name="minesweeper.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="clock.xpm" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="518" topLine="18" />
<Cursor1 position="109" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>

0 comments on commit 2ed31e5

Please sign in to comment.