Skip to content

Commit c1a379d

Browse files
committed
Cosmetic change in all source code header comments.
Add CodeBlocks workplace. Signed-off-by: Piotr Domański <positive.podi@gmail.com>
1 parent 439857d commit c1a379d

23 files changed

+323
-153
lines changed

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,31 @@ FodyWeavers.xsd
530530

531531
# JetBrains Rider
532532
*.sln.iml
533+
534+
############################################################
535+
# Code::Blocks IDE temporary files.
536+
############################################################
537+
538+
# specific to CodeBlocks IDE
539+
*.layout
540+
*.depend
541+
# generated directories
542+
bin/
543+
obj/
544+
545+
############################################################
546+
# CMake temporary files.
547+
############################################################
548+
CMakeLists.txt.user
549+
CMakeCache.txt
550+
CMakeFiles
551+
CMakeScripts
552+
Testing
553+
Makefile
554+
cmake_install.cmake
555+
install_manifest.txt
556+
compile_commands.json
557+
CTestTestfile.cmake
558+
_deps
559+
560+
build

Source/CAboutDialog.cpp

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

@@ -39,13 +39,11 @@ namespace WinRuler
3939
wxDELETE(m_pVersionStaticText);
4040
wxDELETE(m_pCopyrightStaticText);
4141
wxDELETE(m_pHeaderStaticBitmap);
42-
wxDELETE(m_pContentPanel);
4342
}
4443

4544
void CAboutDialog::Init()
4645
{
4746
// Set all class instances as NULL.
48-
m_pContentPanel = NULL;
4947
m_pHeaderStaticBitmap = NULL;
5048
m_pCopyrightStaticText = NULL;
5149
m_pVersionStaticText = NULL;
@@ -56,42 +54,55 @@ namespace WinRuler
5654

5755
void CAboutDialog::CreateControls()
5856
{
59-
// Create m_pContentPanel.
60-
m_pContentPanel =
61-
new wxPanel(
62-
this, wxID_ANY, wxDefaultPosition,
63-
wxDefaultSize, wxNO_BORDER | wxTAB_TRAVERSAL);
57+
// Set client size.
58+
SetClientSize(wxSize(600, 500));
6459

6560
// Create static bitmap on top.
66-
m_pHeaderStaticBitmap =
61+
m_pHeaderStaticBitmap =
6762
new wxStaticBitmap(
68-
m_pContentPanel,
69-
wxID_ANY,
63+
this, wxID_ANY,
7064
wxBitmap("../../../../Resources/About.png", wxBITMAP_TYPE_PNG),
71-
wxPoint(0, 0), wxSize(600, 300), 0);
65+
wxDefaultPosition, wxSize(600, 300), 0);
7266

7367
// Create static texts.
7468
m_pVersionStaticText =
7569
new wxStaticText(
76-
m_pContentPanel, wxID_ANY,
77-
wxString("Version 0.0.1"), wxPoint(15, 300));
70+
this, wxID_ANY,
71+
wxString("Version 0.0.1"));
7872
m_pCopyrightStaticText =
7973
new wxStaticText(
80-
m_pContentPanel, wxID_ANY,
81-
wxString("Copyright © 2024 Piotr Domanski and WinRuler programmers team."),
82-
wxPoint(15, 320));
74+
this, wxID_ANY,
75+
wxString("Copyright © 2024 Piotr Domanski and WinRuler programmers team."));
76+
77+
// Create bottom panel.
78+
wxPanel* pBottomPanel =
79+
new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 40));
8380

8481
// Create License button.
8582
m_pLicenseButton =
86-
new wxButton(
87-
m_pContentPanel, ID_LICENSE_BUTTON, "&License",
88-
wxPoint(20, 350), wxSize(60, 30));
83+
new wxButton(pBottomPanel, ID_LICENSE_BUTTON, "&License");
8984

9085
// Create Close button.
9186
m_pCloseButton =
92-
new wxButton(
93-
m_pContentPanel, wxID_OK, "&Close",
94-
wxPoint(500, 350), wxSize(60, 30));
87+
new wxButton(pBottomPanel, wxID_OK, "&Close");
88+
89+
// Create 2 wxBoxSizer and set layout.
90+
wxBoxSizer* pSizer1 = new wxBoxSizer(wxVERTICAL);
91+
92+
pSizer1->Add(m_pHeaderStaticBitmap, 0, wxEXPAND | wxALL, 5);
93+
pSizer1->Add(m_pVersionStaticText, 0, wxEXPAND | wxALL, 5);
94+
pSizer1->Add(m_pCopyrightStaticText, 0, wxEXPAND | wxALL, 5);
95+
pSizer1->Add(pBottomPanel, 0, wxEXPAND | wxALL, 5);
96+
97+
SetSizerAndFit(pSizer1);
98+
99+
wxBoxSizer* pSizer2 = new wxBoxSizer(wxHORIZONTAL);
100+
101+
pSizer2->Add(m_pLicenseButton, 0, wxEXPAND | wxALL, 5);
102+
pSizer2->AddSpacer(425);
103+
pSizer2->Add(m_pCloseButton, 0, wxEXPAND | wxALL, 5);
104+
105+
pBottomPanel->SetSizerAndFit(pSizer2);
95106
}
96107

97108
void CAboutDialog::OnLicenseButtonClicked(wxCommandEvent& WXUNUSED(Event))
@@ -111,4 +122,4 @@ namespace WinRuler
111122
// Destroy class.
112123
Destroy();
113124
}
114-
} // end namespace WinRuler
125+
} // end namespace WinRuler

Source/CAboutDialog.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

@@ -61,9 +61,6 @@ namespace WinRuler
6161

6262
void OnLicenseButtonClicked(wxCommandEvent& Event);
6363
private:
64-
// Content panel.
65-
wxPanel* m_pContentPanel;
66-
6764
// Header static bitmap.
6865
wxStaticBitmap* m_pHeaderStaticBitmap;
6966

@@ -82,4 +79,4 @@ namespace WinRuler
8279
// Close button.
8380
wxButton* m_pCloseButton;
8481
};
85-
} // end namespace WinRuler
82+
} // end namespace WinRuler

Source/CApplication.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

6-
#include "CApplication.h"
7-
#include "WRUtilities.h"
86
#include <wx/wx.h>
97
#include <wx/display.h>
108

9+
#include "CApplication.h"
10+
#include "WRUtilities.h"
11+
1112
namespace WinRuler
1213
{
1314
bool CApplication::OnInit()
@@ -22,7 +23,7 @@ namespace WinRuler
2223
wxLog::SetActiveTarget(m_pLogger);
2324
#endif
2425

25-
// Initialize all supported image handlers.
26+
// Initialize all supported image handlers.
2627
::wxInitAllImageHandlers();
2728

2829
// Retrieve PPI information for all screen detected.

Source/CApplication.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

66
#pragma once
77

88
#include <wx/wx.h>
9+
910
#include <CMainFrame.h>
1011

1112
namespace WinRuler
1213
{
1314
/**
14-
* Application class definition.
15+
* Application class definition.
1516
**/
1617
class CApplication :
1718
public wxApp
@@ -39,6 +40,7 @@ namespace WinRuler
3940
// Pointer to wxIcon.
4041
wxIcon* m_pIcon;
4142

43+
// Pointer to wxLog.
4244
wxLog* m_pLogger;
4345
};
4446
} // end namespace WinRuler

Source/CDrawPanel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

Source/CDrawPanel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

Source/CLicenseDialog.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

@@ -32,29 +32,25 @@ namespace WinRuler
3232
// Release all instances from heap.
3333
wxDELETE(m_pCloseButton);
3434
wxDELETE(m_pTextCtrl);
35-
wxDELETE(m_pContentPanel);
3635
}
3736

3837
void CLicenseDialog::Init()
3938
{
4039
// Set all class instances as NULL.
41-
m_pContentPanel = NULL;
40+
m_pTextCtrl = NULL;
4241
m_pCloseButton = NULL;
4342
}
4443

4544
void CLicenseDialog::CreateControls()
4645
{
47-
// Create m_pContentPanel.
48-
m_pContentPanel =
49-
new wxPanel(
50-
this, wxID_ANY, wxDefaultPosition,
51-
wxDefaultSize, wxNO_BORDER | wxTAB_TRAVERSAL);
46+
// Set client size.
47+
//SetClientSize(wxSize(400, 300));
5248

5349
// Create m_pTextCtrl and load it content from LICENSE file.
5450
m_pTextCtrl =
5551
new wxRichTextCtrl(
5652
this, wxID_ANY, wxEmptyString,
57-
wxPoint(10, 10), wxSize(470, 215),
53+
wxDefaultPosition, wxSize(400, 200),
5854
wxRE_MULTILINE | wxRE_READONLY);
5955
if (!m_pTextCtrl->LoadFile(
6056
wxString("../../../../LICENSE"), wxRICHTEXT_TYPE_TEXT))
@@ -66,8 +62,15 @@ namespace WinRuler
6662
m_pCloseButton =
6763
new wxButton(
6864
this, wxID_OK, wxString("&Close"),
69-
wxPoint(420, 235),
70-
wxSize(60, 30));
65+
wxDefaultPosition, wxDefaultSize);
66+
67+
// Create wxBoxSizer and apply layout.
68+
wxBoxSizer* pSizer = new wxBoxSizer(wxVERTICAL);
69+
70+
pSizer->Add(m_pTextCtrl, 0, wxEXPAND | wxALL, 5);
71+
pSizer->Add(m_pCloseButton, 0, wxEXPAND | wxALL, 5);
72+
73+
SetSizerAndFit(pSizer);
7174
}
7275

7376
void CLicenseDialog::OnClose(wxCloseEvent& Event)

Source/CLicenseDialog.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2024 Piotr Domañski
2+
* Copyright © 2024 Piotr Domanski
33
* Licensed under the MIT license.
44
**/
55

@@ -59,9 +59,6 @@ namespace WinRuler
5959
**/
6060
void OnClose(wxCloseEvent& Event);
6161
public:
62-
// Content panel.
63-
wxPanel* m_pContentPanel;
64-
6562
// Rich text control.
6663
wxRichTextCtrl* m_pTextCtrl;
6764

0 commit comments

Comments
 (0)