[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a71c8cd 4/8: Use wxSizerFlags for creating th
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a71c8cd 4/8: Use wxSizerFlags for creating the "About" dialog |
Date: |
Mon, 19 Apr 2021 20:37:29 -0400 (EDT) |
branch: master
commit a71c8cd22e84127adc3779a8d8f019b6df77cd04
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use wxSizerFlags for creating the "About" dialog
This is more readable than using overloaded wxSizer::Add() and avoids
clang warnings about using bitwise operations on the values of different
enum types (wxDirection and wxAlignment).
---
about_dialog.cpp | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/about_dialog.cpp b/about_dialog.cpp
index af13152..c4b8303 100644
--- a/about_dialog.cpp
+++ b/about_dialog.cpp
@@ -78,13 +78,15 @@ int AboutDialog::ShowModal()
,"Let me illustrate"
);
+ auto const borderFlags = wxSizerFlags().Border(wxALL, 3);
+
wxBoxSizer* sizer1 = new(wx) wxBoxSizer(wxHORIZONTAL);
- sizer1->Add(license_button, 0, wxALL, 3);
- sizer1->Add(cancel_button , 0, wxALL, 3);
+ sizer1->Add(license_button, borderFlags);
+ sizer1->Add(cancel_button , borderFlags);
wxBoxSizer* sizer0 = new(wx) wxBoxSizer(wxVERTICAL);
- sizer0->Add(html_window, 1, wxALL , 0);
- sizer0->Add(sizer1 , 0, wxALL | wxALIGN_RIGHT, 3);
+ sizer0->Add(html_window, wxSizerFlags().Proportion(1) );
+ sizer0->Add(sizer1 , wxSizerFlags(borderFlags).Right());
SetSizerAndFit(sizer0);
Center();
@@ -115,8 +117,8 @@ void AboutDialog::UponReadLicense(wxCommandEvent&)
button->SetDefault();
wxBoxSizer* sizer = new(wx) wxBoxSizer(wxVERTICAL);
- sizer->Add(html_window, 1, wxALL | wxEXPAND , 0);
- sizer->Add(button , 0, wxALL | wxALIGN_RIGHT, 6);
+ sizer->Add(html_window, wxSizerFlags().Proportion(1).Expand() );
+ sizer->Add(button , wxSizerFlags().Right().Border(wxALL, 6));
dialog.SetSizerAndFit(sizer);
wxRect r = wxDisplay(wxDisplay::GetFromWindow(this)).GetClientArea();
- [lmi-commits] [lmi] master updated (9414edf -> 5aa44f4), Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master d9e35c2 2/8: Remove an unimportant comment, Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master 7f8f3e0 1/8: Fix defect introduced 20210418T2056Z: nonzero default value, Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master 85076e0 7/8: Disable -Wunused-parameter warning in Boost.Numeric header, Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master a71c8cd 4/8: Use wxSizerFlags for creating the "About" dialog,
Greg Chicares <=
- [lmi-commits] [lmi] master 3d3f40e 3/8: Update coding-rule exemptions, Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master 57f608a 5/8: Disable clang enum-related warnings in C++20 mode, Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master b538769 6/8: Use std::endian when using C++20, Greg Chicares, 2021/04/19
- [lmi-commits] [lmi] master 5aa44f4 8/8: Disable clang warnings about using volatile in C++20 mode, Greg Chicares, 2021/04/19