26#include <wx/statusbr.h>
28#include <wx/stattext.h>
29#include <fmt/format.h>
38#include <wx/dcclient.h>
42 wxStatusBar( parent, id ),
63 if( showNotification )
66 SetFieldsCount( aNumberFields + extraFields );
68 int* widths =
new int[aNumberFields + extraFields];
70 for(
int i = 0; i < aNumberFields; i++ )
74 widths[aNumberFields + *idx] = -1;
77 widths[aNumberFields + *idx] = 75;
80 widths[aNumberFields + *idx] = 20;
83 widths[aNumberFields + *idx] = 20;
87 widths[aNumberFields + extraFields - 1] = 10;
90 SetStatusWidths( aNumberFields + extraFields, widths );
93 int* styles =
new int[aNumberFields + extraFields];
95 for(
int i = 0; i < aNumberFields + extraFields; i++ )
96 styles[i] = wxSB_FLAT;
98 SetStatusStyles( aNumberFields + extraFields, styles );
104 wxGA_HORIZONTAL | wxGA_SMOOTH );
109 wxDefaultSize, wxBU_EXACTFIT );
112 if( showNotification )
115 wxDefaultSize, wxBU_EXACTFIT );
151 pos.x += r.GetWidth();
163 pos.x += r.GetWidth();
171 constexpr int padding = 5;
179 if( r.GetHeight() > textHeight )
180 y += ( r.GetHeight() - textHeight ) / 2;
187 int w = r.GetWidth();
188 int h = r.GetHeight();
189 wxSize buttonSize( 0, 0 );
196 buttonSize.x += padding;
257 cnt = fmt::format(
"{}", aCount );
270 wxString etext = aText;
274 if( GetFieldRect( aFieldId, fieldRect ) )
275 width = fieldRect.GetWidth();
279 wxClientDC dc(
this );
283 etext = wxControl::Ellipsize( etext, dc, wxELLIPSIZE_MIDDLE, width - margin );
286 SetStatusText( etext, aFieldId );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
void ShowList(wxWindow *aParent, wxPoint aPos)
Shows the background job list.
BITMAP_BUTTON * m_notificationsButton
std::optional< int > fieldIndex(FIELD aField) const
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)
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.
void SetNotificationCount(int aCount)
Set the notification count on the notifications button.
void ShowList(wxWindow *aParent, wxPoint aPos)
Show the notification list.
virtual BACKGROUND_JOBS_MONITOR & GetBackgroundJobMonitor() const
virtual NOTIFICATIONS_MANAGER & GetNotificationsManager() const
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
PGM_BASE & Pgm()
The global program "get" accessor.
Functions to provide common constants and other functions to assist in making a consistent UI.