26#include <wx/statusbr.h>
28#include <wx/stattext.h>
29#include <fmt/format.h>
37#include <wx/dcclient.h>
39#define FIELD_OFFSET_BGJOB_TEXT 0
40#define FIELD_OFFSET_BGJOB_GAUGE 1
41#define FIELD_OFFSET_BGJOB_CANCEL 2
42#define FIELD_OFFSET_NOTIFICATION_BUTTON 3
46 wxStatusBar( parent, id ),
47 m_normalFieldsCount( aNumberFields )
53 const int ExtraFields = 5;
55 const int ExtraFields = 4;
57 SetFieldsCount( aNumberFields + ExtraFields );
59 int* widths =
new int[aNumberFields + ExtraFields];
61 for(
int i = 0; i < aNumberFields; i++ )
71 widths[aNumberFields + ExtraFields - 1] = 10;
74 SetStatusWidths( aNumberFields + ExtraFields, widths );
78 int* styles =
new int[aNumberFields + ExtraFields];
80 for(
int i = 0; i < aNumberFields + ExtraFields; i++ )
81 styles[i] = wxSB_FLAT;
83 SetStatusStyles( aNumberFields + ExtraFields, styles );
89 wxGA_HORIZONTAL | wxGA_SMOOTH );
95 wxDefaultSize, wxBU_EXACTFIT );
127 pos.x += r.GetWidth();
139 pos.x += r.GetWidth();
156 int w = r.GetWidth();
157 int h = r.GetHeight();
218 cnt = fmt::format(
"{}", aCount );
231 wxString etext = aText;
235 if( GetFieldRect( aFieldId, fieldRect ) )
236 width = fieldRect.GetWidth();
240 wxClientDC dc(
this );
244 etext = wxControl::Ellipsize( etext, dc, wxELLIPSIZE_MIDDLE, width - margin );
247 SetStatusText( etext, aFieldId );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
void ShowList(wxWindow *aParent, wxPoint aPos)
Shows the background job list.
BITMAP_BUTTON * m_notificationsButton
void SetBackgroundStatusText(const wxString &aTxt)
Set the status text that displays next to the progress bar.
void onBackgroundProgressClick(wxMouseEvent &aEvent)
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.
KISTATUSBAR(int aNumberFields, wxWindow *parent, wxWindowID id)
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
#define FIELD_OFFSET_BGJOB_TEXT
#define FIELD_OFFSET_BGJOB_GAUGE
#define FIELD_OFFSET_NOTIFICATION_BUTTON
#define FIELD_OFFSET_BGJOB_CANCEL
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.