|
KiCad PCB EDA Suite
|
#include <kistatusbar.h>
Public Types | |
| enum | STYLE_FLAGS : int { NONE_STYLE = 0x00 , NOTIFICATION_ICON = 0x01 , CANCEL_BUTTON = 0x02 , WARNING_ICON = 0x04 } |
Public Member Functions | |
| KISTATUSBAR (int aNumberFields, wxWindow *parent, wxWindowID id, STYLE_FLAGS aFlags=DEFAULT_STYLE) | |
| ~KISTATUSBAR () | |
| 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 | ShowBackgroundProgressBar (bool aCancellable=false) |
| Show the background progress bar. | |
| void | HideBackgroundProgressBar () |
| Hide the background progress bar. | |
| void | SetBackgroundProgress (int aAmount) |
| Set the current progress of the progress bar. | |
| void | SetBackgroundProgressMax (int aAmount) |
| Set the max progress of the progress bar. | |
| void | SetBackgroundStatusText (const wxString &aTxt) |
| Set the status text that displays next to the progress bar. | |
| void | SetNotificationCount (int aCount) |
| Set the notification count on the notifications button. | |
| void | SetLoadWarningMessages (const wxString &aMessages) |
| void | ClearLoadWarningMessages () |
| void | AddLoadWarningMessages (const std::vector< LOAD_MESSAGE > &aMessages) |
| Add warning/error messages thread-safely. | |
| size_t | GetLoadWarningCount () const |
| Get current message count (thread-safe). | |
Static Public Attributes | |
| static constexpr auto | DEFAULT_STYLE |
Private Types | |
| enum class | FIELD { BGJOB_LABEL , BGJOB_GAUGE , BGJOB_CANCEL , WARNING , NOTIFICATION } |
Private Member Functions | |
| void | onSize (wxSizeEvent &aEvent) |
| void | onBackgroundProgressClick (wxMouseEvent &aEvent) |
| void | onNotificationsIconClick (wxCommandEvent &aEvent) |
| void | onLoadWarningsIconClick (wxCommandEvent &aEvent) |
| void | updateWarningUI () |
| Update warning button visibility and badge (main thread only) | |
| std::optional< int > | fieldIndex (FIELD aField) const |
Private Attributes | |
| wxGauge * | m_backgroundProgressBar |
| wxButton * | m_backgroundStopButton |
| wxStaticText * | m_backgroundTxt |
| BITMAP_BUTTON * | m_notificationsButton |
| BITMAP_BUTTON * | m_warningButton |
| std::mutex | m_loadWarningMutex |
| Protects m_loadWarningMessages. | |
| std::vector< LOAD_MESSAGE > | m_loadWarningMessages |
| int | m_normalFieldsCount |
| STYLE_FLAGS | m_styleFlags |
Definition at line 59 of file kistatusbar.h.
|
strongprivate |
| Enumerator | |
|---|---|
| BGJOB_LABEL | |
| BGJOB_GAUGE | |
| BGJOB_CANCEL | |
| WARNING | |
| NOTIFICATION | |
Definition at line 139 of file kistatusbar.h.
| enum KISTATUSBAR::STYLE_FLAGS : int |
| Enumerator | |
|---|---|
| NONE_STYLE | |
| NOTIFICATION_ICON | |
| CANCEL_BUTTON | |
| WARNING_ICON | |
Definition at line 62 of file kistatusbar.h.
| KISTATUSBAR::KISTATUSBAR | ( | int | aNumberFields, |
| wxWindow * | parent, | ||
| wxWindowID | id, | ||
| STYLE_FLAGS | aFlags = DEFAULT_STYLE ) |
Definition at line 46 of file kistatusbar.cpp.
References _, BGJOB_CANCEL, BGJOB_GAUGE, BGJOB_LABEL, CANCEL_BUTTON, fieldIndex(), HideBackgroundProgressBar(), KiBitmapBundle(), m_backgroundProgressBar, m_backgroundStopButton, m_backgroundTxt, m_normalFieldsCount, m_notificationsButton, m_styleFlags, m_warningButton, NOTIFICATION, NOTIFICATION_ICON, notifications, onBackgroundProgressClick(), onLoadWarningsIconClick(), onNotificationsIconClick(), onSize(), small_warning, WARNING, and WARNING_ICON.
| KISTATUSBAR::~KISTATUSBAR | ( | ) |
Definition at line 160 of file kistatusbar.cpp.
References m_backgroundProgressBar, m_notificationsButton, m_warningButton, onBackgroundProgressClick(), onLoadWarningsIconClick(), onNotificationsIconClick(), and onSize().
| void KISTATUSBAR::AddLoadWarningMessages | ( | const std::vector< LOAD_MESSAGE > & | aMessages | ) |
Add warning/error messages thread-safely.
Can be called from any thread. UI update is deferred to main thread.
Definition at line 339 of file kistatusbar.cpp.
References m_loadWarningMessages, m_loadWarningMutex, traceLibraries, and updateWarningUI().
| void KISTATUSBAR::ClearLoadWarningMessages | ( | ) |
Definition at line 408 of file kistatusbar.cpp.
References m_loadWarningMessages, m_loadWarningMutex, m_warningButton, and Refresh().
|
private |
Definition at line 471 of file kistatusbar.cpp.
References BGJOB_CANCEL, BGJOB_GAUGE, BGJOB_LABEL, CANCEL_BUTTON, m_styleFlags, NOTIFICATION, NOTIFICATION_ICON, WARNING, and WARNING_ICON.
Referenced by KISTATUSBAR(), onBackgroundProgressClick(), onNotificationsIconClick(), and onSize().
| size_t KISTATUSBAR::GetLoadWarningCount | ( | ) | const |
Get current message count (thread-safe).
Definition at line 359 of file kistatusbar.cpp.
References m_loadWarningMessages, and m_loadWarningMutex.
| void KISTATUSBAR::HideBackgroundProgressBar | ( | ) |
Hide the background progress bar.
Definition at line 271 of file kistatusbar.cpp.
References m_backgroundProgressBar, and m_backgroundStopButton.
Referenced by KISTATUSBAR().
|
private |
Definition at line 190 of file kistatusbar.cpp.
References BGJOB_GAUGE, fieldIndex(), PGM_BASE::GetBackgroundJobMonitor(), m_backgroundProgressBar, m_normalFieldsCount, Pgm(), and BACKGROUND_JOBS_MONITOR::ShowList().
Referenced by KISTATUSBAR(), and ~KISTATUSBAR().
|
private |
Definition at line 426 of file kistatusbar.cpp.
References _, WX_HTML_REPORT_BOX::Flush(), m_loadWarningMessages, m_loadWarningMutex, DIALOG_HTML_REPORTER::m_Reporter, WX_HTML_REPORT_BOX::Report(), and DIALOG_SHIM::ShowModal().
Referenced by KISTATUSBAR(), and ~KISTATUSBAR().
|
private |
Definition at line 174 of file kistatusbar.cpp.
References fieldIndex(), PGM_BASE::GetNotificationsManager(), m_normalFieldsCount, m_notificationsButton, NOTIFICATION, Pgm(), and NOTIFICATIONS_MANAGER::ShowList().
Referenced by KISTATUSBAR(), and ~KISTATUSBAR().
|
private |
Definition at line 205 of file kistatusbar.cpp.
References BGJOB_GAUGE, BGJOB_LABEL, fieldIndex(), KIUI::GetTextSize(), m_backgroundProgressBar, m_backgroundStopButton, m_backgroundTxt, m_normalFieldsCount, m_notificationsButton, m_warningButton, NOTIFICATION, and WARNING.
Referenced by KISTATUSBAR(), and ~KISTATUSBAR().
| void KISTATUSBAR::SetBackgroundProgress | ( | int | aAmount | ) |
Set the current progress of the progress bar.
Definition at line 280 of file kistatusbar.cpp.
References m_backgroundProgressBar.
| void KISTATUSBAR::SetBackgroundProgressMax | ( | int | aAmount | ) |
Set the max progress of the progress bar.
Definition at line 291 of file kistatusbar.cpp.
References m_backgroundProgressBar.
| void KISTATUSBAR::SetBackgroundStatusText | ( | const wxString & | aTxt | ) |
Set the status text that displays next to the progress bar.
Definition at line 297 of file kistatusbar.cpp.
References m_backgroundTxt.
| void KISTATUSBAR::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.
Definition at line 447 of file kistatusbar.cpp.
References KIUI::GetTextSize().
Referenced by PROJECT_TREE_PANE::FileWatcherReset(), KICAD_MANAGER_FRAME::OnSize(), and KICAD_MANAGER_FRAME::PrintPrjInfo().
| void KISTATUSBAR::SetLoadWarningMessages | ( | const wxString & | aMessages | ) |
Definition at line 318 of file kistatusbar.cpp.
References m_loadWarningMessages, m_loadWarningMutex, LOAD_MESSAGE::message, RPT_SEVERITY_WARNING, LOAD_MESSAGE::severity, and updateWarningUI().
| void KISTATUSBAR::SetNotificationCount | ( | int | aCount | ) |
Set the notification count on the notifications button.
A value of 0 will hide the count.
Definition at line 303 of file kistatusbar.cpp.
References m_notificationsButton, and Refresh().
Referenced by NOTIFICATIONS_MANAGER::RegisterStatusBar().
| void KISTATUSBAR::ShowBackgroundProgressBar | ( | bool | aCancellable = false | ) |
Show the background progress bar.
Definition at line 262 of file kistatusbar.cpp.
References m_backgroundProgressBar, and m_backgroundStopButton.
|
private |
Update warning button visibility and badge (main thread only)
Definition at line 366 of file kistatusbar.cpp.
References _, m_loadWarningMessages, m_loadWarningMutex, m_warningButton, Refresh(), and traceLibraries.
Referenced by AddLoadWarningMessages(), and SetLoadWarningMessages().
|
staticconstexpr |
Definition at line 70 of file kistatusbar.h.
|
private |
Definition at line 151 of file kistatusbar.h.
Referenced by HideBackgroundProgressBar(), KISTATUSBAR(), onBackgroundProgressClick(), onSize(), SetBackgroundProgress(), SetBackgroundProgressMax(), ShowBackgroundProgressBar(), and ~KISTATUSBAR().
|
private |
Definition at line 152 of file kistatusbar.h.
Referenced by HideBackgroundProgressBar(), KISTATUSBAR(), onSize(), and ShowBackgroundProgressBar().
|
private |
Definition at line 153 of file kistatusbar.h.
Referenced by KISTATUSBAR(), onSize(), and SetBackgroundStatusText().
|
private |
Definition at line 157 of file kistatusbar.h.
Referenced by AddLoadWarningMessages(), ClearLoadWarningMessages(), GetLoadWarningCount(), onLoadWarningsIconClick(), SetLoadWarningMessages(), and updateWarningUI().
|
mutableprivate |
Protects m_loadWarningMessages.
Definition at line 156 of file kistatusbar.h.
Referenced by AddLoadWarningMessages(), ClearLoadWarningMessages(), GetLoadWarningCount(), onLoadWarningsIconClick(), SetLoadWarningMessages(), and updateWarningUI().
|
private |
Definition at line 158 of file kistatusbar.h.
Referenced by KISTATUSBAR(), onBackgroundProgressClick(), onNotificationsIconClick(), and onSize().
|
private |
Definition at line 154 of file kistatusbar.h.
Referenced by KISTATUSBAR(), onNotificationsIconClick(), onSize(), SetNotificationCount(), and ~KISTATUSBAR().
|
private |
Definition at line 159 of file kistatusbar.h.
Referenced by fieldIndex(), and KISTATUSBAR().
|
private |
Definition at line 155 of file kistatusbar.h.
Referenced by ClearLoadWarningMessages(), KISTATUSBAR(), onSize(), updateWarningUI(), and ~KISTATUSBAR().