KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kistatusbar.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) 2023 Mark Roszko <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef KISTATUSBAR_H
26#define KISTATUSBAR_H
27
28#include <kicommon.h>
29#include <optional>
30
31class wxGauge;
32class wxButton;
33class wxStaticText;
34class BITMAP_BUTTON;
35
44
45class KICOMMON_API KISTATUSBAR : public wxStatusBar
46{
47public:
48 enum STYLE_FLAGS : int
49 {
50 NONE_STYLE = 0x00,
53 };
54
55 static constexpr auto DEFAULT_STYLE =
57
58 KISTATUSBAR( int aNumberFields, wxWindow* parent, wxWindowID id,
59 STYLE_FLAGS aFlags = DEFAULT_STYLE );
60
62
69 void SetEllipsedTextField( const wxString& aText, int aFieldId );
70
74 void ShowBackgroundProgressBar( bool aCancellable = false );
75
80
84 void SetBackgroundProgress( int aAmount );
85
89 void SetBackgroundProgressMax( int aAmount );
90
94 void SetBackgroundStatusText( const wxString& aTxt );
95
101 void SetNotificationCount( int aCount );
102
103private:
104 void onSize( wxSizeEvent& aEvent );
105 void onBackgroundProgressClick( wxMouseEvent& aEvent );
106 void onNotificationsIconClick( wxCommandEvent& aEvent );
107
115
116 std::optional<int> fieldIndex( FIELD aField ) const;
117
118private:
121 wxStaticText* m_backgroundTxt;
125};
126
127#endif
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
STYLE_FLAGS m_styleFlags
BITMAP_BUTTON * m_notificationsButton
void SetBackgroundStatusText(const wxString &aTxt)
Set the status text that displays next to the progress bar.
void onBackgroundProgressClick(wxMouseEvent &aEvent)
KISTATUSBAR(int aNumberFields, wxWindow *parent, wxWindowID id, STYLE_FLAGS aFlags=DEFAULT_STYLE)
void onSize(wxSizeEvent &aEvent)
int m_normalFieldsCount
void SetBackgroundProgress(int aAmount)
Set the current progress of the progress bar.
wxGauge * m_backgroundProgressBar
wxButton * m_backgroundStopButton
void SetEllipsedTextField(const wxString &aText, int aFieldId)
Set the text in a field using wxELLIPSIZE_MIDDLE option to adjust the text size to the field size.
void HideBackgroundProgressBar()
Hide the background progress bar.
void onNotificationsIconClick(wxCommandEvent &aEvent)
void SetBackgroundProgressMax(int aAmount)
Set the max progress of the progress bar.
wxStaticText * m_backgroundTxt
void ShowBackgroundProgressBar(bool aCancellable=false)
Show the background progress bar.
static constexpr auto DEFAULT_STYLE
Definition kistatusbar.h:55
void SetNotificationCount(int aCount)
Set the notification count on the notifications button.
#define KICOMMON_API
Definition kicommon.h:28