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 (C) 2021 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, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef WX_PROGRESS_REPORTERS_H
28#define WX_PROGRESS_REPORTERS_H
29
30#include <wx/progdlg.h>
31#include <wx/gauge.h>
32#include <wx/appprogress.h>
33
35
42class WX_PROGRESS_REPORTER : public PROGRESS_REPORTER_BASE, public wxProgressDialog
43{
44public:
60 WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& aTitle, int aNumPhases,
61 bool aCanAbort = true, bool aReserveSpaceForMessage = true );
63
67 void SetTitle( const wxString& aTitle ) override
68 {
69 wxProgressDialog::SetTitle( aTitle );
70 }
71
72private:
73 bool updateUI() override;
74
75private:
76 wxAppProgressIndicator m_appProgressIndicator;
78};
79
80
81class GAUGE_PROGRESS_REPORTER : public PROGRESS_REPORTER_BASE, public wxGauge
82{
83public:
91 GAUGE_PROGRESS_REPORTER( wxWindow* aParent, int aNumPhases );
92
93private:
94 bool updateUI() override;
95};
96
97#endif
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
void SetTitle(const wxString &aTitle) override
Change the title displayed on the window caption.
wxAppProgressIndicator m_appProgressIndicator