KiCad PCB EDA Suite
Loading...
Searching...
No Matches
wx_progress_reporters.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2017 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * Author: Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef WX_PROGRESS_REPORTERS_H
24#define WX_PROGRESS_REPORTERS_H
25
26#include <wx/progdlg.h>
27#include <wx/gauge.h>
28#include <wx/appprogress.h>
29
31
32#define PR_NO_ABORT 0
33#define PR_CAN_ABORT wxPD_CAN_ABORT
34
35
36#if defined( _WIN32 ) && wxCHECK_VERSION( 3, 3, 0 )
37// In order to get a dark mode compatible progress dialog on Windows with wx 3.3
38#define WX_PROGRESS_REPORTER_BASE wxGenericProgressDialog
39#else
40#define WX_PROGRESS_REPORTER_BASE wxProgressDialog
41#endif
42
50{
51public:
67 WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& aTitle, int aNumPhases, int aCanAbort,
68 bool aReserveSpaceForMessage = true );
70
74 void SetTitle( const wxString& aTitle ) override
75 {
76 WX_PROGRESS_REPORTER_BASE::SetTitle( aTitle );
77 }
78
79private:
80 bool updateUI() override;
81
82private:
83 wxAppProgressIndicator m_appProgressIndicator;
85};
86
87
88class GAUGE_PROGRESS_REPORTER : public PROGRESS_REPORTER_BASE, public wxGauge
89{
90public:
98 GAUGE_PROGRESS_REPORTER( wxWindow* aParent, int aNumPhases );
99
100private:
101 bool updateUI() override;
102};
103
104#endif
GAUGE_PROGRESS_REPORTER(wxWindow *aParent, int aNumPhases)
void SetTitle(const wxString &aTitle) override
Change the title displayed on the window caption.
wxAppProgressIndicator m_appProgressIndicator
WX_PROGRESS_REPORTER(wxWindow *aParent, const wxString &aTitle, int aNumPhases, int aCanAbort, bool aReserveSpaceForMessage=true)
The PROGRESS_REPORTER will stay on top of aParent.
#define WX_PROGRESS_REPORTER_BASE